Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Introduction to XPath


May 28, 2021 XPath


Table of contents


Introduction to XPath


XPath is a language that looks for information in an XML document.


What you should know before you learn:

Before you move on, you should have a basic understanding of the following:

  • HTML / XHTML
  • XML / XML Namespaces

If you would like to learn about these projects first, please visit these tutorials on our home page.


What is XPath?

Introduction to XPath
  • XPath uses path expressions to navigate through XML documents
  • XPath contains a standard library of functions
  • XPath is the primary element in XSLT
  • XPath is a W3C standard


XPath path expression

XPath uses path expressions to select nodes or sets of nodes in an XML document. These path expressions are very similar to those we see in a regular computer file system.


XPath standard function

XPath contains more than 100 built-in functions. These functions are used for string values, numeric values, date and time comparisons, node and QName processing, sequence processing, logical values, and so on.


XPath is used in XSLT

XPath is the primary element in the XSLT standard. You can't create an XSLT document without knowledge of XPath.

You can read more in our XSLT Tutorials.

Both XQuery and XPointer are 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 Tutorials.


XPath is the W3C standard

XPath became the W3C standard on November 16, 1999.

XPath is designed for XSLT, XPointer, and other XML resolution software.

You can read more about the XPath standard in our W3C Tutorials.

This section briefly introduces you to XPath, and in the next section, you'll begin to learn about XPath.