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

RE: xsl sorting (Follow-up question)

Subject: RE: xsl sorting (Follow-up question)
From: Greg Faron <gfaron@xxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Apr 2002 10:04:55 -0600
xsl sorting example
At 12:24 AM 4/17/2002, you wrote:
> If there is several sorting orders, they are all applied and not
> only the last one. For example if there is xml file that includes
> severals sets like:
>
> <Subject id="0000000001" id2="001" id3="001">Juu juu</Subject>
> <Subject id="0000000001" id2="002" id3="002">RE:Juu juu</Subject>
> <Subject id="0000000001" id2="002" id3="001">RE:Juu juu</Subject>
>
> and sets are sorted:
> <xsl:sort select="Subject/@id" order="ascending" />
> <xsl:sort select="Subject/@id2" order="ascending" />
> <xsl:sort select="Subject/@id3" order="ascending" />
>
> So the result would be:
> <Subject id="0000000001" id2="001" id3="001">Juu juu</Subject>
> <Subject id="0000000001" id2="002" id3="001">RE:Juu juu</Subject>
> <Subject id="0000000001" id2="002" id3="002">RE:Juu juu</Subject>
>
> Right?
Right

In the case where a sorting key (e.g. the attributes in the above example) is not present, is it possible to specify that absentees should be at the front or at the back of the list? For example, I want to sort a group of items in ascending alphabetical order based on child element "name".
Since the name is optional (there may be a series/name and series/number instead of ./name), can I request that any items without a ./name element be at the top of the list, followed by the alphabetical sorting of all items with a ./name element? Conversely, how do I request that they be at the end of the list? (I forget which is the default at the moment.)



Greg Faron Integre Technical Publishing Co.



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.