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

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
12.95Mb size Format: txt, pdf, ePub
ads
  • You can't assume that if
    $X=$Y and $Y=$Z
    , then
    $X=$Z
    . Again, sequences are the culprit. Two sequences are considered equal if there is a value that both have in common, so
    (2,3)=(3,4)
    is true, and
    (3,4)=(4,5)
    is true, but
    (2,3)=(4,5)
    is false.

In this strange Orwellian world where some values seem to be more equal than others, the one consolation is that
$X=$Y
always means the same as
$Y=$X
.

Although
!=
is often best avoided, it can be useful to test whether all items in a sequence have the same value. For example, writing

tests whether there is any node in the sequence
$documents//version
whose numeric value is not 1.0. However, it is probably less confusing to write the above test as:

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

Other books

A Wicked Pursuit by Isabella Bradford
Beyond Death by Deb McEwan
The Glass Galago by A. M. Dellamonica
Byzantium by Ben Stroud
SmokingHot by Sommer Marsden