[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Sorting by child element count
Subject: Re: Sorting by child element count
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 29 Dec 2010 15:43:04 +0000
|
On 29/12/2010 15:21, Mark wrote:
Happy new year! Thanks for all the help this list has given me over the
past two years. My question:
I have an XML document that looks like the listing below. I want to sort
the <List> by <Item> so that all the <Items> with one <Data> element are
followed by all the <Items> with two <Data> elements, and so on, until
the last <Items> in the output list have the most <Data> elements. The
<Data> elements have to remain inside their original parent <Item>.
No clue how to begin. Can you point me in the right direction?
Thanks,
Mark
<List>
<Item>
<Data>...</Data>
... <!bpossibly 1 to 10 or so <Data> elements in each parent <Item>
element.
<Data>...</Data>
</Item>
... <!b400 <Item> elements in the <List> b>
</List>
________________________________________________________________________
This e-mail has been scanned for all viruses by Star.
________________________________________________________________________
xsl;for-each select=Item
xsl:sort select="count(Data)"
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
|
Atom 0.3 |
|
|