The concept of the hypertext link is one of the earliest and arguably the most powerful and distinctive features of the electronic environment. At a simple level, a link is simply a connection between two pieces of information—by now a commonplace of digital text and a mainstay of the web. However, the basic mechanism that permits linking is more fundamental and has many more functions than simply supporting navigation. Understanding how links and pointers work, and what they can accomplish, is very important for an overall understanding of text encoding as a way of modelling textual information.
In XML, the essential structure of the link is the establishment of a correspondence between two places in the textual universe. (More complex links in XML are simply aggregations of two-ended links.) The endpoints of the link may be entire files, or they may be individual XML elements (explicit pieces of markup) or they may be pieces of text that are identified by their position within a document (for instance, the 144th word in the second paragraph of the first chapter). The most common linking mechanism in XML involves assigning a unique identifier (almost like a Social Security number) to an XML element, and then using that identifier to point to the element from somewhere else, thereby creating a link. Many different pointers may point to a single identifier: the identifier serves as a kind of receiver or target for any pointer that wishes to create a link to that particular place in the text. But other less explicit mechanisms exist as well: for instance, the new technology called XPath provides a way of identifying an element or a piece of text contained within an element by describing the path to that place or text. The path is the route taken by walking down the tree of the XML hierarchy: for instance, go to the first chapter, and then go to that chapter’s second poem, and then go to that poem’s fourth stanza, and then go to that stanza’s sixth line, and then go to the second name in that line, and choose the first word in that name. This method does not require the encoding of explicit identifiers in the text, but it is vulnerable to changes in the document; if another poem is inserted at the beginning of the chapter, the XPath expression will lead to a different place entirely.
As indicated above, linking and pointers in XML have many purposes that go beyond simply creating clickable navigation links in the text. Some of the most significant, particularly for the TEI, are as follows: