By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,701 Members | 1,955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,701 IT Pros & Developers. It's quick & easy.

How do I sort by [rank] and display [name] with [xsl]?

P: n/a
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="filename.xsl"?>
<markers date="20060523">
04:21:50 PM
<marker sn="1" rank="6" name="john" />
<marker sn="2" rank="5" name="mary" />
<marker sn="3" rank="4" name=suzy" />
</markers>

How do I sort by [rank] and display [name] using [xsl] etc- some help
with drill-down?
Thanks, Lorrie

[reference]:
http://groups.google.com/group/comp....AGdfrh31zskQ7Q
http://groups.google.com/group/comp....5e45baaff2c14d

May 31 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 31 May 2006 17:13:27 +0200, <vo*******@spatiallink.org> wrote:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="filename.xsl"?>
<markers date="20060523">
04:21:50 PM
<marker sn="1" rank="6" name="john" />
<marker sn="2" rank="5" name="mary" />
<marker sn="3" rank="4" name=suzy" />
</markers>

How do I sort by [rank] and display [name] using [xsl] etc- some help
with drill-down?

I guess the best way to learn is to learn by example:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>

<xsl:template match="markers">
<table>
<caption>markers</caption>
<tr>
<th>name</th>
<th>rank</th>
</tr>
<xsl:apply-templates select="marker">
<xsl:sort select="@rank" data-type="number" order="ascending"/>
</xsl:apply-templates>
</table>
</xsl:template>

<xsl:template match="marker">
<tr>
<td><xsl:value-of select="@name"/></td>
<td><xsl:value-of select="@rank"/></td>
</tr>
</xsl:template>

</xsl:stylesheet>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Veni, vidi, wiki (http://www.wikipedia.org)
Jun 2 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.