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.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Friday, 11 January 2002 16:27:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT