Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
. You also need to be careful with the humble
.
character, which can appear in several different roles in XPath: as a decimal point within a number, as a separator character within a name, and as a symbol in its own right, representing the context item. So, for example if you write
$a is .
(which tests whether variable
$a
refers to the context node), then you need a space between the
is
and the
.
.
Once the text has been split into tokens, the tokens are classified. It is at this stage that the decision is made whether a name such as
div
is being used as an element name in a path expression, as a function name, as a variable name, or as an operator or keyword. As we have seen, the decision on how to classify a token may depend on the tokens that precede and follow it. It's likely that many parsers will also group together compound symbols such as
cast
as
at this stage, though the details of how this is done are left entirely to the implementation.