The primary purpose of xpath language's is to address parts of an XML document.
A D V E R T I S E M E N T
In support of primary purpose, it also provides basic facilities for
manipulation of numbers, strings and boolean
XPath - Introduction
XPath is the result of an effort to provide a common semantics and syntax for
functionality shared between XSL Transformations(XSLT)and XPointer(XPTR). The
primary purpose of XPath is to address all parts of an XML XML document. In support
of this primary purpose, it also provides basic facilities for manipulation of
numbers, strings and booleans. XPath uses a compact, non-XML syntax to
facilitate use of XPath within URIs and XML attribute values. XPath operates on
the abstract, logical structure of an XML document, rather than its surface
syntax. XPath gets its name from its use of a path notation as in URLs for
navigating through the hierarchical structure of an XML document.
XPath Path Expressions
Expression is the primary syntactic construct in XPath. An expression
matches the production. An expression is evaluated to yield an object, which has
one of the four basic types given below:
node-set (an unordered collection of nodes without duplicates)
boolean (true or false)
number (a floating-point number)
string (a sequence of UCS characters)
Expression evaluation occurs with respect to a context.XPTR and XSLT
specify how the context is determined for XPath expressions used in
XPointer and XSLT respectively. The context consists of:
Node (the context node)
Pair of non-zero positive integers (the context size and the context position)
Set of variable binding
Function library
The set of namespace declarations in scope for the expression
XPath Standard Functions
XPath includes many built-in functions. There are functions for string
numeric and string values, date and time comparison, node and QName manipulation,
sequence manipulation, Boolean values etc.
XPath is Used in XSLT
XPath is one of the important element in the XSLT standard. Without XPath knowledge you
will not be able to create XSLT documents.
XPath became a W3C Recommendation 16 November 1999.