DITA XSLT Conventions
The built-in DITA XSLT modules follow a number
of common conventions.
- The
@class
attribute in HTML output elements is comprised of:- Every tag name in the DITA specialization hierarchy for the source element.
- The value of the
@outputclass
attribute, if any.
<b>
is a specialization of<ph>
,<b outputclass="superBold">
would become<b class="ph b superBold">
. This allows you to do most of your DITA styling using CSS instead of XSLT. - For the most part, the templates are configured in both the
#default
andhtml
modes. The exception is<map>
and<topicref>
processing, which is generally processed usingmode="toc"
, switching formode="html"
for visible content, like<navtitle>
content. - Conditional processing attributes -
@product
,@platform
,@audience
,@otherprops
, and any@props
specializations identified in the@domains
attribute of the root element - will be preserved in HTML output, prefixed with@data-
(for example,@data-audience
). - All templates in these modules have a negative
@priority
, so that they can be easily overridden by stylesheets that reference them. @id
attributes are converted into named anchors of the form<a name="{@id}" class="xmlId"/>
- The
@xtrc
and@xtrf
attributes, generated during processing to identify the source of a given XML element, are represented as@data-xtrc
and@data-xtrf
in the HTML output.Note: The Comment Manager uses@data-xtrc
and@data-xtrf
to trace comment locations back to source XML. @xml:lang
attributes are converted to@lang
, and@dir
is preserved.