Re: [xsl] Re: what does xsl:sort do if "select" doesn't evaluate to anything?

Subject: Re: [xsl] Re: what does xsl:sort do if "select" doesn't evaluate to anything?
From: Jeff Kenton <jkenton@xxxxxxxxxxxxx>
Date: Wed, 19 Mar 2003 08:53:57 -0500
Dimitre Novatchev wrote:
"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 "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.


XSLT 1.0, Erratum 20, specifies that NaNs are less than any other value (including minus infinity) for sorting purposes. It's interesting to note that the XML Schema Datatypes spec says that NaNs are greater than all other values (Section 3.2.4 and 3.2.5).



-- -------------------------- Jeff Kenton DataPower Technology, Inc.



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


Current Thread