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

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>
SV: What's a valid instance...James Clark

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 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.