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

Re: what does xsl:sort do if "select" doesn't evaluate

Subject: Re: what does xsl:sort do if "select" doesn't evaluate to anything?
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Wed, 19 Mar 2003 07:07:44 +0100
xsl sort empty
"Robert P. J. Day" <rpjday@xxxxxxxxxxxxxx> wrote in message
news:Pine.LNX.4.44.0303182306400.26300-100000@xxxxxxx
>
>   what is the defined behavior for <xsl:sort> if the "select="
> expression is not satisfied by anything?
>
>   eg., i want to process a bunch of <car> elements, sorted by their
> engine <displacement> values, but some of the <car> elements have no
> such element?

If the "data-type" attribute of xsl:sort is "text" then:

For these elements the sort key "displacement" will evaluate to the empty
string. Depending on how a particular XSLT processor implements string
comparison in xsl:sort all "car" elements with no "displacement" children
will be sorted together (with "car" elements that have a "displacement" with
empty string value) as a group either preceding or following all "car"
elements, which have "dis[lacement" children with non-empty string value.

If the "data-type" attribute of xsl:sort is "number" then the value of the
sort key "displacement" will be NaN -- and they will be sorted again as a
group -- first or last depending on the implementation.



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL





 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.