W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

SV: What's a valid instance...James Clark

From: Bryan Rasmussen <BRS@itst.dk>
Date: Thu, 22 Mar 2007 15:13:17 +0100
Message-ID: <A2DF252098C9AD4B9781453BE4C5422B02FBE522@excw2k301.koncern.local>
To: "Pete Cordell" <petexmldev@tech-know-ware.com>, <xmlschema-dev@w3.org>

My understanding was he was partially correct because a Processor, dependent
on user input not specifying, could decide on whether to do lax validation or
not, for example XSV would I believe do as he indicated because it would
decide to validate laxly. 

But I don't rmemeber this rather maddening part of the past discussion well. 

It is I suppose considered up to the user to determine if their response is
no errors by lax validation or no errors by strict validation which would
probably lead to a bunch of users doing this incorrectly. 

At any rate I always require strict validation. 

Cheers,
Bryan Rasmussen

-----Oprindelig meddelelse-----
Fra: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]På vegne af Pete Cordell
Sendt: 22. marts 2007 14:23
Til: xmlschema-dev@w3.org
Emne: 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 14:15:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:12 UTC