Introduction to XPath
XPath is a language used to find information in XML documents.
Knowledge Prerequisites:
Before you continue learning, you should have a basic understanding of the following:
- HTML / XHTML
- XML / XML Namespaces
If you wish to learn these topics first, please visit our homepage for tutorials.
What is XPath?
| | XPath uses path expressions to navigate in XML documents<br>XPath includes a standard function library<br>XPath is a primary element in XSLT<br>XPath is a W3C standard |
XPath Path Expressions
XPath uses path expressions to select nodes or sets of nodes in an XML document. These expressions are very similar to those seen in conventional computer file systems.
XPath Standard Functions
XPath contains over 100 built-in functions. These functions are used for string values, numeric values, date and time comparisons, node and QName processing, sequence handling, logical values, and more.
XPath in XSLT
XPath is a primary element in the XSLT standard. Without knowledge of XPath, you cannot create XSLT documents.
You can read more in our XSLT Tutorial.
XQuery and XPointer are both built on XPath expressions. XQuery 1.0 and XPath 2.0 share the same data model and support the same functions and operators.
You can read more about XQuery in our XQuery Tutorial.
XPath as a W3C Standard
XPath became a W3C standard on November 16, 1999.
XPath is designed to be used by XSLT, XPointer, and other XML parsing software.
You can read more about the XPath standard in our W3C Tutorial.