[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

generic sorting problem

Subject: generic sorting problem
From: "peter willard donisthorpe" <paytur@xxxxxxxxxxx>
Date: Tue, 06 Sep 2005 19:21:50 +0000
generic sorting
hi,

I'm having problems with a sort.

I wish to sort some xml, and indent the result. I can do the indent, but the sorting is proving a problem.

My xml will be in the format of the below, though the element names may differ per document.

<xml>
<root_elem>
  <item_elem>
     <value1> xyz</value1>
     <value2> asd </value2>
     ...
  </item_elem>
  <item_elem>
     ...
  </item_elem>
</root_elem>

I want to sort all the "item_elem" elements based on the value of the "value1" sublements.

As per abovve, the names of these elements are dynamic, and this is where I am having difficulty.
I.e., in another document, "root_elem", "item_elem" and "valueX" could have different names, but the structure is the very same.


I need to sort the children of the root element by _their_ first child.

Is there a generic way to do this ?

Can the result be indented in the same operation ?

Any help appreciated.

Peter

_________________________________________________________________
MSN Messenger 7.5 is now out. Download it for FREE here. http://messenger.msn.co.uk


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.