XML IDs

The XML language includes the concept of unique element identifiers, allowing a specific instance of an element to be given a name, so that it can be located when needed. This information can be used to provide a hypertext linking mechanism, or to identify an important item that needs to be formatted in a distinctive way. In this scheme, an attribute is used to hold the identifier. There is no restriction on what this attribute is called, as it is recognized by the attribute type assigned to it in a DTD. These attributes are given the type 'ID'. In the following example, the Name attribute of the Item element is assigned this special status. In a conforming document, this attribute must be present, and must be given a unique value:

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.