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

What's a valid instance...James Clark

From: Pete Cordell <petexmldev@tech-know-ware.com>
Date: Thu, 22 Mar 2007 13:23:20 -0000
Message-ID: <002a01c76c89$1b6b3a80$c900a8c0@Codalogic>
To: <xmlschema-dev@w3.org>
What's a valid instance...James Clark

I thought I would ask why the IETF is inclined to move away from W3C XML 
Schema, and one of the members kindly directed me towards the following 
e-mail by James Clark:

http://www.imc.org/ietf-xml-use/mail-archive/msg00217.html

One of the issues he states is (best to just quote it):

--------------------from James' e-mail--------------------

7. In W3C XML Schema there is no way to specify what is allowed as the
root element.  W3C XML Schema does not define a single notion of
validity of a document with respect to a schema.  There are different
varieties of validation (lax and strict) and many different ways to
validate a document against a schema.  From a W3C XML Schema alone, it
is not possible to know what it is a valid document.

For example, consider a totally trivial schema like this:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
  elementFormDefault="qualified"
  xmlns="http://www.example.com";
  targetNamespace="http://www.example.com";>

<xs:element name="foo">
  <xs:complexType/>
</xs:element>

</xs:schema>

Now consider a totally bogus document like this:

<bar/>

Believe it or not, the W3C XML Schema processors that I have tried
report this as valid!  The definition of validity is so flexible in
W3C XML Schema as to seriously impact interoperability.  If an
application was relying on the W3C XML Schema validation to screeen
out incorrect input, it would be in serious trouble.

With RELAX NG, this sort of bogosity does not arise: ...

--------------------end of from James' e-mail--------------------

(I didn't really need to include the last line, but just love the word 
'bogosity!')

By my understanding he is wrong on this.  The only valid document (ignoring 
whitespace) would surely be:

    <foo xmlns="http://www.example.com"/>

Trouble is, James Clark is one of those people who I would imagine is rarely 
wrong, so I thought I'd better ask!

Many thanks,

Pete.
--
=============================================
Pete Cordell
Tech-Know-Ware Ltd
for XML to C++ data binding visit
http://www.tech-know-ware.com/lmx/
http://www.codalogic.com/lmx/
=============================================
Received on Thursday, 22 March 2007 13:50:55 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.