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

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

Unless you are familiar with regular expressions you may find this production rule difficult to read. The original in the XPath Recommendation is even more cryptic, and I have replaced it with a form that I find simpler to explain.

What it is saying is actually quite simple; a
StringLiteral
is either a sequence of any characters other than double quotes, enclosed between double quotes, or a sequence of any characters other than single quotes, enclosed between single quotes. For example,
“John”
, or
‘Jane’
, or
“don't”
or
‘I said “go”!’
.

In both cases you can put several of these sequences together end to end (the
+
sign indicates repetition). This has the effect of doubling the delimiting quote character, which provides an escaping mechanism, allowing you to use the delimiter within the string. For example, you can write
‘O“Connor’
to represent the string
O'Connor
.

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

Other books

The Firm by John Grisham
Shadow of the Father by Kyell Gold
Brooklyn Brothel by C. Stecko
Dark Star by Alan Dean Foster
On Raven's Wings by Isobel Lucas
Primal Heat 3 by A. C. Arthur
Scorned by Tyffani Clark Kemp