T
Tjerk Wolterink
Hello, i've an xml doc like this:
<doc>
<item>a</item>
<item>b</item>
<item>c</item>
<item>d</item>
<item>e</item>
<item>f</item>
<item>g</item>
</doc>
Now i want this to be transformed to something like this:
<doc2>
<three>
<item>a</item>
<item>b</item>
<item>c</item>
</three>
<three>
<item>d</item>
<item>e</item>
<item>f</item>
</three>
<three>
<item>g</item>
</three>
</doc2>
Well i think i need a for-each, but does for-each support, for each,
lets say three elements??
I now have something like this:
<xsl:for-each select="item">
xsl:if test="position() mod 3=0 and position()!=0">
</three>
</xsl:if>
<xsl:if test="position() mod 3=0">
<three>
</xsl:if>
<item>
<xsl:value-of select="."/>
</item>
</xsl:for-each>
But this is no valid xml, please help
<doc>
<item>a</item>
<item>b</item>
<item>c</item>
<item>d</item>
<item>e</item>
<item>f</item>
<item>g</item>
</doc>
Now i want this to be transformed to something like this:
<doc2>
<three>
<item>a</item>
<item>b</item>
<item>c</item>
</three>
<three>
<item>d</item>
<item>e</item>
<item>f</item>
</three>
<three>
<item>g</item>
</three>
</doc2>
Well i think i need a for-each, but does for-each support, for each,
lets say three elements??
I now have something like this:
<xsl:for-each select="item">
xsl:if test="position() mod 3=0 and position()!=0">
</three>
</xsl:if>
<xsl:if test="position() mod 3=0">
<three>
</xsl:if>
<item>
<xsl:value-of select="."/>
</item>
</xsl:for-each>
But this is no valid xml, please help