Datasheet
XLink and XPointer
It’s hard to imagine the World Wide Web without hyperlinks, and, of course, HTML documents excel
at letting you link from one to another. How about XML? In XML, it turns out, you use XLinks and
XPointers.
XLinks enables any element to become a link, not just a single element as with the HTML
<A> element.
That’s a good thing because XML doesn’t have a built-in
<A> element. In XML, you define your own ele-
ments, and it only makes sense that you can define which of those represent links to other documents. In
fact, XLinks are more powerful than simple hyperlinks. XLinks can be bidirectional, allowing the user to
return after following a link. They can even be multidirectional — in fact, they can be sophisticated enough
to point to the nearest mirror site from which a resource can be fetched.
XPointers, on the other hand, point not to a whole document, but to a part of a document. In fact,
XPointers are smart enough to point to a specific element in a document, or the second instance of such
an element, or any instance. They can even point to the first child element of another element, and so on.
The idea is that XPointers are powerful enough to locate specific parts of another document without
forcing you to add more markup to the target document.
On the other hand, the whole idea of XLinks and XPointers is relatively new and not fully implemented in
any browser. Here are some XLink and XPointer references online that will provide you more information
on these topics.
❑
http://www.w3.org/TR/xlink/ — The W3C XLink page
❑
http://www.w3.org/TR/xptr — The W3C XPointer page
XQuery
XQuery (XML Query) is a language for finding and extracting (querying) data from XML documents.
XQuery is a query language specification under development by the W3C that’s designed to query
collections of XML data — not just XML files, but anything that can appear as XML, including relational
databases. Using XQuery, you can easily and efficiently extract information from native XML databases
and relational databases. XQuery uses the structure of XML intelligently to express queries across all
these kinds of data, whether physically stored in XML or viewed as XML via middleware.
XQuery makes heavy use of XPath. In fact, XQuery 1.0 and XPath 2.0 are under development by the
same W3C working group, and their specifications are intertwined. XQuery 1.0 and XPath 2.0 share the
same data model, the same functions, and the same syntax. Because the XQuery 1.0 specification is still
in draft status, .NET Framework 2.0 does not provide support for XQuery 1.0 specification.
The XML Advantage
XML has had an impact across a broad range of areas. The following is a list of some of the factors that
have influenced XML’s adoption by a variety of organizations and individuals.
20
Chapter 1
04_596772 ch01.qxd 12/13/05 11:17 PM Page 20