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

RE: invalid within XML-Spy, .NET and Xerces parsers but valid with the W3C validator

From: Michael Kay <mike@saxonica.com>
Date: Thu, 12 Mar 2009 12:58:09 -0000
To: "'Robert Melskens'" <robert.melskens@gmail.com>, <xmlschema-dev@w3.org>
Message-ID: <B22DE740A6654876BC9B95775E077410@Sealion>
Saxon-SA also treats this schema as valid.
 
Saxon and the W3C validator both use an algorithm published by Henry Thomson
for deciding whether one complex type is a valid restriction of another.
This algorithm is "better" than the algorithm in the W3C spec, in that it
has a better fit to the intent of the rules, which is that R should be
allowed as a valid restriction of B if all instances of R are valid
instances of B. That's clearly the case here. However, although this
algorithm is better, it is not conformant: the conformance rules require a
processor to implement the rules in the spec, bugs and all. Which is what
XMLSpy, Xerces et al appear to be doing.
 
XSD 1.1 avoids this problem by defining the rules "by intent" rather than by
an actual algorithm: for this example, complA1 will be a valid restriction
of complA.
 
It's always good practice to put a schema through more than one processor if
you want the schema to be completely interoperable. People who only test on
XML Spy, for example, often find that it tolerates violations of the UPA
constraint which other schema processors reject.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Robert Melskens
Sent: 11 March 2009 08:40
To: xmlschema-dev@w3.org
Subject: invalid within XML-Spy, .NET and Xerces parsers but valid with the
W3C validator


Hi,
 
With the attached XML-Schema, a simplified version of one of our schema's,
we had some problems within XML-Spy. 
The schema contains a content-model, which is judged by XML-Spy as invalid. 
I know how to solve this invalidness, but that solution conflicts with the
desired model.

I wasn''t able to get a grip on the real source of this 'invalid' message by
XML-Spy. 
Why is it invalid to have a minOccurs of 1 on the sequence element? So I
decided to try another validator, it might give me more clues.
I tried ' <http://www.w3.org/2001/03/webdata/xsv>
http://www.w3.org/2001/03/webdata/xsv' enad surprisingly the schema was
judged here as valid.

I concluded XML-Spy would probably have a bug because I put more trust in a
W3C validator.

So I sent a bug-report to Altova. A moment ago they answered me. They did
test the schema also on a .Net and the Xerces paser and also those parsers
reported an error.
Does this mean the W3C validator has a bug? If so, can you answer the
question above. The XML-Schema recommendation doesn't help me much.

I attached the mentioned schema.

Greetings, 

Robert Melskens


Atos Origin Nederland B.V.
Received on Thursday, 12 March 2009 12:59:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:15:11 GMT