Hi,
I'm quite new to xslt and have discovered some strange results when using the <xsl:variable>.
Look at these two variables.
Code:
Number 1:
<xsl:variable name="relatedFile" select="/mother/child/file" />
Number 2:
<xsl:variable name="relatedFile2">
<xsl:value-of select ="/mother/child/file" />
</xsl:variable>
These two variables, even though instanciated a bit differently should hold exactly the same information right?
Next I want to use the variables to get an attribute of the node. Like this:
Code:
<xsl:value-of select"$relatedFile/@key" />
<xsl:value-of select"$relatedFile2/@key" />
But strangly, only relatedFile gives me the key. RelatedFile2 gives me nothing.
And even stranger, if i compare them like this:
Code:
<xsl:if test="$relatedFile=$relatedFile2"> yes they are equal! </xsl:if>
They are equal!
What is going on here??
Thanks for all your help!