XML technologies / XML Schema / Data type reference / xs:language
(Excerpt from “XML Schema” by Eric van der Vlist)
Language codes according to RFC 1766
Derived from: xs:token
Primitive type: xs:string
Known subtypes: none
Facets: xs:enumeration, xs:length, xs:maxLength, xs:minLength, xs:pattern, xs:whiteSpace
Definition
<xs:simpleType name="language" id="language">
<xs:restriction base="xs:token">
<xs:pattern value="([a-zA-Z]{2}|[iI]-[a-zA-Z]+|[xX]-[a-zA-Z]{1,8})(-[a-zA-Z]{1,8})*"/>
</xs:restriction>
</xs:simpleType>Description
The lexical and value spaces of xs:language are the set of language codes defined by RFC 1766.
Restrictions
Although the schema for schemas defines a minimal test through a pattern, see the definition, the lexical space is the set of existing language codes.
Example
Some valid values for this data type are: "en", "en-US", "de" or "de-DE".
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from “XML Schema” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de