Chapter 12. Extending the Power of XPath with XPointer

by Andrew Watt

In this chapter

What Is XPointer?

XPointer Concepts

XPointer Function Extensions to XPath

Writing XPointers

Additional Resources

Roadmap

In this chapter, we will look at the XML Pointer language, XPointer, which allows us to address parts of an XML document or an XML external parsed entity in ways in which the XML Path Language, XPath, version 1 does not support. You can, if you like, think of XPath 1.0 as a module in XPointer.

It might be helpful to understand parts of XPointer by comparing it to familiar hyperlinks on a Web page. A simple HTML hyperlink typically takes you to the beginning of the page to which it is linked. XHTML anchors can cause a Web browser to scroll to a selected part of the page. Being able to directly address parts of an HTML/XHTML document is very useful, particularly if the document is a lengthy one—the Web browser can take you directly to the part of the document that is of interest. XPointer is intended for use with XML documents and the XML Linking Language, XLink. XPointer aims to provide similar functionality to that provided by HTML/XHTML anchors for XML applications and to provide functionality that goes beyond that.

Caution

At the time of writing, XPointer is a W3C Candidate Recommendation. However, there is still a vigorous public debate about the scope of XPointer. Some interested parties want to see significant parts of XPointer, as described in this chapter, removed from the specification to create a slimmed down XPointer specification that is easier to implement. Be sure to check the W3C Web site for current information.


At the time of writing, there are few XPointer implementations, so much of the potential of XPointer has to be described in terms of what XPointer processors will be able to do in the future, once the XPointer specification is finalized.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.204.201