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 UTC