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

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

If the value of the predicate contains nodes, there is no automatic atomization of the nodes (that is, the values of the nodes are not extracted). In fact, if the value of the predicate contains one or more nodes, then its effective boolean value is always true. This means, for example, that
person[@isMarried]
selects any

element that has an
isMarried
attribute, irrespective of the value of that attribute. If you want to test the value of the attribute, you can atomize it explicity using the
data()
function, or you can use a comparison such as
person[@isMarried = true()]
. (But beware, if backward-compatibility mode is switched on, then
person[@isMarried = true()]
means the same as
person[@isMarried]
).

A numeric predicate whose value is
N
is equivalent to the boolean predicate
[position()
eq N]
. So, for example, the numeric predicate
[1]
means
[position() eq 1]
, and the numeric predicate
[last()]
means
[position() eq last()]
.

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

Other books

Gypsy Lady by Shirlee Busbee
Hands of Flame by C.E. Murphy
The Riviera Connection by John Creasey
Xeno Sapiens by Victor Allen
Blood and Bone by Austin Camacho
FallingforSharde_MLU by Marilyn Lee
Andrée's War by Francelle Bradford White