language identifiers in XML, see Robin Covers Web page at A recent newcomer to the xml: family is xml:base. Its purpose is to define a base URI for resolving relative URIs in parts of XML documents. The value of an xml:base attribute must be an absolute URI; its scope is the element on which it is defined and its descendants, unless a descendant defines its own. The most common use for xml:base will be within xlink:href attributes, to resolve relative links to images, applets, form-processing programs, style sheets, and other exter- nal resources. XLink (XML Linking Language) is a recent (June 2001) W3C recommen- dation, released together with XBase. It defines several global attributes in the XLink namespace. The namespace is usually mapped to the xlink: prefix, which we will use throughout the rest of the book. Although small, the XML Linking Language is quite intricate and conceptually complex because it overlays a graph structure over a collection of XML and non-XML resources. It is also a very important member of the XML family of specifications. XLink Attributes and XLink Graphs The purpose of XLink is to establish connections between and among resources. A resource, as usual, is anything that can be addressed with a URI. It doesnt have to be an XML resource; if it is, it does not have to be a complete document because the URI can be extended with a fragment identifier to select a document part. A very common kind of fragment identifier is an XPath expression, as you will see in a moment. A structure that consists of nodes connected by arcs is called a graph. XLink is about directed graphs of resources. A graph is called directed if its arcs have a direction from source to target. In the case of XLink graphs, both source and target are resources. The nodes and arcs of an XLink graph can also have labels attached to them. The most important XLink attribute is xlink:type. It can have several possi- ble values, including simple and extended. An element that has an xlink:type attribute with one of those two values is called a link element. A link element can have any tag name whatsoever: its the xlink:type attribute that defines it as a link element. Link elements can be simple or extended, depending on the value of xlink:type. It is important to understand from the start that a link element describes an entire graph of resources, not just the arcs. The word link is used in its general meaning, meaning a connection or as a synonym for arc, but a link element is an XML element that has an xlink:type attribute whose value is simple or extended. From the XLink perspective, it describes a graph. 60 Chapter 2