Using XPointer Points

How do you define a point in the XPointer specification? To do so, you must use two items: a node and an index that can hold a positive integer or zero. The node specifies an origin for the point, and the index indicates how far the point you want is from that origin.

But what should the index be measured in terms of—characters in the document or number of nodes? In fact, there are two different types of points, and the index value that you use is measured differently for those types.

Node-Points

When the origin node, also called the container node, of a point can have child nodes (which means it's an element node or the root node), the point is called a node-point.

The index of a node-point is measured in child nodes. Here, ...

Get Real World XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.