Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
XSLT Sequential Numbering
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Liam, post: 2974736"] I am totally new to XML and XSLT, so I I have an XML file of: <log> <logvalue code="500" description="desc" > <logvalue code="510" description="desc" > <logvalue code="504" description="desc" > <logvalue code="1" description="desc" > <logvalue code="503" description="desc" > <log> I want to process it using XSLT transform. I want to generate a table as HTML output with the first column as a sequential value of rows. I am using :- <xsl:if test='count(//log/logvalue [@code>=500]) > 0'> <xsl:if test='count(//log/logvalue [@code<=510]) > 0'> <table border="1"> <tr> <th>Identifier</th> <th>Code</th> <th>Detail</th> </tr> <xsl:for-each select="//log/logvalue "> <xsl:if test="@code>=500"> <xsl:if test="@code<=510"> <tr> <td style="width:10%"> <xsl:number/> </td> <td style="width:30%"> <xsl:value-of select=@code/> </td> <td style="width:60%"> <<xsl:value-of select="@description"/> </td> </tr> </xsl:if> </xsl:if> </xsl:for-each> </table> </xsl:if> </xsl:if> Now the Identifier column should display a sequential value for each row that is printed but when I use <xsl:number/> it is the position in the list rather than the incremental value as it is printed. Can anyone help here? Thanks,Liam [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
XSLT Sequential Numbering
Top