igorjrr
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by igorjrr
-
-
Very simple example... but don't understand why.
<xsl:variable name="i" select="1" /> <xsl:variable name="a" select="35" /> <xsl:variable name="b" select="'fn'" /> <xsl:variable name="c"> <xsl:if test="$i < $a"> <xsl:value-of select="$b" /> </xsl:if> <xsl:if test="$i = $a">'test'</xsl:if></xsl:variable>
At the end, value is a node instead of just the text 'fn'.
If I use
xsl:variable name="c" select="$b" />
Then the value is correct (just 'fn').
Any help?
Problem with conditional variable value
in XSLT/XSL-FO
Posted
I found the answer. Variables created that way (not using select) are considered Reference Tree Fragment (http://msdn.microsoft.com/en-us/library/4wwc9138.aspx).
It's still possible to use the variable content the normal way, although the object will be a RTF.
Now, If you have a list of nodes, you have to transform the variable to a NodeSet and then call the nodes() function like
Then it will be just like creating a variable with the select argument.