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".

   

 

 

 

back to top