Specializing to include non-DITA content
There are three methods of incorporating foreign content into DITA.
- A domain specialization of the <foreign> or <unknown> element. This is the usual implementation.
- A structural specialization using the <foreign> or <unknown> element. This affords more control over the content.
- Directly embedding the non-DITA content within <foreign> or <unknown> elements. If the non-DITA content has interoperability or vocabulary naming issues such as those that are addressed by specialization in DITA, they must be addressed by means that are appropriate to the non-DITA content.
The <foreign> or <unknown> elements should not be used to include textual content or metadata in DITA documents, except where such content acts as an example or display, rather than as the primary content of a topic.
Example: Creating an element domain specialization for SVG
The following code sample, which is from the svgDomain.ent
file, shows
the domain declaration for the SVG domain.
<!-- ============================================================= --> <!-- SVG DOMAIN ENTITIES --> <!-- ============================================================= --> <!-- SVG elements must be prefixed, otherwise they conflict with existing DITA elements (e.g., <desc> and <title>. --> <!ENTITY % NS.prefixed "INCLUDE" > <!ENTITY % SVG.prefix "svg" > <!ENTITY % svg-d-foreign "svg-container " > <!ENTITY svg-d-att "(topic svg-d)" >
Note that the SVG-specific SVG.prefix parameter entity
is declared. This establishes the default namespace prefix to be used for the SVG
content
embedded with this domain. The namespace can be overridden in a document-type shell
by
declaring the parameter entity before the reference to the
svgDomain.ent
file. Other foreign domains might need similar entities when required by the new vocabulary.
For more information, see the svgDomain.mod
file that is shipped with
the OASIS DITA distributions. For an example of including the SVG domain in a document
type
shell, see task.dtd
.