W3C home > Mailing lists > Public > www-international@w3.org > October to December 2005

Re: New article published: xml:lang in XML document schemas

From: Felix Sasaki <fsasaki@w3.org>
Date: Fri, 25 Nov 2005 01:22:51 +0900
To: "Jeremy Carroll" <jjc@hpl.hp.com>, "Addison Phillips" <addison.phillips@quest.com>
Cc: www-international@w3.org
Message-ID: <op.s0q6gdwpx1753t@ibm-60d333fc0ec>

Hello Jeremy,

I hope that it is o.k. with Addison if I reply here, since I think this  
section was based on a comment from me.
As for XML Schema, reusing definitions from other namespaces than the  
target namespace of a schema needs to be done even for the XML 1.0  
namespace, in order to declare attributes such as xml:lang.

The following example shows how to do that and is based on

<xs:schema targetNamespace="http://example.org/ns/books/"
<!-- the follwoing imports the schema for the xml namespace -->
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
<!-- this element uses declarations from the xml namespace -->
<xs:element name="title">
         <xs:extension base="xs:string">
           <xs:attribute ref="xml:lang"/>

An additional comment below.

On Thu, 24 Nov 2005 23:54:57 +0900, Jeremy Carroll <jjc@hpl.hp.com> wrote:

> Addison
> I was somewhat surprised at:
> [[
> XML Schema requires that the xml namespace be declared and imported  
> before using xml:lang (and other xml namespace values)
> ]]
> http://www.w3.org/International/questions/qa-when-xmllang
> since in:
> http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-using
> I read:
> [[
> The namespace prefix, unless it is xml or xmlns, must have been declared  
> in a namespace declaration attribute in either the start-tag of the  
> element where the prefix is used or in an an ancestor element (i.e. an  
> element in whose content the prefixed markup occurs). The prefix xml is  
> by definition bound to the namespace name  
> http://www.w3.org/XML/1998/namespace.
> ]]

http://www.w3.org/TR/1999/REC-xml-names-19990114/#ns-using is about xml  
documents, not schemas. Unfortunately, "declared" has these two senses in  
xml terminology: declaration of the namespace in an instance via "xmlns",  
and declaration of an attribute *from* a namespace in a schema.

I hope that helps. Best, Felix.

> Please clarify
> Jeremy
> Richard Ishida wrote:
>>    After incorporating comments from the review phase, the GEO Working  
>> Group has published the article:
>>  	xml:lang in XML document schemas
>> 	http://www.w3.org/International/questions/qa-when-xmllang
>> 	By Addison Phillips, Quest Software
>>    The article provides an answer to the question: When should I use  
>> xml:lang and when should I define my own element or attribute for  
>> passing language values in an XML document schema (DTD)?
>>     You can find various news filters and RSS feeds relating to the  
>> work of the Internationalization Activity at  
>> http://www.w3.org/International/log/description
>>    ============
>> Richard Ishida
>> Internationalization Lead
>> W3C
>>  http://www.w3.org/People/Ishida/
>> http://www.w3.org/International/
>> http://people.w3.org/rishida/blog/
>> http://www.flickr.com/photos/ishida/
Received on Thursday, 24 November 2005 16:24:47 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:40:51 UTC