<foreign>
Foreign content is content from a non-DITA vocabulary, such as MathML, SVG, or Rich Text Format (RTF).
Usage information
Specializations of the <foreign> element are typically implemented
as domains, but it is also possible to implement foreign vocabularies as structural
specializations.
The <foreign> element can contain non-DITA
content or a mix of DITA and non-DITA content.
If alternate content is wanted, use or specialize the <desc> element
inside of the <foreign> specialization. Such alternate content needs
to be valid wherever the <foreign> specialization is valid. This way,
if a processor is not able to recognize or render the <foreign>
content itself, it can use that alternate content. Alternate content can also
be provided using <image> or
<object>.
Processing expectations
Processors attempt to display <foreign> content unless otherwise
instructed. A processor MAY issue a warning if it cannot
render the foreign content or if no alternate content is provided.
Rendering non-DITA content requires processing support for the non-DITA vocabulary. This support can be built into a processor or provided through an extension.
- If a processor cannot render the non-DITA content, it should process the alternate
content specified by the
<desc>,<image>, or<object>element. - If the
<foreign>content cannot be rendered and the element contains more than one alternative-content element, each alternative-content element should be processed. In the case of<desc>, the content of each<desc>element should be rendered as a separate group. The presentation of each group is implementation dependent. - The base processing for
<object>might emit the content of<foreign>as a file at the location specified by the@dataattribute of the<object>element, turning the inline foreign content into a referenced object to be handled by rendering tools. In this case the<object>element should have a@dataattribute or a<foreign>sub-element but not both. In the event that an<object>element contains both a@dataattribute and an<foreign>sub-element, only one can be used. In the case that both are specified, which one is used is implementation dependent.
Content model
Any
Contained by
<abstract>, <alt>, <audio>, <author>, <b>, <body>, <bodydiv>, <brand>, <category>, <cite>, <component>, <consequence>, <coords>, <copyrholder>, <data>, <dd>, <ddhd>, <desc>, <div>, <draft-comment>, <dt>, <dthd>, <em>, <entry>, <example>, <fallback>, <featnum>, <fig>, <figgroup>, <fn>, <i>, <include>, <index-see>, <index-see-also>, <indexterm>, <li>, <line-through>, <lines>, <linkinfo>, <linktext>, <linktitle>, <lq>, <metadata>, <navtitle>, <note>, <object>, <overline>, <p>, <ph>, <platform>, <pre>, <prodname>, <prognum>, <prolog>, <publisher>, <q>, <searchtitle>, <section>, <series>, <shortdesc>, <sli>, <source>, <stentry>, <strong>, <sub>, <subtitle>, <sup>, <title>, <titlealt>, <titlehint>, <tt>, <typeofhazard>, <u>, <video>, <xref>
Any content
Contained by
<abstract><alt><audio><author><b><body><bodydiv><brand><category><cite><component><consequence><coords><copyrholder><data><dd><ddhd><desc><div><draft-comment><dt><dthd><em><entry><example><fallback><featnum><fig><figgroup><fn><i><include><index-see><index-see-also><indexterm><li><line-through><lines><linkinfo><linktext><linktitle><lq><metadata><navtitle><note><object><overline><p><ph><platform><pre><prodname><prognum><prolog><publisher><q><searchtitle><section><series><shortdesc><sli><source><stentry><strong><sub><subtitle><sup><title><titlealt><titlehint><tt><typeofhazard><u><video><xref>
Inheritance
- topic/foreign
The <foreign> element is a base element type. It is defined in the topic module.
Attributes
The following attributes are available on this element: universal attributes.
The following attributes are available on this element: universal attributes.
Example
This section is non-normative.
The following code sample shows a specialization of <foreign> that
is used to hold SVG elements. For this to work, the specialization module that defines
<svg-container> also needs to include the definitions for the SVG
elements.
<p>To turn on your product, press the elliptical orange button:
<svg-container>
<svg:svg width="100%" height="100%" version="1.1">
<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-container>.</p>