O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XPointer Concepts

In this section, we will look at the concepts that XPointer adds to those provided in XPath.

Locations

A location generalizes the idea of a node, which you saw in Chapter 11 when we looked at XPath. A location can be a node (as in XPath), a point, or a range. In a moment, we will examine precisely what a point and a range are.

Point Locations

Consider the following snippet of code:

<paragraph number="1"> 
This is the text in the first paragraph. This paragraph has two sentences.
</paragraph>
<paragraph number="2">
This is also a paragraph. It too has two sentences.
</paragraph>

In the XPath data model, the preceding code would have two paragraph element nodes and two text nodes—each text node being a child node of its parent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required