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:
- For references in a map, the rules specified in Processing cascading attributes in a map are used to determine the effective value of the
@formatattribute. If the rules result in a processor-supplied default, see the following steps to determine the default. - For references in a
<related-links>element within a topic, use applicable rules from the same set of cascading rules to allow@formatto cascade from containing elements up to and including the<related-links>element. If a processor-supplied default is required, see the next step to determine the default. - When a processor-supplied default is used for
@format, the value 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 |