Subject: Re: [xsl] Sorting by child element count From: "Mark" <mark@xxxxxxxxxxxx> Date: Wed, 29 Dec 2010 07:39:12 -0800 |
Maybe not the best way but you could copy/preprocess the Item elements and add an atribute with the number of Data elements. Then sort on the attribute.
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> ... <!possibly 1 to 10 or so <Data> elements in each parent <Item> element. <Data>...</Data> </Item> ... <!400 <Item> elements in the <List> > </List>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Sorting by child element , Michel Hendriksen | Thread | Re: [xsl] Sorting by child element , Michel Hendriksen |
Re: [xsl] Avoiding boneheaded mista, G. Ken Holman | Date | Re: [xsl] Sorting by child element , G. Ken Holman |
Month |