Re: Use of xml:lang versus xs:language

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 UTC