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

for-each sorting problem

Subject: for-each sorting problem
From: Sam Saha <sam_saha1975@xxxxxxxx>
Date: Sun, 11 Apr 2004 11:30:15 -0400 (EDT)
xsl for each sort
Hi,
   Can someone help me with this. I have the following
XML.
 
 <ROOT>
	<INFO>
		<ID_1>11124</ID_1>
		<ID_2>34154</ID_2>
		<ID_3>45787</ID_3>
		<ID_4>78454</ID_4>
		<ID_5>12457</ID_5>
		<ID_6>45988</ID_6>
		<ID_7>45124</ID_7>
		<ID_8>78436</ID_8>
		<ID_9>63254</ID_9>
		<ID_10>78436</ID_10>
		<ID_11>63254</ID_11>
		<NAME_3>Bbbb</NAME_3>
		<NAME_7>Ffff</NAME_7>
		<NAME_6>EEEE</NAME_6>
		<NAME_8>FFFF</NAME_8>
		<NAME_1>Aaaa</NAME_1>
		<NAME_4>Dddd</NAME_4>
		<NAME_9>Gggg</NAME_9>
		<NAME_5>Eeee</NAME_5>
		<NAME_10>GGG</NAME_10>
		<NAME_11>Hhh</NAME_11>
	</INFO>
</ROOT>


Now, in the stylesheet, I want to do a <xsl:for-each>
on every element that starts with 'ID_' but the output
should be sorted on the 'NAME_[x]' values. i.e., the
value of elements that starts-with 'NAME_'. This might
be pretty basic, but I am still new to xslt and can
someone help? I can't do a for-each on 'NAME_' and do
a sort on '.' because there might not be a NAME
element corresponding to the ID_[x] element (as in the
above XML there is no NAME_2) and I need to display a
row for each ID irrespective of the NAME_[x] element
being available or not.
 
Thanks
Sam.

______________________________________________________________________ 
Post your free ad now! http://personals.yahoo.ca

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.