I must be reading XPath 2.0 incorrectly.
It seems that the statement:
Code:
for $i in 1 to 10 return $i
would return a sequence of the numbers from 1 to 10.
But putting that in a variable:
Code:
<xsl:variable name="temp">
<xsl:sequence select="for $i in 1 to 10 return $i"/>
<xsl:/variable>
<xsl:for-each select="$temp">
<xsl:value-of select="."/>
</xsl:for-each>
is not giving me what I wanted: access to each of the members of the sequence created from 1 to 10.
Now, for my purpose, this may be moot as I may be able to use
Code:
<xsl:for-each select="1 to 10">
<xsl:value-of select="."/>
</xsl:for-each>
and accomplish my goal. But I thought I was on to something with the results of the for/in/to/return statement being put in a variable.
Having it in a variable might be nice so I could pass the sequence around to other functions or templates.
Did I leave something out, or is it just the wrong application/purpose of the for/in/to/return construct?
Thanks,