Name

xs:language

Synopsis

Elements and attributes with type xs:language contain a language code as defined in RFC 1766, Tags for the Identification of Languages. These are essentially the acceptable values for the xml:lang attribute described in Chapter 5. If possible, this should be one of the two-letter language codes defined in ISO 639, possibly followed by a country code. For languages that aren’t listed in ISO 639, you can use one of the i-codes registered with IANA. If the language you need isn’t present in either of these sets, you can make up your own language tag beginning with the prefix “x-” or “X-”. Thus, these are acceptable language values:

  • en

  • en-US

  • en-GB

  • fr-CA

  • i-klingon

  • x-quenya

  • X-PigLatin

Constraining facets that apply to xs:language are length, minLength, maxLength, pattern, enumeration, and whiteSpace.

Get XML in a Nutshell, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.