[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


lax xml namespace
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!

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.