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

RE: maxOccurs bug

From: Michael Kay <mike@saxonica.com>
Date: Mon, 10 Mar 2008 09:48:02 -0000
To: "'Chris'" <jesdisciple@gmail.com>, <xmlschema-dev@w3.org>
Message-ID: <00e301c88293$d5704fd0$6401a8c0@turtle>
RE: maxOccurs bug

> 
> I'm using the validator 
> (http://www.w3.org/2001/03/webdata/xsv), and it's working 
> great except for one thing.  To illustrate, I've written a 
> valid sample schema which, when uploaded, returns an error.

You might find Saxon's error message more helpful:

Error at xsd:all on line 9 of file:/c:/temp/test.xsd:
  Within <xs:all>, an <xs:element> must have @maxOccurs equal to 0 or 1

See Schema Part 1 ยง3.8.6, constraint "All Group Limited", rule 2.

This rule is lifted in XML Schema 1.1, and this feature of XML Schema 1.1
will be implemented in the next Saxon release.

Michael Kay
http://www.saxonica.com/



  
> The source and error follow.
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> 
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://www.w3.org/2001/03/webdata/xsv"
> xmlns="http://www.w3.org/2001/03/webdata/xsv"
> elementFormDefault="qualified">
> 	<xsd:element name="root">
> 		<xsd:complexType>
> 			<xsd:all>
> 				<xsd:element name="example" 
> maxOccurs="2"/>
> 			</xsd:all>
> 		</xsd:complexType>
> 	</xsd:element>
> </xsd:schema>
> 
> 
> Invalid per cvc-attribute.1.2: attribute type check failed for
> {None}:maxOccurs: 2 not in enumeration [0, 1]
> 
> 
> The standard, as I understand it, requires that all natural 
> numbers and the string "unbounded" be valid values of the 
> maxOccurs attribute.  Am I mistaken?
> 
> Thanks!
> Chris
> 
> 
Received on Monday, 10 March 2008 09:48:11 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.