Attaching data to content

Detailed metadata associated with a DITA element can be stored in data elements in the flow of the content.

Despite the name, the data element is for metadata stored in the flow of the content within the topic body. It is most useful as the basis for specialising other elements.

Within base DITA, you would most likely use the data element to store information about the source of code fragments, citations, or quotations. However, it is not a commonly used element.

The data element can be nested inside many DITA elements. Other data elements can be nested inside a data element. A data-about element can also be nested inside a data element. The data element has a number of attributes, including:
the unique name for the piece of data
the value of the piece of data
a link to the resource used for the piece of data
For example, the detailed source of a long quotation is contained in data elements in the following sample:
<lq reftitle="Lynch and Horton (2009)" href="">
  <data name="ref_Lynch_Horton">
    <data name="date_retrieved" value="13 September 2009" />
    <data name="chapter" value="9" />
    <data name="pub_type" value="web" />
    <data name="page_URL" href="" />
    <data name="pub_title">Web Style Guide</data>
    <data name="edition" value="3" />
The inverted pyramid style used in journalism works well on web
How the metadata stored in the data element structure is used is up to the authoring and publishing tools used.