Dimitre Novatchev wrote:
"Robert P. J. Day" <rpjday(_at_)mindspring(_dot_)com> wrote in message
news:Pine(_dot_)LNX(_dot_)4(_dot_)44(_dot_)0303182306400(_dot_)26300-100000(_at_)dell(_dot_)(_dot_)(_dot_)
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