[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: which xml schema tools do it right concerning including at


xml space schema
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/


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.