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

XSV choice validation

From: Vaughan, Dallas <VAUGHAN@scra.org>
Date: Wed, 2 Nov 2005 07:00:49 -0500
Message-ID: <03642EC064085F4DBB3B40DB5D82F2A2633B83@SCRA_NT1.SCRA.ORG>
To: <xmlschema-dev@w3.org>
Cc: "Vaughan, Dallas" <VAUGHAN@scra.org>
xs choice validation
Hi,
When using the online XSV tool at http://www.w3.org/2001/03/webdata/xsv, the following schema did not pass because of a "non-deterministic content model" within the choice element.  Here is what didn't pass:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="root">
    <xs:complexType>
	  <xs:choice>
	    <xs:sequence>
		  <xs:element name="A" type="xs:string" maxOccurs="5"/>
		  <xs:element name="B" type="xs:string" minOccurs="0"/>
		  <xs:element name="C" type="xs:string" minOccurs="0"/>
	    </xs:sequence>
	    <xs:sequence>
		  <xs:element name="B" type="xs:string"/>
		  <xs:element name="C" type="xs:string" minOccurs="0"/>
	    </xs:sequence>
	    <xs:sequence>
		  <xs:element name="C" type="xs:string"/>
	    </xs:sequence>  
	  </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

The output from XSV was: 

"Invalid: non-deterministic content model for type None: {None}:B/{None}:B"

However, changing the maxOccurs="5" in the first element ("A") to maxOccurs="1" results in a successful validation.  

It should not matter that the maxOccurs is greater than 1, since, in that case, all occurences would be in sequence.  There is no ambiguity here, since the initial element is ALWAYS mandatory in each sequence within the choice, so there is one and only one sequence that can be used for a given initial element (if there is an initial "A" element, the first sequence HAS to be used, since "A" does not appear within any other sequences).  Also, this was deemed valid by XMLSpy's schema validator (which correctly validates other instances of non-deterministic content).  

Is there a faulty algorithm in XSV that decides what is non-deterministic and what is not?

Thank you,

Dallas Vaughan
Received on Wednesday, 2 November 2005 12:19:28 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.