OpenStax CNX

You are here: Home » Content » XPath

About: XPath

Module by: Hannes Hirzel. E-mail the author

View the content: XPath


Name: XPath
ID: m43489
Language: English (en)
Summary: XPath (XML Path Language) is a query language for selecting nodes from an XML document.
Subject: Science and Technology
Keywords: XML, XPath, XSLT
License: Creative Commons Attribution License CC-BY 3.0

Authors: Hannes Hirzel (
Copyright Holders: Hannes Hirzel (
Maintainers: Hannes Hirzel (

Latest version: 1.8 (history)
First publication date: May 1, 2012 11:19 am -0500
Last revision to module: Oct 8, 2012 8:14 pm -0500


PDF: m43489_1.8.pdf PDF file, for viewing content offline and printing. Learn more.
XML: m43489_1.8.cnxml XML that defines the structure and contents of the module, minus any included media files. Can be reimported in the editing interface. Learn more.

Version History

Version: 1.9 Jul 19, 2014 10:38 am -0500 by Hannes Hirzel
Split content intro three sections; added two examples

Version: 1.8 Oct 8, 2012 8:14 pm -0500 by Hannes Hirzel Currently viewing this version.
Added a third XPath example.

Version: 1.7 Oct 8, 2012 7:27 am -0500 by Hannes Hirzel
Added a note which illustrates the abbreviation @ for having a condition on attribute values.

Version: 1.6 Aug 22, 2012 9:42 pm -0500 by Hannes Hirzel
Added link to cnx module which refers to the XPath lecture and demo by Jennifer Widom.

Version: 1.5 Jun 13, 2012 10:16 am -0500 by Hannes Hirzel
Added link to article on which explains how XQuery and XPath are related.

Version: 1.4 Jun 13, 2012 5:22 am -0500 by Hannes Hirzel
Added link to XPath intro and demo of Stanford School of Engineering (Jennifer Wisdom)

Version: 1.3 Jun 2, 2012 3:36 am -0500 by Hannes Hirzel
note about // abbreviation added.

Version: 1.2 May 29, 2012 9:54 am -0500 by Hannes Hirzel
Added reference to W3C recommendation and link to XSLT identity transformation module.

Version: 1.1 May 1, 2012 1:10 pm -0500 by Hannes Hirzel
Created module

How to Reuse and Attribute This Content

If you derive a copy of this content using a OpenStax-CNX account and publish your version, proper attribution of the original work will be automatically done for you.

If you reuse this work elsewhere, in order to comply with the attribution requirements of the license (CC-BY 3.0), you must include

  • the authors' names: Hannes Hirzel
  • the title of the work: XPath
  • the OpenStax-CNX URL where the work can be found:

See the citation section below for examples you can copy.

How to Cite and Attribute This Content

The following citation styles comply with the attribution requirements for the license (CC-BY 3.0) of this work:

American Chemical Society (ACS) Style Guide:

Hirzel, H. XPath, OpenStax-CNX Web site., Oct 8, 2012.

American Medical Assocation (AMA) Manual of Style:

Hirzel H. XPath [OpenStax-CNX Web site]. October 8, 2012. Available at:

American Psychological Assocation (APA) Publication Manual:

Hirzel, H. (2012, October 8). XPath. Retrieved from the OpenStax-CNX Web site:

Chicago Manual of Style (Bibliography):

Hirzel, Hannes. "XPath." OpenStax-CNX. October 8, 2012.

Chicago Manual of Style (Note):

Hannes Hirzel, "XPath," OpenStax-CNX, October 8, 2012,

Chicago Manual of Style (Reference, in Author-Date style):

Hirzel, H. 2012. XPath. OpenStax-CNX, October 8, 2012.

Modern Languages Association (MLA) Style Manual:

Hirzel, Hannes. XPath. OpenStax-CNX. 8 Oct. 2012 <>.