Hi Guys,
Need your help on following....
I have following XML which i want to covert it as Text with Numbering added to it.
Code:
<?xml version="1.0"?>
<ROWSET>
<ROW>
<ERROR_MESSAGE>Error</ERROR_MESSAGE>
</ROW>
<ROW>
<ERROR_MESSAGE>Error</ERROR_MESSAGE>
</ROW>
<ROW>
<ERROR_MESSAGE>Error</ERROR_MESSAGE>
</ROW>
</ROWSET>
XSLT code
Code:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="ROWSET">
<xsl:apply-templates select="ROW"/>
</xsl:template>
<xsl:variable name="ItemIndex" select="0"/>
<xsl:template match="ROW">
<xsl:for-each select="*">
<xsl:variable name="pos" select="position()"/><xsl:value-of select="$ItemIndex[$pos]"/>
<xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Using XSLT on above XML ...i am getting following output...
0Error
0Error
0Error
desired output...
1Error
2Error
3Error
thanks in advance for pointing out the error in my XSLT...