xs:language
The type xs:language represents a natural language. It is often used for attributes that specify the language of the element. Its values conform to RFC 3066, Tags for the Identification of Languages. The most common format is a two- or three-character, (usually lowercase) language code that follows ISO 639, such as en or fr. It can optionally be followed by a hyphen and a two-character (usually uppercase) country code that follows ISO 3166, such as en-US. Additional dialects or country codes may be specified at the end of the value, each preceded by a hyphen.
Processors do not verify that values of the language type conform to the above rules. They simply validate based on the pattern specified for this type, which says that the value must consist of parts containing one to eight characters, separated by hyphens.
The xs:language type is most commonly associated with the xml:lang attribute defined in the XML specification; the value of this attribute may be tested using the lang function. Table B-18 lists some values of the xs:language type.
Table B-18. Values of the xs:language type
|
Values |
Explanation |
|---|---|
|
Valid | |
en |
English |
en-US |
U.S. English |
en-GB |
U.K. English |
de |
German |
es |
Spanish |
fr |
French |
it |
Italian |
ja |
Japanese |
nl |
Dutch |
zh |
Chinese |
any-value-with-short-parts |
Although this value is valid, it does not follow RFC 3066 guidelines |
|
Invalid | |
longerThan8 |
Parts may not exceed eight characters in length |
|
An empty value or zero-length string is not permitted ... |