G
gwoodhouse
Hello, hopefully someone can help with this - i must be missing some
knowledge on XSLT variables because to my mind this should work:
What im trying to do is check if variable1 has variable2 contained
within it. To do that i wrote this code:
<xsl:when test="fn:contains($selectedNode, @name)">
This doesnt work getting a null pointer error for @name. So i wrote
this bit of debug:
1 <xsl:value-of select="fn:length($selectedNode)"/>
2 <xsl:value-of select="@name"/>
3 <xsl:variable name="jim"><xsl:value-of select="@name"/></
xsl:variable>
4 <xsl:value-of select="$jim"/>
5 <xsl:value-of select="fn:length($jim)"/>
This also falls over on instruction 5 giving this output:
1 48
2 bob
3
4 bob
5
As you can see it just doesnt seem to like using the variable in any
functions - but as you can also see it uses a global xslaram
variable correctly and gives the right length.
What is it that im missing?
Thanks
Graeme
knowledge on XSLT variables because to my mind this should work:
What im trying to do is check if variable1 has variable2 contained
within it. To do that i wrote this code:
<xsl:when test="fn:contains($selectedNode, @name)">
This doesnt work getting a null pointer error for @name. So i wrote
this bit of debug:
1 <xsl:value-of select="fn:length($selectedNode)"/>
2 <xsl:value-of select="@name"/>
3 <xsl:variable name="jim"><xsl:value-of select="@name"/></
xsl:variable>
4 <xsl:value-of select="$jim"/>
5 <xsl:value-of select="fn:length($jim)"/>
This also falls over on instruction 5 giving this output:
1 48
2 bob
3
4 bob
5
As you can see it just doesnt seem to like using the variable in any
functions - but as you can also see it uses a global xslaram
variable correctly and gives the right length.
What is it that im missing?
Thanks
Graeme