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

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

because by the time you're in the predicate, the context item is one of the strings produced by the
tokenize()
function, which means there is no context node, and therefore no root for
//stopword
to select from. The solution to this problem is to assign the result of the expression
//stopword
(or perhaps the root node from which it navigates) to a variable.

Variable Values

The dynamic context of an XPath expression also holds the values of all the variables that are defined in the static context. Each of these variables must have a value by the time the expression is evaluated, it is not possible for a variable to be “null” or “uninitialized”. The closest thing to a null value is the value
()
, the empty sequence.

The value of each variable will always conform to its declared type. If the type of the variable is
xs:decimal
, for example, the value can be an instance of
xs:decimal
or an instance of
xs:integer
(which is a subtype of
xs:decimal
), but it cannot be an
xs:string
or an
xs:float
.

Other books

Suffering & Salvation by Celia Kyle, Kenzie James
The Boy I Love (Falling for You #2) by Danielle Lee Zwissler
Just Her Luck by Jeanette Lynn
Martyr's Fire by Sigmund Brouwer
Six of Crows by Leigh Bardugo
The Lost Prince by Edward Lazellari
Invisible Things by Jenny Davidson
A Rare Gift by Jaci Burton