Post Reply
Site Admin
Posts: 88
Joined: Tue Jan 31, 2006 3:10 pm
Location: Moss Norway


Post by KBleivik »

XPointer extends XPath's data model of nodes, node types and node sets to locations, location types and location sets. It also defines the concept of a covering range that is used to support mapping of locations to ranges.

If you have tagged by using HTML, you know that the following URL:


take you directly to the XML Pointer Language (XPointer) subpage of the W3C Technical Reports and Publications page:


If you have an XPointer enabled browser, the same should be achieved by XPointer since the underlying markup of the document is XHTML 1.0 Strict and the document has the following markup:

<a href="2002/WD-xptr-20020816/" id="xptr" name="xptr">XML Pointer Language (XPointer)</a>

But if you type the following, excluding quotes, "http://www.w3.org/TR/#xpointer(id('xptr'))" into your browser (latest version of FF, IE or Opera october 25. 2007), the browser will intepret the URL like this:


It cuts the fragment identifier #xpointer(id('xptr')).

XPointer is XML's fragment identifier language to be used as the basis for a fragment identifier for any URI reference that locates a resource whose Internet media type is one of text/xml, application/xml, text/xml-external-parsed-entity, or application/xml-external-parsed-entity. XPointers are used to uniquely specify a set of locations within a document. They are powerful enough to locate any subset of the document. That is, every fragment of a well-formed XML document can be captured by an XPointer.

It gerealizes XPaths nodes, node types and node sets to locations, location types and location sets.

The following cite, Wilde and Lowe (2003) page 143, illustrates what may be possible in the future with fully XML technology enabled browsers:

"You find an interesting quote on the Web, possibly in an XHTML resource, that you would like to send to a friend. Instead of copying the quote into an e-mail (which would mean taking the quote out of context) or simply sending the resource's URI (which would make it necessary to somehow indicate exactly which part of the resource you mean), you select the quote with the mouse and then choose the "Generate XPointer" option from your browser's menu, which automatically generates a URI reference that exactly identifies the selected quote. You paste this URI reference into the e-mail and send it to your friend. This way you have exactly identified the quote that was important to you without taking it out of context. Upon receiving the URI reference, your friend's browser not only requests and displays the resource containing the quote, but also highlights the quote identified by the XPointer part of the URI reference."

My bolding.

This is transclusion. If the book that the above cite is taken from were an eBook, the URI would direct you directly to that book and highlight the cite, eg in yellow colour so it is clearly identified from the rest of the text. By combining this with XLink (see the XLink sticky post) it would be possible to transclude cites from n-different sources where you could choose your links from a link menu that may vary with context.

The sky is the limit. It is up to the browser vendor's fantasy to decide what XML technologies that can be implemented in the browser. You may choose options from a menu, for example a menu named "XML technologies" with sub menu's like, "Document node tree", "Document link menu", "Document identifiers", "Document Locators", "Digital fingerprint's", "Generate XPointer" (that can contain further sub menu's), "Generate XQuery" etc. etc.

XPointer has its own terms and concepts and data model.

Most web surfers know what an URL (Uniform Resource Locater) is. At least, webmasters know the concept very well. An URL is a subset of a more general concept, an URI (Uniform Resource Identifier) is again a subset of an IRI (Internationalized Resource Identifiers).

URIs and IRIs Are the Glue That Holds the Web Together. More precisely:

"The World Wide Web is defined as the universal, all-encompassing space containing all Internet - and other - resources referenced by Uniform Resource Identifiers (URIs, sometimes commonly called "URLs").

In Tim Berners Lee's original proposal, and in the initial Web implementation, the Web consisted of relatively few technologies, including the Hypertext Transfer Protocol (HTTP) and the HyperText Markup Language (HTML). Yet perhaps more fundamental than either HTTP or HTML are URIs, which are simple text strings that refer to Internet resources -- documents, resources, people, and indirectly to anything. URIs are the glue that binds the Web together. IRIs extend and strengthen the glue, by allowing people to identify Web resources in their own language".

XPointer Data Model
XPointer generalizes the concept of XPaths nodes as explained above to the following

NodeType ::= 'comment' | 'text' | 'processing-instruction' | 'node' | 'point' | 'range'

This definitions allows node tests to select locations of type point and range from a location-set that might include locations of many typess. A point can either be a node point or a character point, while a range is defined by two points, a startpoint and an endpoint.

XPointer functions.
XPointer can operate on XPath's as part of XLinks extended link type to produce true hypermedia applications. XPointer also has it's own functions that extends XPaths functions. XPointer functions operates on a covering range as:

[Definition: A covering range is a range that wholly and exactly encompasses a location. The covering range can be identified by applying the covering-range function to any location. The equivalent covering range for each type of location is defined as follows:]

* For a range location, the covering range is identical to the range (note that as in DOM [DOM2], although ranges are well-defined within all node types, ranges may not extend from inside the boundaries of namespace, attribute, comment, or processing instruction nodes to outside, or from outside to inside).

* For a point location, the start and end points of the covering range are the point itself.

* For a node location that is an element, text, comment, or processing instruction node, the container node of the start point and of the end point of the covering range are both the parent of the identified node; the index of the start point of the covering range is the number of preceding sibling nodes of the location; and the index of the end point is one greater than the index of the start point.

* For a node location that is the root node, the container node of the start point and end point of the covering range are both the root node; the index of the start point of the covering range is 0; and the index of the end point of the covering range is the number of children of the root location.

* For a node location that is an attribute or namespace node, the container node of the start point and end point of the covering range is the attribute or namespace node itself; the index of the start point of the covering range is 0; and the index of the end point of the covering range is the length of the string-value of the attribute or namespace node.

The status of XPointer.
XPointer is not a simple technology, and some implementors are concerned that XPointer is too complex and that this keeps some vendors from supporting it.

There are libraries supporting the technology like XPointerLib a project providing XPointer support for Mozilla 1.0+, Netscape 7, and Firefox versions up to 1.5. XPointerLib allows you to create and resolve XPointers in W3C DOM Documents.

Related links:
XLink and XPointer implementations.

http://www.w3.org/XML/2000/09/LinkingIm ... tions.html

The XML family of technologies will revolutionize web linking etc.

A new search index approach based on copyright.

http://www.activeminds.ca/blogarticle.p ... ware&id=23

Improve Search Engine Ranking Algo with Content Copyrighting

http://ezinearticles.com/?Improve-Searc ... &id=559085

http://www.webproworld.com/web-programm ... post343308










Dr. Erik Wilde and Dr. David Lowe (2003)
XPath, XLink, XPointer, and XML: A Practical Guide to Web Hyperlinking and Transclusion Addison Wesley ISBN: 0201703440
Kjell Gunnar Bleivik
Make it simple, as simple as possible but no simpler: | DigitalPunkt.no |

Post Reply