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
6.53Mb size Format: txt, pdf, ePub
ads

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
.

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

Other books

Defying Fate by Lis, Heidi
La catedral del mar by Ildefonso Falcones
A Reluctant Empress by Nora Weaving
Driving Her Crazy by Amy Andrews
Rebel's Tag by K. L. Denman
Haunted by Heather Graham
New Atlantis by Le Guin, Ursula K.
Georgia Boy by Erskine Caldwell
Wild Temptation by Emma Hart
Screams From the Balcony by Bukowski, Charles