Thx for your fast answer Oleg,
"Oleg Tkachenko [MVP]" <oleg@no_!spam!_please!tkachenko.com> wrote in message news:<ua**************@TK2MSFTNGP09.phx.gbl>...
Blaise Garant wrote:
I've made a stylesheet to transform my data into XSL-FO. This
stylesheet used to work with MSXSL 4.0 but I've got some issues in
.NET. First, I changed removed all the "node-set()" function since
they're not used anymore.
Could you elaborate this point? There is no any difference between MSXML
and .NET with regard to node-set() extension function. If you use in in
MSML stylesheet, you have to continue use it in .NET.
Well, it doesn't seem like it. See, in my XML sample, <Cahier> is in
fact a childnode to <Booklet>. So at the begining of the stylesheet I
made a global variable: <xsl:variable name="MemberInfo"
select="/Booklet/Cahier"/>. Now if I use <xsl:value-of
select="$MemberInfo/Actives/Status/Participant/NAS"> I get the value
of the NAS node of the first Participant node, just like I should
expect (in that sample, 123456789). Now this was impossible with
MSXML, I need the node-set() function to do this. Also, now as soon as
I use node-set(), I get a "Function 'msxsl:node-set()' has failed."
exception.
So the "apply-templates" tag continu the process to the <Name> and
<Participant> tags but for some reason, I get an "The expression
passed to this method should result in a NodeSet." exception.
I don't believe <xsl:apply-templates/> instruction may cause this
exception. Chances are it's connected with node-set() function you have
removed - it converts a result tree fragment to a nodeset.
Ok, you're right, they are partly connected. I use my XMLReader to
read the output line by line. Everything goes well up to that point.
I've got a template for a match with a Participant node, starting with
variables. So I put a empty node just for a test and so, it stop just
after it so you're right, <xsl:apply-templates/> is not the problem.
Here's another XSLT sample:
-------------XSLT---------------
<xsl:template match="Participant">
<xsl:variable name="TemplateType">
<xsl:value-of select="name(parent::*/parent::*)"/>
</xsl:variable>
<test><xsl:value-of
select="msxsl:node-set($TemplateType)"/></test>
<xsl:variable name="BiggerCol">
<xsl:variable name="Sub">
<xsl:for-each
select="$LayoutInfo/Booklet_Definition/child::*[name()=$TemplateType]/Member/Column">
<xsl:element name="Column">
<xsl:element name="ColumnLen"><xsl:value-of
select="count(child::Element)"/></xsl:element>
<xsl:element name="Position"><xsl:value-of
select="position()"/></xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:variable>
.....
</xsl:template>
----------------------------
So it seems the program stoped while doing the BiggerCol variable node
(before I put the <test> node). With the <test> node the program bugs
at the <xsl:value-of> node. $TemplateType should contain the value
"Actives" but the call <xsl:value-of select="$TemplateType" seems now
to be waiting for a node-set! So as you see, I've try <xsl:value-fo
select="msxsl:node-set($TemplateType)/> But I get the same error
(curriously, not the "node-set() failed" exception).
Got an idea?
Blaise