The DITA identity attribute provides mechanisms for identifying content for retrieval or linking.
The id attribute assigns a unique identifier to an element so the element can be referenced. The scope of uniqueness for the id attribute depends on the role of the element within the DITA architecture:
A topic architecture assembles topics into a deliverable by reference. To ensure that topics can be referenced, the id attribute is required on the topic element.
The complete identifier for a topic consists of the combination of the URI for the document instance, a separating hash character, and the topic id (as in http://some.org/some/directory/topicfile.xml#topicid). URIs are described in RFC 2396. As is typical with URIs, a relative URI can be used as the identifier for the document instance so long as it is resolvable in the referencing context. For instance, within a file system directory, the filename of the document instance suffices (as in some/directory/topicfile.xml#topicid). Within the same document, the topic id alone suffices (as in #topicid). Where the topic element is the root element of the document instance, contexts outside the document instance may omit the topic id when referring to the topic element (as in topicfile.xml).
The topic id can be referenced by topicrefs, links, xrefs, or conrefs to the topic as well as indirectly as part of references to the topic content.
The id attribute for DITA topics is of type ID in XML.
The id is optional and need be added only to make the content referenceable.
The complete identifier for topic content consists of the combination of the complete identifier for the topic, a separating solidus (/), and the topic content id (as in http://some.org/some/directory/topicfile.xml#topicid/contentid). As noted before, the topic identifier portion can use a relative URI for the document instance in contexts where the relative URI can be resolved (as in some/directory/topicfile.xml#topicid/contentid).
The containing topic id must always be included when referencing an element id. Otherwise, a reference to another topic couldn't be distinguished from a reference to an element within the same topic. For references within the same document instance, the identifier for the document instance can be omitted altogether (as in #topicid/contentid).
The id attribute for elements within DITA topics is not of type ID and is not required to be unique.
For the anchor element, which exists only to identify a position within a map as a target for references, the id attribute is required. For the other elements, the id attribute is optional.
As with a topic, the complete identifier consists of the combination of the absolute URI for the map document instance and the element id (as in http://some.org/some/directory/mapfile.xml#topicrefid).
The id attribute for maps, topicrefs, and anchors is of type ID.
As with topic content, the full identifier consists of the combination of the absolute URI for the map and the id for the relationship table element (as in http://some.org/some/directory/mapfile.xml#mapid/reltableid).
The id attribute for reltable elements is not of type ID and is not required to be unique.
OASIS DITA Architectural Specification v1.0 -- 09 May 2005
Copyright (c) OASIS Open 2005. All Rights Reserved.