The primary purpose of XPath is to address parts of an XML [XML] document.
In support of this primary purpose, it also provides basic facilities for manipulation of strings, numbers and booleans.
This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation.
It is a stable document and may be used as reference material or cited as a normative reference from other documents.
Both XSLT and XPointer extend XPath by defining additional functions; some of these functions operate on the four basic types; others operate on additional data types defined by XSLT and XPointer.
The namespace declarations consist of a mapping from prefixes to namespace URIs.
In the following grammar, the non-terminals QName and NCName are defined in [XML Names], and S is defined in [XML].The variable bindings consist of a mapping from variable names to variable values.The value of a variable is an object, which can be of any of the types that are possible for the value of an expression, and may also be of additional types not specified here.The list of known errors in this specification is available at The English version of this specification is the only normative version. A list of current W3C Recommendations and other technical documents can be found at