473,383 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

<?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
1 1643
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jarle Presttun | last post by:
Hi, Sometimes I display values by combining information from different sections in the xml, like I do with gradeText in the student template bellow. Is it possible to sort on gradeText when I...
0
by: Chan | last post by:
I have about 1,000 records in my XML to be shown. It's too much to display all of them at once. So, paging is a good implementation. I'm doing all this at client side, that is, - xml dataisland...
1
by: Michael Hill | last post by:
I have a section of a stylesheet (below) I am trying to configure. The part I am having trouble with is the when test. I have a series of pulldowns that I can select from, some are text and some...
2
by: gdevah | last post by:
Hi , I have an xml file with below data,and would like to sort this based on the classname. I did try some xsl but not much use. <?xml version="1.0" encoding="UTF-8"?> <document>...
1
by: Omega375 | last post by:
Hello. I'll first start off by showing the structure of my xml-file. <root> <node path="X"> More nodes containing data </node> </root>
6
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows...
10
by: Jim Andersen | last post by:
I have this xml-file. I want to sort it, and create a new xml-file. The result should be identical to the input except that it's sorted. <?xml version="1.0" encoding="UTF-8"?> <levelone> <child...
15
by: bcochofel | last post by:
Hi, I want to use a variable to sort elements. That var his passed with query string (I'm using Perl CGI to generate XML). Here's a sample of my output:...
1
by: =?Utf-8?B?SWxsdXN0cmlz?= | last post by:
I'm hoping someone can help me with what looks like a very simple problem. My output does not sort the languages alphabetically as I would expect. Can someone inspect my XSLT please? TIA!! ...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.