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
5.32Mb 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

Cry of Eagles by William W. Johnstone
Zhukov's Dogs by Amanda Cyr
Stone Fox by John Reynolds Gardiner
The Hard Fall by Brenda Chapman