Skip Site Navigation «

DRX

app«drx

Web Developer Resource Index: XPointer

A Fragment Identifier is used at the end of a URI to address a particular element that has a unique id (or name) attribute in a document. Note that in XHTML 1.0 named anchors are deprecated, and in XHTML 1.1 they are removed. This syntax allows the hyperlink author to address not only a document, but a particular location in the document. For instance, each resource in this application has a unique id, which allows me to address an individual record using this syntax by adding the pound, or # hash character followed by the fragment identifier onto the end of the URI. For example, by selecting this XPointer Framework hyperlink, your browser will move you down to the first record on this page.

XPointer is more powerful method of doing the same thing. Instead of being limited to addressing single elements that have unique identifiers, you can address sub-elements and match instances of these elements using an XPath expression. XPointer is designed primarily for use with XML documents. Consider the following list structure. Rather than having unique identifiers for each item in the list, you would instead have a single id for the entire list:

<list id="items"> <item>first</item> <item>second</item> <item>third</item> <item>fourth</item> </list>

You could then select the third item in the list using XPointer syntax:

document.xml#id('items').child(3,item)

Updated: Wednesday, October 29th, 2008 @ 1:53 AM EDT

Navigation

Resources

Matching Tags

Indexes

§ A.Author
§ B.Best
§ D.Domain
§ F.Recent
§ G.Tag
§ H.Title

Search for XPointer on:


Last updated: Wednesday, October 29th, 2008 @ 1:53 AM EDT [2008-10-29T05:53:46Z]   home

(c) 2007-2009, Douglas W. Clifton, loadaveragezero.com, all rights reserved.