The xml:lang attributeSpecifies the language (and optionally the locale) of the element content. The intent declared with xml:lang is considered to apply to all attributes and content of the element where it is specified, unless overridden with an instance of xml:lang on another element within that content. When no xml:lang value is supplied, the processor should assume a default value. This attribute must be set to a language identifier, as defined by IETF RFC 4646 ([[1]]) or successor. [edit] Recommended usageFor a DITA document that contains a single language, the highest level element containing content should always set the xml:lang attribute to the language (and optionally the locale) that applies to the document. Since the dita element does not support the xml:lang element, the highest level element that should set the xml:lang attribute is the topic element (or derivatives at the same level).
[edit] Usage in mapsThe xml:lang attribute can be specified on the map element. The expected language inheritance behavior on the map is similar to that on the topic. That is, the primary language for the map should be set on the map element (or assumed by the application if not explicitly set), and should remain in effect for all children unless a child specifies a different value for xml:lang.
[edit] Usage with the conref attributeWhen conref is used to include content from one topic in another topic, the xml:lang value must be obtained from the topic being included. If the included content does not explicitly set xml:lang, the processor must obtain the xml:lang value from the nearest parent of the included content. If the included content does not have a parent element that sets xml:lang, the application should default to the same value used for topics that do not set the xml:lang attribute.
****************installingAcme.xml*********************
<?xml version="1.0"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="topic_3FD87D" xml:lang="en">
<title>Installing Acme</title>
<shortdesc>Step by step details on how to install Acme</shortdesc>
<body>
<p id="p_60A72">Welcome message goes here</p>
<section id="section_C25">
<title>Before you begin</title>
<p id="p_E57324D">Special notes when installing Acme in
France:</p>
<note id="mynote" conref="warningsAcme.xml#topic_warnings/frenchwarnings"></note>
</section>
</body>
</topic>
</dita>
*******************************************
****************warningsAcme.dita*********************
<?xml version="1.0"?>
<!DOCTYPE dita PUBLIC "-//OASIS//DTD DITA Composite//EN" "ditabase.dtd">
<dita>
<topic id="topic_warnings">
<title>Warnings</title>
<shortdesc>warnings in all languages</shortdesc>
<body>
<section id="qqwwee" xml:lang="fr">
<title>French warnings</title>
<p id="p_F2A">These are our French warnings.</p>
<note id="frenchwarnings">Note in French!</note>
</section>
<section xml:lang="en" id="aassdd">
<title>English warnings</title>
<p id="p_5F961">These are our English warnings.</p>
<note id="englishwarnings">Note in English!</note>
</section>
</body>
</topic>
</dita>
*************************************
Parent topic: Translation |
