473,836 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSLT extension function fails when not running under aspnet_wp.

Hello

I posted this in the vb.net group on the 2/25/2004, but didn't get any
response. Here's attempt 2. Does anyone know of a more appropriate
place to post this?

One new piece of information: It fails on any method that it happens
to hit first. I juggled the methods a bit, and it just doesn't matter.
As soon as the XslTransform hits an extension function, it fails with
an invalid argument exception.

Thank you for your help.

----
REPOST FOLLOWS:

Greetings

I have an object that I use with an XSLT. I add the object to the XSLT
using addExtensionObj ect on the XsltArgumentLis t.

I built a test aspx to test it. It works great. Then I tried using it
via NUnit, and it always fails. (I've tried starting NUnit within the
project, and also just running it direct. Also, I think the fact that
it's NUnit is inconsequential ... I'm guessing that this would probably
happen with any program trying to run it.)

-- Exceptions ---
Outer Exception: System.Xml.Xsl. XsltException: Function
'xsltgenerator: RegularExpressi onTest()' has failed.

Inner Exception: System.Argument Exception: Object type cannot be
converted to target type.

I don't understand why it can be converted to the proper target type
when instantiated from an aspx, but not from NUnit.

-- RegularExpressi onTest method --
Public Function RegularExpressi onTest(ByVal nodes As
System.Xml.XPat h.XPathNodeIter ator, ByVal sExpression As String) As
String
Return "crap"
nodes.MoveNext( )
Return nodes.Current.V alue + "[validator:RegEx Match('" +
sExpression + "', .)=0]"
End Function

The "return crap" is a test. It didn't help.

Any ideas? Could it be security related, and if so, what do I need to
know? I didn't have any luck searching MSDN for it.

Thank you.


--- Partial Test Code ---
docData is my source System.Xml.XmlD ocument.
GetRulesXSLT() returns a System.Xml.Xsl. XslTransform()

Dim xtRuleXSLT As XslTransform
Dim docResponseXML as New XmlDocument()

xtRuleXSLT = GetRuleXSLT()

Dim args As New XsltArgumentLis t()
args.AddExtensi onObject("urn:v alidator", New XMLValidator())
docResponseXML. Load(xtRuleXSLT .Transform(New XPathDocument(N ew
XmlNodeReader(d ocData)), args))

--- Full Exception ---
System.Xml.Xsl. XsltException: Function
'xsltgenerator: RegularExpressi onTest()' has failed. --->
System.Argument Exception: Object type cannot be converted to target
type.
at System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean isBinderDefault , Assembly caller, Boolean
verifyAccess)
at System.Reflecti on.RuntimeMetho dInfo.InternalI nvoke(Object obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture, Boolean verifyAccess)
at System.Reflecti on.RuntimeMetho dInfo.Invoke(Ob ject obj,
BindingFlags invokeAttr, Binder binder, Object[] parameters,
CultureInfo culture)
at System.Reflecti on.MethodBase.I nvoke(Object obj, Object[]
parameters)
at System.Xml.Xsl. FuncExtension.I nvoke(XsltConte xt xsltContext,
Object[] args, XPathNavigator docContext)
at System.Xml.XPat h.XsltFunction. InvokeFunction( XPathNavigator qy)
--- End of inner exception stack trace ---
at System.Xml.XPat h.XsltFunction. InvokeFunction( XPathNavigator qy)
at System.Xml.XPat h.XsltFunction. getValue(XPathN avigator qy,
XPathNodeIterat or iterator)
at System.Xml.XPat h.StringFunctio ns.toString(XPa thNavigator
qyContext, XPathNodeIterat or iterator)
at System.Xml.XPat h.StringFunctio ns.getValue(XPa thNavigator qy,
XPathNodeIterat or iterator)
at System.Xml.XPat h.StringFunctio ns.Concat(XPath Navigator qy,
XPathNodeIterat or iterator)
at System.Xml.XPat h.StringFunctio ns.getValue(XPa thNavigator qy,
XPathNodeIterat or iterator)
at System.Xml.XPat h.XPathNavigato r.Evaluate(XPat hExpression expr,
XPathNodeIterat or context)
at System.Xml.Xsl. Processor.Value Of(ActionFrame context, Int32 key)
at System.Xml.Xsl. ValueOfAction.E xecute(Processo r processor,
ActionFrame frame)
at System.Xml.Xsl. ActionFrame.Exe cute(Processor processor)
at System.Xml.Xsl. Processor.Execu te()
at System.Xml.Xsl. ReaderOutput.Re ad()
at System.Xml.XPat h.XPathDocument .ReadChildNodes (XPathContainer
parent, String parentBaseUri, XmlReader reader, PositionInfo
positionInfo)
at System.Xml.XPat h.XPathDocument .ReadChildNodes (XPathContainer
parent, String parentBaseUri, XmlReader reader, PositionInfo
positionInfo)
at System.Xml.XPat h.XPathDocument .ReadChildNodes (XPathContainer
parent, String parentBaseUri, XmlReader reader, PositionInfo
positionInfo)
at System.Xml.XPat h.XPathDocument .ReadChildNodes (XPathContainer
parent, String parentBaseUri, XmlReader reader, PositionInfo
positionInfo)
at System.Xml.XPat h.XPathDocument .ReadChildNodes (XPathContainer
parent, String parentBaseUri, XmlReader reader, PositionInfo
positionInfo)
at System.Xml.XPat h.XPathDocument .Load(XmlReader reader)
at System.Xml.XPat h.XPathDocument ..ctor(XmlReade r reader, XmlSpace
space)
at System.Xml.Xsl. XslTransform.Lo ad(XmlReader stylesheet,
XmlResolver resolver)
at System.Xml.Xsl. XslTransform.Lo ad(XmlReader stylesheet)
at Lydian.Framewor k.Validator.Val idator.BuildRul eXSLT() in
C:\Development\ VB Components\Mini Comp\Validator\ Validator.vb:li ne 142
Nov 22 '05 #1
0 1579

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1549
by: Gordan | last post by:
I'm running Apache/1.3.33 (Win32) PHP/5.0.4 on WinXP in my php.ini I uncommented the extension=php_xsl.dll line. When running phpinfo() I have the following section on XSL xsl XSL enabled libxslt Version 1.1.7 libxslt compiled against libxml Version 2.6.11 EXSLT enabled libexslt Version 0.8.5
3
2691
by: Peter Sparago | last post by:
(Sorry in advance for the long post.) Hi, I'm having a great deal of difficulty buiding a Python COM extension. I am using the MSHTML ActiveX control in my application but I need to interact with and implement some Custom COM interfaces. All is well with the basic operation of the control using Python. Basically, I want to take over the right-click (context) menu from
3
2144
by: Justine Hlista | last post by:
I'm using xalan-j_2_6_0 and trying to get an example from Michael Kay's book to work: <xsl:template match="/"> <xsl:variable name="rainbow"> <color>red</color> <color>blue</color> <color>green</color> </xsl:variable>
7
4130
by: RC | last post by:
First, let me say I couldn't find a group discuss XML/XSLT. So I only choose the closest groups to post this message. Here is part of my *.xsl file <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan" xmlns:my-javascript-ext="my-ext1" extension-element-prefixes="my-javascript-ext"
0
380
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of information: It fails on any method that it happens to hit first. I juggled the methods a bit, and it just doesn't matter. As soon as the XslTransform hits an extension function, it fails with an invalid argument exception.
14
24246
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". This all works in Internet Explorer, but doesn't work with Firefox. In both IE and Firefox this works: <?xml-stylesheet type="text/xsl" encoding="UTF-8" href="makehtml.xslt" version="1.0"?>
6
4548
by: Jain, Pranay Kumar | last post by:
Hi All, We have created a simple application that takes a dataset and generates the data in Excel schema format. It uses an xslt file to do the transformation for excel 2002 and so on. We are using the dotnet.xml resource and not the MSXML 4. The application is golden and works fine with realtively Medium size of data(around 25MB). We started to see issues if the data is greater then 25 MB where the transformation takes tooo long and...
2
2269
by: David Laub | last post by:
A transform that works fine in XMLSPy fails when I run it under dot net. I've run many other transforms successfully in dot net so there is something "special" about this transform I just installed dot net framework 1.1 SP1 - but I still get the same error What makes this transform more complex than others is: 1) It uses an MSXSL extension function to evaluate Xpaths at run time 2) It uses an include to include the extension function 3)...
0
1307
by: daniele.balducci | last post by:
Hi All, I'm experiencing troubles in a simple .net web application. The applicatione is made up by a single form looping to move some files to a different folder . the main loop is as follows : C Const CurrUploadDir= ..... Const CurrSentDir= ..... Dim CurFile as string CurFile = Dir(CurrUploadDir & "*.*")
1
1929
by: Peran | last post by:
If I create a simple xslt stylesheet I can quickly test this in VS2005 by pressing the "Show XSLT Output" button rather than running the whole solution. If I then create a xslt stylesheet with some extended functions I have to run the whole solution (adding the extension objects to the XsltArgumentList when calling XslCompiledTransform.Transform). The "Show XSLT Output" function does not work because it does not know where to find the...
0
10854
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10558
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10257
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9387
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7794
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6981
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5829
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4459
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4022
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.