XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (281 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
2.35Mb size Format: txt, pdf, ePub
ads
  • The keywords
    for
    ,
    some
    , and
    every
    , which introduce expressions described in Chapter 10, are recognized by virtue of the fact that they are always followed by a
    $
    sign (which in turn introduces the name of a variable).

As with most languages, the first stage in processing an XPath expression is lexical analysis, also known as tokenizing. The first stage of identifying the tokens is done fairly mechanically, and does not depend in any way on the syntactic context. At each stage, the longest sequence of characters that could comprise a single token is read. There are a few places where this can lead to surprises; for example,
x+1
is read as three tokens, whereas
x -1
is read as a single token. This is because XML names can contain a
-
character but not a
+
character. To ensure that
x -1
is read as a subtraction rather than as a single name, you need a space before the
-
for example
x -1

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

Other books

Parallel Heat by Deidre Knight
A Cookbook Conspiracy by Carlisle, Kate
A Debt Repaid (1) by N. Isabelle Blanco, Nyddi
Hard Evidence by Roxanne Rustand
Wild Man Island by Will Hobbs
A Lesson in Patience by Jennifer Connors
Hell on the Prairie by Ford Fargo
Geist by Philippa Ballantine
SODIUM:5 Assault by Arseneault, Stephen