XML

Summary

If you think of an XML document as a hierarchical tree of data, which it is, then it's not too hard to make a comparison between XML documents and the family trees used in genealogy. This comparison is useful because it turns out that one of the best ways to interact with XML data is by thinking in terms of nodes of data that are related to each other as family members. For example, there are parent, child, and sibling nodes at most points in a document's node tree. XPath is a technology that takes advantage of this hierarchical nature of XML by allowing you to reference parts of XML documents as nodes within a node tree. This tutorial formally introduced you to it and explored what it has to offer in terms of referencing XML documents.

XPath plays a role in two other emerging XML technologies, XLink and XPointer, which bring advanced linking support to XML, and at some point to the web. You found out about the theoretical underpinnings of XML linking and what it aims to accomplish. You then learned how to create expressions in XPointer, followed by links in XLink. Although you gained some practical knowledge of XLink and XPointer, there unfortunately is very little support for either technology in major web browsers at the moment. Even so, they are compelling enough technologies that you need to keep an eye out for them potentially making an impact in the XML landscape at some point.

Q&A

Q.

What is the relationship between XPath and XPointer?

A.

XPath is a simple path language that uses patterns and expressions to reference portions of an XML document tree. XPointer extends XPath by offering more specific referencing capabilities within XML documents. XPointer also serves as the basis for identifying link sources and targets in XLink, which is the standard linking technology for XML.

Q.

Why bother learning about XLink if it still isn't supported to any serious degree in major web browsers?

A.

The reason for learning about XLink has to do with the fact that it could possibly represent the future of XML document linking. The W3C spent years developing XLink with the goal of it becoming a standard technology with wide support. Admittedly, it's difficult to get excited about a technology that is somewhat intangible at the moment, but that doesn't necessarily lessen the future significance of XLink.

Q.

Assuming XLink is eventually adopted by web browsers, how will it affect the HTML anchor link?

A.

The HTML anchor link (a) is a unique element in HTML that has special meaning to web browsers. In terms of XML, the HTML a element is just another element that happens to be interpreted as a linking element. When browsers add support for XLink, it will be very easy for them to support the a element for backward compatibility, while also supporting new XLink links. Don't forget that with XLink you can create your own anchor links with very little effort.

by BrainBellupdated
Advertisement: