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

Embracing the Fall by Lainey Reese
The Christmas Treasure by Kane, Mallory
Forgetting Foster by Dianne Touchell
Surviving the Pack by Shannon Duane
The Rebel by J.R. Ward
Eye Candy by Germaine, Frederick
Mort by Pratchett, Terry