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
The xs:language
type is derived by restriction from xs:string
, so any functions and operations that can be performed on strings, such as substring
and comparing using the <
operator, can also be performed on xs:language
values.
18.191.168.203