The xml:lang Attribute

The xml:lang attribute is a special language identification attribute in XML that identifies the natural or formal language in which the content of the XML document is written.

Example

<message xmlns="http://simonstl.com/ns/examples/message"
         xml:lang="en" date="20051006" >

Description

The value en (English) is a language identifier defined by RFC 3066 and ISO 639. Other examples include two-letter language identifiers, such as de (German), fr (French), and es (Spanish); two-letter identifiers with country identification subtags, such as fr-CA (French used in Canada); and three-letter language identifiers, such as eng (English), ger or deu (German), fre or fra (French), and spa (Spanish).

See also

§2.12

RFC 3066: http://www.ietf.org/rfc/rfc3066.txt

ISO 639: search at http://www.iso.ch for the latest information

Get XML Pocket Reference, 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.