XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (364 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
7.01Mb size Format: txt, pdf, ePub

              satisfies $d eq 1.0”>

The
some
and
every
expressions are described in Chapter 10.

It is important to remember that an equality test compares the typed values of the nodes, not their identity. For example,
..=/
might seem to be a natural way of testing whether the parent of the context node is the root of the tree. In fact this test will also return true if the parent node is the outermost element, because in a well-formed (and schema-less) tree the typed value of the outermost element is the same as the typed value of the document node. Not only is the test wrong, it could also be very expensive: the value of the root contains all the text in the document, so you might be constructing two strings each a million characters long and then comparing them. XPath 2.0 provides an operator for comparing nodes by identity: you can write this test as
..
is
/
. The
is
operator is described under
Node Comparisons
on page 593.

The rules for comparing two sequences using
=
apply equally when comparing two sequences using an operator such as
<
: the comparison in this case is true if there is some value in the first sequence that is less than some value in the second sequence, under the rules for the
lt
operator. If all the values in the two sequences have the same data type, then the result actually follows the rules in the following table, where
max()
and
min()
represent the maximum and minimum numeric values of items in the sequence, ignoring any
NaN
values.

Other books

Cum For The Viking by Wade, Virginia
Fit for the Job by Darien Cox
Hex by Rhiannon Lassiter
Aesop's Fables by Aesop, Arthur Rackham, V. S. Vernon Jones, D. L. Ashliman
The Sweet Girl by Annabel Lyon
Las cuatro postrimerías by Paul Hoffman
Blamed by Edie Harris
Bouquet for Iris by Diane T. Ashley
Razzamatazz (A Crime Novel) by Scoppettone, Sandra