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

On Fri, 25 Nov 2005 08:51:11 +0900, Sebastian Rahtz  
<sebastian.rahtz@oucs.ox.ac.uk> wrote:

>
> Felix Sasaki wrote:
>
>>>
>>> It says that "XML Schema requires that the xml namespace be declared  
>>> and
>>> imported before using xml:lang (and other xml namespace values)"
>>> and then "RELAX NG predeclares the xml namespace, as in XML, so no
>>> additional declaration is needed."
>>>
>>> But an XML Schema itself is an XML document,
>>
>>
>> yes, and the schema for XML Schemas imports xml.xsd, see
>> http://www.w3.org/TR/xmlschema-1/#normative-schemaSchema :)
>> you are right, "as in XML" is confusing and should not be here.
>> Richard,  too late for an eratum?
>>
>>
> It is true that the document is confusing; but it covers up the greater
> and more serious contradiction within
> W3C.  _Why_ does Schema want us to redeclare the predefined attributes?
>

I don't know, but I can see a possible reason and a benefit. The reason  
concerns validation. In some sense the namespace specification is  
ambigous, since it states that every namespace must be declared in an xml  
document (with "xmlns"), except the xml namespace; but it does not make  
clear what this means for validation. XML Schema makes this clear.  
Requireing the declaration of attributes *for validation* from every  
namespace, including xml, is a simpler rule than the ambigous exception  
which is made by the xml namespace specification.

The benefit concerns validation again. A non validating XML processor (non  
validating in the sense of the conformance section in the xml spec.)  
accepts the attributes in the xml namespace, without validating them. In  
XML Schema, you are *forced* to validate them. Im wondering if it is  
*possible* in RELAX NG to validate them?
This discussion is getting more and more a non i18n issue, so now just one  
more argument which makes it possibly i18n relevant again. xml:lang is  
defined in terms of RFC 3066, which encompasses two language subtags: for  
language and for country codes. Suppose you want to put additional  
constraints on the value of xml:lang, so that it allows only for a subset  
of rfc 3066 values (e. g. only language codes, but not country codes).  
With XML Schema it is no problem, but would you  be able to do that with  
RELAX NG? It would not be possibly with DTDs.

Regards, Felix.

Received on Friday, 25 November 2005 05:45:44 UTC