S
shaun roe
I have the following function:
<xsl:function name="sar:Oks2CoolRel" as="xs:string">
<xslaram name="oksRel" as="xs:string"/>
<xsl:variable name="relList" >
<xsl:value-of select="tokenize($oksRel,' ')"/>
</xsl:variable>
<xsl:variable name="result" >
<xsl:value-of select="' '"/>
<xsl:for-each select="$relList">
<xsl:value-of select="concat(.,' ',position())"/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$result"/>
</xsl:function>
in xslt 2.0.
so , I construct a sequence using 'tokenize' on a space-separated string
and then try to iterate over it with for-each, outputting the element
and its position.
However I find that all I get back is the entire string followed by a
'1'. In other words there is only one element in the sequence which is
the whole string... whats going wrong? Doesnt tokenize construct a
sequence?
cheers
shaun
<xsl:function name="sar:Oks2CoolRel" as="xs:string">
<xslaram name="oksRel" as="xs:string"/>
<xsl:variable name="relList" >
<xsl:value-of select="tokenize($oksRel,' ')"/>
</xsl:variable>
<xsl:variable name="result" >
<xsl:value-of select="' '"/>
<xsl:for-each select="$relList">
<xsl:value-of select="concat(.,' ',position())"/>
</xsl:for-each>
</xsl:variable>
<xsl:value-of select="$result"/>
</xsl:function>
in xslt 2.0.
so , I construct a sequence using 'tokenize' on a space-separated string
and then try to iterate over it with for-each, outputting the element
and its position.
However I find that all I get back is the entire string followed by a
'1'. In other words there is only one element in the sequence which is
the whole string... whats going wrong? Doesnt tokenize construct a
sequence?
cheers
shaun