14. XHTML I18N Attribute Module

Contents

This section is normative.

This module defines the I18N attribute collection.

14.1. I18N Attribute Collection

xml:lang = LanguageCode
This attribute specifies the base language of an element's attribute values and text content. It is defined normatively in [XML] section 2.12. The default value of this attribute is unspecified.

An element inherits language code information according to the following order of precedence (highest to lowest):

In this example, the primary language of the document is French ("fr"). Within the first paragraph a single word is declared to be in English ("en"), after which the primary language returns to French. The following paragraph is declared to be in English and includes an embedded French word.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN"
   "TBD">
<html xmlns="http://www.w3.org/2002/06/xhtml2" xml:lang="fr">
<head>
   <title>Un document multilingue</title>
</head>
<body>
<p>En janvier, toutes les boutiques de Londres affichent des panneaux 
<span xml:lang="en">SALE</span>, mais en fait ces magasins 
sont bien propres!</p>
<p xml:lang="en">Everwhere I went in France, the bakeries proclaimed
<em xml:lang="fr">PAIN</em>!
Those poor French bakers!</p>
</body>
</html>

Implementation: RELAX NG