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

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

Whitespace is defined here as any sequence of space, tab, linefeed, and carriage return characters, and comments.

A comment in XPath starts with
(:
and ends with
:)
. Comments may be nested, so any
(:
within a comment must be matched by a closing
:)
. Comments may appear anywhere that whitespace is allowed.

Whitespace is required between two tokens if the first character of the second token could otherwise be construed as a continuation of the first token. So
price - discount
is three tokens, the
-
being a minus operator, while
price-discount
is a single token, the
-
being a hyphen within the element name. There is also a requirement to write a space between a number and an adjacent word, for example
if (a) then 3 else 4
, because the
e
of
else
could otherwise be taken as introducing an exponent in a double. For consistency, this rule is applied even if the word begins with a letter other than

Other books

Hide Out by Katie Allen
Galaxy's Edge Magazine: Issue 7: March 2014 by Mike Resnick;C. J. Cherryh;Steve Cameron;Robert Sheckley;Martin L. Shoemaker;Mercedes Lackey;Lou J. Berger;Elizabeth Bear;Brad R. Torgersen;Robert T. Jeschonek;Alexei Panshin;Gregory Benford;Barry Malzberg;Paul Cook;L. Sprague de Camp
Shoes for Anthony by Emma Kennedy
For Everything by Rae Spencer
A Garland of Marigolds by Isobel Chace
A Killing of Angels by Kate Rhodes
Just Curious by Jude Devereaux
Snakeroot by Andrea Cremer