Writing XPointers

When we start to write XPointers, we need to remember that an XPointer typically includes a URI. So, we might have code such as the following:

xlink:href="someDocument.xml#xpointer(id('someID'))" 

Tip

To avoid syntax errors, remember to use one form of quote marks (either paired single quotes or paired double quotes) to mark out the limits of an attribute value. Use the other kind of quote marks to delimit within an XPointer, as when using single quotes within the id() function in the preceding code.

Because the XPointer can also be the value of an XML attribute, we also need to consider that aspect. Thus, we need to ensure that an XPointer satisfies any syntactic considerations for Uniform Resource Identifiers (URIs) and ...

Get Special Edition Using XML, Second Edition 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.