xml:lang Language

The language of the intellectual content of the element for which this is an attribute.
The value of this attribute must conform to IETF RFC 5646 (https://tools.ietf.org/html/rfc5646). For most uses, a primary-language subtag such as “fr” (French), “en” (English), “de” (German), or “zh” (Chinese) is sufficient. These values are NOT case sensitive, but current best practice uses all lower case. In addition to the primary-language subtag, the value of this attribute may contain other subtags as well. Values for the various subtags (which can be used in certain combinations) can be obtained from the IANA Language Subtag Registry: https://www.iana.org/assignments/language-subtag-registry

Usage/Remarks

Inheritance
In the words of the W3C report xml:lang in XML document schemas: “Content … either contained within [a] document directly or considered part of [a] document when it is processed or rendered … should use the @xml:lang attribute to indicate the language of that content.” (https://www.w3.org/International/questions/qa-when-xmllang)
According to W3C specifications, the @xml:lang attribute, when placed on an element, applies by inheritance to:
  • all of the element’s textual content,
  • all of the element’s children and descendents (even the multimedia ones), and
  • all of the element’s attributes.
Thus the @xml:lang attribute is scoped: all the elements inside the element that contains the @xml:lang attribute (as well as their attributes) inherit the language value named. Any descendant element can name its own @xml:lang value, thus overriding the inheritance. Therefore it is good practice to name the primary language of the document at the top level, and override it when needed for inclusions in other languages.
Related Attributes
The @xml:lang attribute names the language used for the content of an element in the current document. The @hreflang attribute suggests the language of the target (external document) to which a link is pointing.
Script and Language
In some languages, script codes are also critically important; for example, in Japanese, there is the need to express whether a name is in Kanji as opposed to in Kana (Hiragana or Katakana) to determine sort keys. Best practice is to use the full language-code-plus-script-code as the value for @xml:lang. In JATS' use of both language and script tagging as values for @xml:lang, JATS is following the IETF (Internet Engineering Task Force) best practice guideline Network Working Group Request for Comments: 5646 [Tags for Identifying Languages, A. Phillips and M. Davis, Editors, September 2009]. That document defines a language tag as composed of (in part):
  1. A language code Language (typically using the shortest ISO 639)
  2. Potentially followed by a hyphen and then a script code (Script using the ISO 15924 code)
  3. Potentially followed by a hyphen and a region code (Region using the ISO 15924 code)
Some sample values of @xml:lang for Chinese and Serbian illustrate this complexity:
  • Language subtag plus Script subtag: @xml:lang="zh-Hant" (Chinese written using the Traditional Chinese script)
  • Language subtag plus Script subtag: @xml:lang="zh-Hans" (Chinese written using the Simplified Chinese script)
  • Language-Script-Region: @xml:lang="zh-Hans-CN" (Chinese written using the Simplified script as used in mainland China)
  • Language-Script-Region: @xml:lang="sr-Latn-RS" (Serbian written using the Latin script as used in Serbia)
Thus, for example, the following are among the expected values of @xml:lang for Japanese, incorporating both a language (“ja”) and a script type:
  • @xml:lang="ja-Hira" (Japanese written in Hiragana)
  • @xml:lang="ja-Hrkt" (Japanese written in Hiragana + Katakana)
  • @xml:lang="ja-Jpan" (Japanese written in Han + Hiragana + Katakana)
  • @xml:lang="ja-Hani" (Japanese written in Kanji (Hanzi, Hanja, Han))
  • @xml:lang="ja-Kana" (Japanese written in Katakana)
OPTIONAL (defaults to en) on element: <article>
Value Meaning
An alphanumeric string, which may include hyphens An abbreviation for a natural language (such as “en” for English or “de” for German) or for a language and a script (“ja-Kana”).
Default value en
OPTIONAL on many elements; click for list and usage

<abbrev>, <abbrev-journal-title>, <abstract>, <ack>, <addr-line>, <address>, <aff>, <alt-text>, <alt-title>, <annotation>, <anonymous>, <answer>, <answer-set>, <app>, <app-group>, <array>, <article-title>, <article-version>, <attrib>, <author-comment>, <author-notes>, <award-desc>, <award-group>, <award-id>, <award-name>, <back>, <bio>, <body>, <bold>, <boxed-text>, <caption>, <chapter-title>, <chem-struct>, <chem-struct-wrap>, <city>, <code>, <collab>, <collab-name>, <collab-wrap>, <comment>, <conf-acronym>, <conf-date>, <conf-loc>, <conf-name>, <conf-num>, <conf-sponsor>, <conf-theme>, <conference>, <contrib-id>, <contributed-resource-group>, <copyright-holder>, <copyright-statement>, <corresp>, <country>, <custom-meta>, <custom-meta-group>, <data-title>, <date-in-citation>, <day>, <def>, <def-item>, <def-list>, <degrees>, <disp-formula>, <disp-formula-group>, <disp-quote>, <edition>, <element-citation>, <email>, <era>, <etal>, <event>, <event-desc>, <explanation>, <ext-link>, <fig>, <fig-group>, <fixed-case>, <floats-group>, <fn>, <fn-group>, <fpage>, <front>, <front-stub>, <funding-group>, <funding-source>, <funding-statement>, <glossary>, <gov>, <graphic>, <index-term>, <inline-formula>, <inline-graphic>, <inline-media>, <inline-supplementary-material>, <institution>, <institution-id>, <issue>, <issue-id>, <issue-part>, <issue-sponsor>, <issue-subtitle>, <issue-title>, <issue-title-group>, <italic>, <journal-id>, <journal-subtitle>, <journal-title>, <journal-title-group>, <kwd-group>, <label>, <legend>, <license>, <license-p>, <list>, <list-item>, <long-desc>, <lpage>, <media>, <milestone-end>, <milestone-start>, <mixed-citation>, <monospace>, <month>, <name>, <named-content>, <nlm-citation>, <note>, <notes>, <on-behalf-of>, <open-access>, <option>, <overline>, <overline-start>, <p>, <page-range>, <part-title>, <patent>, <permissions>, <person-group>, <postal-code>, <prefix>, <preformat>, <price>, <principal-award-recipient>, <principal-investigator>, <product>, <pub-date>, <publisher>, <publisher-loc>, <publisher-name>, <question>, <question-preamble>, <question-wrap>, <question-wrap-group>, <rb>, <ref>, <ref-list>, <related-article>, <related-object>, <resource-group>, <resource-id>, <resource-name>, <response>, <role>, <roman>, <rt>, <sans-serif>, <sc>, <season>, <sec>, <see>, <see-also>, <self-uri>, <series>, <series-text>, <series-title>, <sig>, <size>, <source>, <speaker>, <speech>, <state>, <statement>, <std>, <std-organization>, <strike>, <string-conf>, <string-date>, <string-name>, <styled-content>, <sub>, <sub-article>, <subj-group>, <subtitle>, <suffix>, <sup>, <supplement>, <supplementary-material>, <support-description>, <support-group>, <support-source>, <table-wrap>, <table-wrap-group>, <target>, <term>, <textual-form>, <title-group>, <trans-abstract>, <trans-source>, <trans-subtitle>, <trans-title>, <trans-title-group>, <underline>, <underline-start>, <unstructured-kwd-group>, <uri>, <verse-group>, <verse-line>, <version>, <volume>, <volume-id>, <volume-issue-group>, <volume-series>, <x>, <xref>, <year>

Value Meaning
An alphanumeric string, which may include hyphens An abbreviation for a natural language (such as “en” for English or “de” for German) or for a language and a script (“ja-Kana”).
Restriction @xml:lang is an optional attribute; there is no default.
Tagged Samples
Romanized Japanese name referred to as an “English” name
...
<name name-style="western" xml:lang="en">
 <surname>Sonoda</surname>
 <given-names>Naoko</given-names>
</name>
...
Within a citation, names the language of the book title (German) and a translated title (English)
...  
<ref>
 <element-citation publication-type="book">
  <person-group person-group-type="author">
   <name><surname>Hartmeier</surname>
    <given-names>Winifried</given-names></name>
  </person-group>
  <source xml:lang="de">Immobilisierte Biokatalysstoren</source>
  <source xml:lang="en">Immobilized biocatalysts</source>
  <publisher-loc>Berlin</publisher-loc>
  ...
 </element-citation>
</ref>  
...