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
4.43Mb 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

Stone Seeds by Ely, Jo;
Deadly Dozen: 12 Mysteries/Thrillers by Diane Capri, J Carson Black, Carol Davis Luce, M A Comley, Cheryl Bradshaw, Aaron Patterson, Vincent Zandri, Joshua Graham, J F Penn, Michele Scott, Allan Leverone, Linda S Prather
On Wings of Eagles by Ken Follett
No sin mi hija 2 by Betty Mahmoody, Arnold D. Dunchock
Room at the Top by Davitt, Jane, Snow, Alexa
Haunted Scotland by Roddy Martine
Calligraphy Lesson by Mikhail Shishkin
Disciplining the Duchess by Annabel Joseph
Shelter by Gilley, Lauren