Specializing to include non-DITA content

You can extend DITA to incorporate standard vocabularies for non-textual content, such as MathML and SVG, as markup within DITA documents. This is done by specializing the <foreign> or <unknown> elements.

There are three methods of incorporating foreign content into DITA.

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

<!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.

Return to main page.