What is the difference between the XPath and XPointers?



The XPath language allows you to retrieve nodes from an XML tree. It can be seen as the SQL for XML. (It has in fact many limitations which prevent such an analogy and have lead the creation of XML Query).

XPath is somewhat "abstract". It's designed to be used within contexts. These contexts are for the moment XSLT and XPointer.


XPointer allows retrieving of data from other documents. Its goal is to be used in URI fragment identifiers.

It extends XPath with the selection of regions (ranges) or points (whereas XPath only selects nodes).

It also has other syntaxes, not based on XPath.

In brief :

  • XPath isn't self-sufficient. Some application has to provide an evaluation context.
  • XPointer makes use of and extends XPath while providing an evaluation context.