Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : XSLT Extension Objects and Node Sets


Matt
10/28/2005 7:32:17 PM
I need help with passing a generated node set from a style sheet into my =
customer msxsl extension. I have the following node set that I am =
creating:

<xsl:variable name=3D"sql">
<SQL>
<StoredProc>spGetReconID</StoredProc>
<Parms>
<parm>
<name>@tran</name>
<value>956</value>
</parm>
<parm>
<name>@refnbr</name>
<value><xsl:value-of select=3D"$shipnbr"/></value>
</parm>
<parm>
<name>@keyfld</name>
<value><xsl:value-of select=3D"$ponbr"/></value>
</parm>
</Parms>
</SQL>
</xsl:variable>
<xsl:value-of select=3D"user:GetDBValue('myDB', msxsl:node-set($sql))"/>

The return value is just a string as we only want to return a single =
value. The above code is inside a template and that is why we execute =
the user function with only a value-of statement. We are trying to =
create a generic type function that is why we are trying to use the =
node-set to allow future flexibility. When we receive the node-set in =
the extended function we only see the XML that was passed to the style =
sheet and not the above node-set. Does anyonen have a sample they can =
share on how to get this working?

Thanks,=20

Dimitre Novatchev
10/29/2005 12:00:00 AM
Too little information is provided to engage in an answer...


Cheers,
Dimitre Novatchev
[quoted text, click to view]
I need help with passing a generated node set from a style sheet into =
my customer msxsl extension. I have the following node set that I am =
creating:

<xsl:variable name=3D"sql">
<SQL>
<StoredProc>spGetReconID</StoredProc>
<Parms>
<parm>
<name>@tran</name>
<value>956</value>
</parm>
<parm>
<name>@refnbr</name>
<value><xsl:value-of select=3D"$shipnbr"/></value>
</parm>
<parm>
<name>@keyfld</name>
<value><xsl:value-of select=3D"$ponbr"/></value>
</parm>
</Parms>
</SQL>
</xsl:variable>
<xsl:value-of select=3D"user:GetDBValue('myDB', =
msxsl:node-set($sql))"/>

The return value is just a string as we only want to return a single =
value. The above code is inside a template and that is why we execute =
the user function with only a value-of statement. We are trying to =
create a generic type function that is why we are trying to use the =
node-set to allow future flexibility. When we receive the node-set in =
the extended function we only see the XML that was passed to the style =
sheet and not the above node-set. Does anyonen have a sample they can =
share on how to get this working?

Thanks,=20

Dimitre Novatchev
10/29/2005 12:00:00 AM
In particular, I don't understand the following sentence:

"When we receive the node-set in the extended function we only see the XML
that was passed to the style sheet and not the above node-set."

In order to understand what really is happening and then try to explain it,
it would be necessary to provide a complete (but the minimal possible)
source-code that reproduces the strange behaviour.

The code provided in the previous messages seems OK to me and therefore is
insufficient to provide the cause of the strange behaviour -- it must be in
code, which you haven't shown.

Cheers,
Dimitre Novatchev


[quoted text, click to view]

Matt
10/29/2005 12:33:20 AM
Sorry, I don't know how to describe the issue further. What information are
you looking for?

I have a .Net object I pass in as an URN with defined XSLT extensions and
then they are called from the style sheet. I create the node as outlined in
the original problem and execute the user function as shown in the sample.

[quoted text, click to view]
Too little information is provided to engage in an answer...


Cheers,
Dimitre Novatchev
[quoted text, click to view]
I need help with passing a generated node set from a style sheet into my
customer msxsl extension. I have the following node set that I am creating:

<xsl:variable name="sql">
<SQL>
<StoredProc>spGetReconID</StoredProc>
<Parms>
<parm>
<name>@tran</name>
<value>956</value>
</parm>
<parm>
<name>@refnbr</name>
<value><xsl:value-of select="$shipnbr"/></value>
</parm>
<parm>
<name>@keyfld</name>
<value><xsl:value-of select="$ponbr"/></value>
</parm>
</Parms>
</SQL>
</xsl:variable>
<xsl:value-of select="user:GetDBValue('myDB', msxsl:node-set($sql))"/>

The return value is just a string as we only want to return a single
value. The above code is inside a template and that is why we execute the
user function with only a value-of statement. We are trying to create a
generic type function that is why we are trying to use the node-set to allow
future flexibility. When we receive the node-set in the extended function
we only see the XML that was passed to the style sheet and not the above
node-set. Does anyonen have a sample they can share on how to get this
working?

Thanks,

Matt


Oleg Tkachenko [MVP]
10/30/2005 11:49:26 AM
[quoted text, click to view]

That's really weird. In an extension function you only can get what is
passed as function arguments.

--
Oleg Tkachenko [XML MVP, MCAD]
Oleg Tkachenko [MVP]
10/30/2005 11:50:46 AM
Chances are you don't call MoveNext() on passed XPathNodeIterator - show
us how what do you do in your function.

--
Oleg Tkachenko [XML MVP, MCAD]
http://www.XmlLab.Net | http://www.XLinq.Net | http://blog.tkachenko.com

[quoted text, click to view]
AddThis Social Bookmark Button