RE: which xml schema tools do it right concerning including at
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@j...] > Sent: Wednesday, April 17, 2002 1:00 PM > To: Dare Obasanjo > Cc: Paul Hermans; xml-dev@l...; xmlschema-dev@w... > Subject: Re: 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/ > >
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format