|
Subject: [xsl] Adjusting sorted list From: Andrew Timberlake <andrew.lists@xxxxxxxxx> Date: 16 May 2002 16:04:37 +0200 |
I have the following XML:
<a>
<b>4</b>
<b>9</b>
<b>6</b>
<b>1</b>
<b>8</b>
<b>6</b>
<b>4</b>
<b>7</b>
</a>
I am trying to generate the following ouput:
<a>
<b rank="1">1</b>
<b rank="2">4</b>
<b rank="2">4</b>
<b rank="3">6</b>
<b rank="3">6</b>
<b rank="4">7</b>
<b rank="5">8</b>
<b rank="6">9</b>
</a>
Using xsl:for-each with a sort on b and then using position() I can get
a ranking from 1 to 8 but I have no idea how to achieve the above.
I have dug around in the archives for some ideas but to no avail.
I see that I can't use a variable and adjust it's value with each
iteration (as it's not actually iterating).
I have also looked into using a recursive named template but am not sure
how to achieve the above and sort the output???
Thanks in advance for any help.
Andrew
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] IF in a variable declarat, J.Pietschmann | Thread | Re: [xsl] Adjusting sorted list, Jeni Tennison |
| [xsl] IF in a variable declaration, Xavier DAMAY | Date | [xsl] Variable confusion, Tompkins Tim |
| Month |