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

Hi Dare,

> 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"...

I'm not sure that I follow this (things get rather confusing when
you're talking about validating schemas with the SforS, so we might be
talking at cross purposes).

When you validate a schema against the SforS, the SforS is the schema
and the schema is the instance. The only imported schemas that are
relevant when validating a schema document against the SforS are those
schemas that are imported into the SforS. The SforS includes an
xs:import for the XML namespace; this imports the definitions in the
schema at http://www.w3.org/2001/xml.xsd. Any xs:import elements in
the schema that you're validating have no effect on the SforS --
they're just treated as elements like any other.

So if when you talk about "validating the schema" above, you mean
carrying out an XML Schema validation of the schema document using the
SforS, then it's true that imported schemas (referenced through
xs:import in the schema document), whatever their namespace, can be
ignored. At this level, you're checking the XML representation of the
schema, nothing more.

When you actually validate an instance against the schema, though, the
schema is turned into an abstract schema information set by parsing
the XML representation and resolving the imports, includes and
redefines. The only imports, includes and redefines that are used to
construct the schema information set are those that are referenced by
the schema (and by the things it references, recursively). A validator
might ignore certain schema documents if they are
imported/included/redefined twice, but otherwise has to resolve them
in order to construct the schema.

So if when you talk about "validating the schema" above, you mean
carrying out this validation of the semantics of the schema document
and its imports/includes/redefines and the construction of a schema
information set, then yes, of course imported schemas cannot be
ignored (unless they have already been imported).

As far as I can see, XML Schema does not provide any special status
for the XML namespace. So in a way talking about "overriding the
meaning of the XML namespace" doesn't make much sense because as far
as a schema validator is concerned, there's nothing to override. The
meaning that you provide for that namespace through your imported
schemas is really up to you, in just the same way as you can define
XHTML or XLink or any other "standard" markup language with whatever
schema you like. It's not particular wise, but there's nothing within
XML Schema that gives validators special knowledge of any namespaces
other than the XML Schema namespaces.

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

Yes -- you could redefine the schema for the XML namespace at
http://www.w3.org/2001/xml.xsd, and then import that into your schema.
(But remember that you can only redefine schemas that have the same
target namespace as the schema that you're defining, so you can't use
a redefine instead of an import, only *as well*.)

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Wednesday, 17 April 2002 20:10:09 UTC