<data> element represents a property within a DITA topic or
map. While the
<data> element can be used directly to capture properties,
it is particularly useful as a basis for specialization. Default processing should treat the
content as an unknown kind of metadata and ignore it for rendering, but custom processing might match the
@name attribute or specialized
element and use the element for automated manipulation or to format data associated with the
body flow. For example, a specialized
<data> element might be used to format properties as sidebars or other adornments
or to harvest properties for automated processing.
The subject of the property is ordinarily the container of the
element. In the content model for the
<metadata> elements, the property applies to the topic as a whole.
<topicmeta> element, the property applies to the referenced
<data-about> element can be
used to identify the subject of the property with an explicit reference.
@name attribute names the property for processes. A
<title> subelement can provide a
label for the property. The
@datatype attribute can be used to identify the type for the value. The value of the property can be any
of the following:
@valueattribute or textual content.
<data>element by default, so the
<data>element should only be used for properties and not to embed text for formatting as part of the flow of the topic body. It might be tempting to specialize the
<data>element for text that is part of the body flow, so as to escape the restrictions of the base content models. This abuse of the DITA architecture will cause problems. For example, if a particular kind of paragraph is specialized from
<data>rather than from
<p>, then when the content is exchanged with others that do not recognize the specialized element, their processors will skip the content.
<data> element can be nested to create
structures for complex properties. The
@name attribute might be used to distinguish different semantics associated
with different instances of the
<data> element such as addresses,
times, amounts, and so on. In many cases, however, it is preferable to specialize the
<data> element for more precise semantics, structures, and values.
For instance, a specialization can specify an enumeration for the
<data> element containing properties of a topic as a whole should be
located in the topic's
<metadata> element, or in a
element related to a
<topicref> that references the topic. The
<data> element generally goes at the beginning of the element to
which the properties in it refer. Where this is unwieldy, the
element can go in the
<prolog>, with the
<data-about> element identifying which specific element in the
topic is the reference.
See appendix for information about this element in OASIS document type shells.
Uses of the
<data> element can include the
<data>element to define the addressing on the message envelope. For instance, a topic could model an email message by representing the address with specialized
<data>elements in the
<prolog>element and the content with the
<data>elements including those from the UN/CEFACT Core Components Technical Specification (http://www.unece.org/cefact/).
@nameattribute on unspecialized
This structure identifies the library and version demonstrated by a code sample. The
@name attribute is used to identify both the grouping
<data> element and the nested
elements that provide specific properties. These properties will not appear in the output
unless a processor is customized to recognize these
<codeblock> <data name="exampleOf"> <data name="library" href="ajaxLibrary.js"/> <data name="version" value="2006-6-19"/> </data> <!-- ... --> </codeblock>
<data>to annotate a code sample
The following example specifies the delimited source code for a code fragment so an
automated process can refresh the code fragment. The
elements are specialized from
<data> but the
<codeFragment> is specialized from
<codeblock>. The properties specialized from
<data> would not appear in formatted output unless a processor is
explicitly instructed to display them:
<example> <title>An important coding technique</title> <codeFragment> <fragmentSource> <sourceFile value="helloWorld.java"/> <startDelimiter value="FRAGMENT_START_1"/> <endDelimiter value="FRAGMENT_END_1"/> </fragmentSource> <!-- ... --> </codeFragment> </example>
<data>to annotate housing information
The following example identifies a real estate property as part of a house description.
<realEstateProperty> element and its child elements are
<houseDescription> element is specialized from
<section>. A specialized process can format the values as part of
a brochure if they meet criteria for inclusion.
<houseDescription> <title>A great home for sale</title> <realEstateProperty> <realEstateBlock value="B7"/> <realEstateLot value="4003"/> <!-- ... --> </realEstateProperty> <p>This elegant....</p> <object data="B7_4003_tour360Degrees.swf"/> </houseDescription>
Return to main page.
Standards Track Work Product
|Copyright © OASIS Open 2016. All Rights Reserved.||25 October 2016|