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

Breathing Underwater by Alex Flinn
Destiny's Last Bachelor? by Christyne Butler
Evolution of Fear by Paul E. Hardisty
The Orchid Tree by Siobhan Daiko
No Knight Needed by Stephanie Rowe
Offline: In The Flesh by Kealan Patrick Burke
The Secret of Willow Lane by Virginia Rose Richter
Yellow by Megan Jacobson