Dear all,
How to use for loop in xslt to get value iteratively from an xml file and to dispaly it in table fromat
for example: the xml file is like
<order>
<item name ="a"/>
<item name ="b"/>
<item name ="c"/>
<item name ="d"/>
<item name ="e"/>
<item name ="f"/>
<item name ="g"/>
</order>
and the output should be
a b c d
e f g
the loop should count the item and if it is divisble by 4 it
should close the current row and add a new row and so on..
i'm using the following xslt for this
but i can not display it in table format
<xsl:template match="/">
<html>
<body>
<xsl:call-template name ="incr">
<xsl:with-param name ="value">1</xsl:with-param>
<xsl:with-param name ="limit">
<xsl:value-of select ="count(//item)"/>
</xsl:with-param>
</xsl:call-template>
</body>
</html>
</xsl:template >
<xsl:template name="incr">
<xsl:param name="value"/>
<xsl:param name ="limit"/>
<xsl:if test ="$value!=$limit+1">
<xsl:value-of select ="//item[$value]/@name"/>
<xsl:if test ="$value mod 4 =0">
<br/>
<br/>
</xsl:if>
<xsl:call-template name ="incr">
<xsl:with-param name ="value" select ="$value+1"/>
<xsl:with-param name ="limit" select ="$limit"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
please help me to do this
Thanks in advance