The @format attribute
The @format attribute identifies the format of
the referenced resource.
The following values are explicitly supported:
- dita
- Indicates that the target is a DITA topic or an element in a
DITA topic. Unless otherwise specified, when
@formatis set to dita, the value for the@typeattribute is treated as topic. - ditamap
- Indicates that the target is a DITA map. References to submaps can occur at any point in a map.
For other formats, the file extension without the "." character
typically represents the format. For example, the following are all
possible values for @format:
html, pdf, or
txt.
If no value is explicitly specified for the @format
attribute, the following precedence rules apply:
- If the
@formatattribute is specified on a containing element within the map or within the related-links section of a topic, the value cascades from the closest containing element. - If a value for the
@formatattribute does not cascade, the processing default is used. The processing default for the@formatattribute is determined by inspecting the value of the@hrefattribute:- If the
@hrefattribute specifies a file extension, the processing default for the@formatattribute is that extension, after conversion to lower-case and with no leading period. The only exception to this is if the extension is .xml, in which case the default value for@formatis dita. - If there is no file extension, but the
@hrefvalue is an absolute URI whose scheme is http or https, then the processing default is html. - In all other cases where no file extension is available, the processing default is dita.
- If the
If the actual format of the referenced content differs from the
effective value of the @format attribute, and a
processor is capable of identifying such cases, it MAY recover gracefully and treat the
content as its actual format. The processor MAY also issue a message.
For processors that support Lightweight DITA, the following table
summarizes values for the @format attribute:
| Document type | Value of the @format attribute |
Description |
|---|---|---|
| Map | hditamap | HDITA map |
| mditamap | MDITA map | |
| xditamap | XDITA map | |
| Topic | hdita | HDITA topic |
| mdita | MDITA topic | |
| xdita | XDITA topic |