Click to See Complete Forum and Search --> : question for paps


iuli
09-17-2003, 10:28 AM
Ok, but I don't know how to create a variable that contains a list of nodes (node-set) through a for-each.

<xsl:variable name"test">
<xsl:for-each select"initial_list">
<xsl:value-of select="current()"/>
</xsl:for-each>
</xsl:variable>

I want that variable 'test' to contain a list of nodes.

Is it possible to do something like this? (to change the value of a variable during a for-each cycle?)

paps
09-17-2003, 07:26 PM
Yes it is possible to change a value of variable within a for-each loop...instead of writing this...


<xsl:variable name"test">
<xsl:for-each select"initial_list">
<xsl:value-of select="current()"/>
</xsl:for-each>
</xsl:variable>

y dont u try....

<xsl:for-each select"initial_list">
<xsl:variable name"test" select="."/>
</xsl:for-each>

"current()" and "." should mean the same, current() becomes different only when used in the context of [] brackets

This should keep updating the "test" variable with new value, each time it loops through....

Hope this helps...