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

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

Some other factors that have influenced the design of the XPath syntax include:

  • A decision that XPath should have no reserved words. This means that any name that is legal as an XML element name (which includes names such as
    and
    and
    for
    ) should be legal in a path expression, without any need for escaping. As a result, all names used with some other role, for example function names, variable names, operator names, and keywords such as
    for
    , have to be recognizable by their context.
  • In both the original applications for XPath (that is, XSLT and XPointer), the language was designed to be embedded within the attributes of an XML document. It therefore has no mechanisms of its own for character escaping, relying instead on the mechanisms available at the XML level (such as numeric character references and entity references). This also made the designers reluctant to use symbols such as
    &&
    , which would require heavy escaping. This principle has been abandoned in XPath 2.0 with the introduction of the operators
    <<
    and
    >>
    ; however, these operators are not likely to be used very often.
  • There was originally an expectation that XPath expressions (especially in an XPointer environment) would often be used as fragment identifiers in a URI. This usage of XPointer never really took off, but it meant there was a reluctance to use special characters such as
    #
    ,
    %
    , and
    ?
    that have special significance in URIs.

Other books

Cuff Me Lacy by Demi Alex
The Sisters Grimm: Book Eight: The Inside Story by Michael Buckley, Peter Ferguson
A Girl Called Eilinora by Nadine Dorries
Death Sentence by Brian Garfield
Corpus Corpus by Harry Paul Jeffers
The Boys Club by Angie Martin
Tomorrow Berlin by Oscar Coop-Phane
Dare Me by Megan Abbott
Willie's Redneck Time Machine by John Luke Robertson
The Bad Girl by Mario Vargas Llosa