W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Re: Use of xml:lang versus xs:language

From: Jeni Tennison <jeni@jenitennison.com>
Date: Fri, 11 Jan 2002 21:27:43 +0000
Message-ID: <178391815120.20020111212743@jenitennison.com>
To: Mark Feblowitz <mfeblowitz@frictionless.com>
CC: "Xmlschema-Dev (E-mail)" <xmlschema-dev@w3.org>
Hi Mark,

> If I intend to provide 0..unbounded Description elements, each with
> a corresponding language attribute (reflecting the language of the
> Description's text), I could represent it as:
>         <xs:attribute ref="xml:lang"/>
> or as 
>         <xs:attribute name="lang" type="xs:language"/>
> Is there any meaningful difference between the two? What are the
> relative merits of each approach?

I think that there is a meaningful difference between the two.

The xml:lang attribute is defined in XML 1.0 as specifying the
"language used in the contents and attribute values of any element in
an XML document".

On the other hand, your lang attribute could be indicating the
language of a remote resource, the language that you want to view a
page in, the original language of the source of a quote, and so on.

Without knowing the specific semantics of your markup language,
computers (and humans) have no idea what your lang attribute means,
whereas the semantics of xml:lang are standard.

So since you're using the attribute to indicate the language of the
content (or attributes) of the Description element, I'd use xml:lang.



Jeni Tennison
Received on Friday, 11 January 2002 16:27:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:54 UTC