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

RE: [xml-dev] which xml schema tools do it right concerning including attributes xml:lang and xml:space

From: Dare Obasanjo <dareo@microsoft.com>
Date: Wed, 17 Apr 2002 16:03:58 -0700
Message-ID: <8BD7226E07DDFF49AF5EF4030ACE0B7E05573CA8@red-msg-06.redmond.corp.microsoft.com>
To: "Jeni Tennison" <jeni@jenitennison.com>
Cc: "Paul Hermans" <paul_hermans@protext.be>, <xml-dev@lists.xml.org>, <xmlschema-dev@w3.org>
I agree that it is mixing two different levels since although the sForS
matters when validating a schema it does not for validating instance
documents. 

However we don't think that on the one hand an imported schema that
redefines the XML namespace can be ignored when validating the schema
but then on the other hand should override the meaning of the contents
of the XML namespace when using the schema to validate an instance
document. This is rather inconsistent and where I come from we call that
"Crazy Talk"... 

If one wants to alter the meaning of the contents of the XML namespace
then <xs:redefine> can be used to achieve that. 

-- 
PITHY WORDS OF WISDOM 
Lynch's Law: When the going gets tough, everyone leaves.
 
This posting is provided "AS IS" with no warranties, and confers no
rights. 
You assume all risk for your use. (c) 2002 Microsoft Corporation. All
rights reserved.



> -----Original Message-----
> From: Jeni Tennison [mailto:jeni@jenitennison.com] 
> Sent: Wednesday, April 17, 2002 1:00 PM
> To: Dare Obasanjo
> Cc: Paul Hermans; xml-dev@lists.xml.org; xmlschema-dev@w3.org
> Subject: Re: [xml-dev] which xml schema tools do it right 
> concerning including attributes xml:lang and xml:space
> 
> 
> Hi Dare,
> 
> > After confering with some of our schema folks something was 
> brought up 
> > which adds a caveat to my comments.
> >
> > A problem arises because the normative schema for Schema (sForS) 
> > imports the schema for the XML namespace already. This means that a 
> > conformant XSD implementation acts as if the XSD for the 
> > "http://www.w3.org/2001/XMLSchema" and 
> > "http://www.w3.org/XML/1998/namespace" were imported into 
> any schema 
> > it validates. However, Paul is attempting to re-import that 
> namespace 
> > using a different schemaLocation and XSD.
> 
> Isn't this mixing two different levels -- the schema for 
> schema validating the schema and the schema validating the 
> instance? When you're looking at validating the instance, it 
> shouldn't matter what gets defined or imported in the schema 
> for schema (which might be used for validating the schema). 
> If you followed that logic, then the various other 
> definitions and declarations in the schema for schema would 
> be present in every schema, and every schema would validate 
> an instance document that was an XML Schema.
> 
> (Of course there are some definitions and declarations that 
> make it into all schemas, but these are explicitly listed as 
> "built-in" -- I can't see anywhere where it says that the 
> Schema for Schemas is imported into all schemas.)
> 
> So I don't think that Paul's importing of the XML namespace 
> should be a problem here.
> 
> As far as what he should do, as far as I can see, the XML 
> Schema spec makes no mention of built-in definitions for the 
> various attributes in the XML namespace, so to refer to them 
> they have to either be declared somewhere or there has to be 
> a basic xs:import that just references the XML namespace:
> 
>   <xs:import namespace="http://www.w3.org/XML/1998/namespace" />
> 
> and then a attribute wildcard that says you can use any of 
> them, and does 'lax' or 'skip' validation so that it doesn't 
> matter that the declarations are missing:
> 
>   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace"
>                    processContents="lax" />
>   
> This has the advantage that when new XML attributes come 
> along (e.g. xml:id if that ever takes off) they'll be allowed 
> by the schema. But it has the disadvantage that it doesn't 
> enable you to constrain the values of these attributes (e.g. 
> to constrain xml:lang so that it can only have the values 
> 'en' or 'fr').
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
> 
Received on Wednesday, 17 April 2002 19:04:03 GMT

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