Schema Central > XML Schema 1.1 > xsd:language
Advanced search
Need XML Help?

Recommended Reading:

Definitive XML Schema

 

Web Service Contract Design and Versioning for SOA

 

Advanced XML Applications

 

xsd:language

The type xsd:language represents a natural language identifier, generally used to indicate the language of a document or a part of a document. Before creating a new attribute of type xsd:language, consider using the xml:lang attribute that is intended to indicate the natural language of the element and its content.

Values of the xsd:language type conform to RFC 3066, Tags for the Identification of Languages. The three most common formats are:

  • For ISO-recognized languages, the format is a two- or three-letter, (usually lowercase) language code that conforms to ISO 639, optionally followed by a hyphen and a two-letter, (usually uppercase) country code that conforms to ISO 3166. For example, en or en-US.

  • For languages registered by the Internet Assigned Numbers Authority (IANA), the format is i-langname, where langname is the registered name. For example, i-navajo.

  • For unofficial languages, the format is x-langname, where langname is a name of up to eight characters agreed upon by the two parties sharing the document. For example, x-Newspeak.

Any of these three formats may have additional parts, each preceded by a hyphen, which identify additional countries or dialects. Schema processors will not verify that values of the xsd:language type conform to the above rules. They will simply validate based on the pattern specified for this type.

Simple Type Information

Namespace: http://www.w3.org/2001/XMLSchema

Schema Document: builtintypes.xsd

Content

Examples

Valid valuesComment
enEnglish
en-GBUK English
en-USUS English
frFrench
deGerman
esSpanish
itItalian
nlDutch
zhChinese
jaJapanese
koKorean
i-navajoIANA-registered language
x-Newspeakprivate, unregistered language
any-value-with-short-partsalthough a schema processor will consider this value valid, it does not follow RFC 3066 guidelines
Invalid valuesComment
longerThan8parts may not exceed 8 characters in length
an empty value is not valid, unless xsi:nil is used

Type Inheritance Chain

Site developed and hosted by Datypic, Inc.

Please report errors or comments about this site to pwalmsley@datypic.com