From 43ec088367a27d3263dd45148067175d453b94c5 Mon Sep 17 00:00:00 2001
From: Fuqiao Xue Sometimes documents contain or include different types of natural language content. Other times they need to store a natural
language value as data or meta-data about something external to the document. Because these different applications use similar formats, schema
- designers are sometimes confused about when they should use Question
xml:lang
and when to define their own language-related element or attribute.xml:lang
and when to define their own language-related element or attribute.
For example, in XHTML 1.0, there is an hreflang
attribute and also an xml:lang
(or lang
attribute, in the case of HTML) for the content of the a
element:
<a xml:lang="en" href="xyz" hreflang="de">Click for German</a>
BCP 47, Tags for the Identifying Languages Specifies how to use language tags in xml:lang
values.
XML 1.0 Specification, Section 2.12 The defining document for the xml:lang
attribute.
Language tags in HTML and XML Describes how to use language tags.