Iterating elements multiple times.
Posted: Fri Aug 17, 2012 7:08 pm
Hello again!
In my transformer I need to iterate my XML x times, and apply various date changes and calculations on the extracted results.
Using :
results in :
When calling the template like this:
And of course the same error occurs if I move the <xsl:for-each> into the template.
I know I'm not doing it right but I really can't see another way, can anyone show me how this should be done please?
--
William
In my transformer I need to iterate my XML x times, and apply various date changes and calculations on the extracted results.
Using :
Code: Select all
<xsl:for-each select="for $offset in (0 to ($loopCount -1)) return $offset">
<xsl:call-template name="stuff">
<xsl:with-param name="offset" select="."/>
</xsl:call-template>
</xsl:for-each>
Code: Select all
Required item type of first operand of '/' is node(); supplied value has item type xs:integer
When calling the template like this:
Code: Select all
<xsl:template name="stuff">
<xsl:param name="offset"/>
<nodeName>
<xsl:for-each select="./xxxx">
...
</xsl:template>
I know I'm not doing it right but I really can't see another way, can anyone show me how this should be done please?
--
William