Specializing the <foreign> or <unknown> element is an open extension to DITA for the purpose of incorporating standard vocabularies for non-textual content, such as MathML and SVG, as in-line objects. These 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.
There are three methods of incorporating foreign content into DITA.
Foreign content that is incorporated in DITA by one of these methods is not specialized. Specialization depends upon the architectural @class attribute found in every DITA element. If the foreign 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 foreign content.
The sample below describes how to create a domain declaration of the svg element, but does not show how to integrate that declaration in a DITA document-type shell. For more specific information on creating document-type shells, see DTD syntax specialization module coding requirements.
<!-- declaration for the specialized wrapper --> <!ENTITY % svg "svg"> <!-- included SVG document type --> <!ENTITY % SVG.prefix "svg" > <!ENTITY % svg-qname.mod PUBLIC "-//W3C//ENTITIES SVG 1.1 Qualified Name//EN" "svg-qname.mod" >%svg-qname.mod; <!-- definition for the specialized wrapper --> <!ENTITY % svg.content " (%SVG.svg.qname;) "> <!ATTLIST % svg.attributes " "> <!ELEMENT svg %svg.content; > <!ATTLIST svg %svg.attributes; > <!ATTLIST svg %global-atts; class CDATA "+ topic/foreign svg-d/svg ">
<p>This is an ellipse: <svg> <svg:svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <ellipse cx="300" cy="150" rx="200" ry="80" style="fill:rgb(200,100,50); stroke:rgb(0,0,100);stroke-width:2"/> </svg:svg> </svg>. </p>
The sample below describes how to create a domain declaration of the mathML element, but does not show how to integrate that declaration in a DITA document-type shell. For more specific information on creating document-type shells, see XSD schema specialization module coding requirements
<!-- importing MathML document type --> <xs:import namespace="http://www.w3.org/1998/Math/MathML" schemaLocation="mathml2.xsd"> <!-- definition for the specialized wrapper --> <xs:element name="mathML" type="mathML.class" /> <xs:complexType name="mathML.class"> <xs:choice> <xs:element ref="mml:math" /> </xs:choice> <xs:attribute name="outputclass" type="xs:string"/> <xs:attributeGroup ref="univ-atts"/> <xs:attributeGroup ref="global-atts"/> <xs:attribute ref="class" default="+ topic/foreign mathML/mathML"/> </xs:complexType> <!-- definition for each element extended by the domain --> <xs:group name="ma-d-foreign"> <xs:choice> <xs:element ref="mathML" /> </xs:choice> </xs:group> <!-- definition for the named model groups --> <xs:group name="foreign"> <xs:choice> <xs:group ref="foreign"/> <xs:group ref="ma-d-foreign"/> </xs:choice> </xs:group>
Return to main page.
OASIS DITA Version 1.2 -- OASIS Standard, 1 December 2010
Copyright © OASIS Open 2005, 2010. All Rights Reserved.