You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Beyer,Nathan" <NB...@cerner.com> on 2001/12/08 00:20:09 UTC

XML Schema Validation error/possible bug?

Here's the scenario:

The schema below is valid in both XMLSpy 4.1 and according to the IBM Schema
Quality Checker. When I try to validate the schema against the XML using
Xerces I get the following error: Error: cos-nonambig: (,Avg) and (,Avg)
violate the "Unique Particle Attribution" rule.

The weird thing is that when I change the minOccurs of either the "Min"
element and the "Max" element to 1 (or both), it validates without any
errors.
This is done using Xerces, version 1.4.3.

Can someone help me with this? This is causing a huge problem for me.

Thanks.
-Nathan

The XML -
<?xml version="1.0" encoding="UTF-8"?>
<Bill>
	<Amount>25</Amount>
</Bill>

The XML Schema -
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
	<xsd:element name="Bill">
		<xsd:complexType>
			<xsd:choice>
				<xsd:group ref="FirstGroup"/>
				<xsd:group ref="SecondGroup"/>
				<xsd:group ref="ThirdGroup"/>
			</xsd:choice>
		</xsd:complexType>
	</xsd:element>
	<xsd:group name="FirstGroup">
		<xsd:sequence>
			<xsd:element name="Amount" type="xsd:integer"
minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:group>
	<xsd:group name="SecondGroup">
		<xsd:sequence>
			<xsd:element name="Min" type="xsd:integer"
minOccurs="0" maxOccurs="1"/>
			<xsd:element name="Avg" type="xsd:integer"
minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:group>
	<xsd:group name="ThirdGroup">
		<xsd:sequence>
			<xsd:element name="Max" type="xsd:integer"
minOccurs="0" maxOccurs="1"/>
			<xsd:element name="Avg" type="xsd:integer"
minOccurs="0" maxOccurs="1"/>
		</xsd:sequence>
	</xsd:group>
</xsd:schema>
CONFIDENTIALITY NOTICE

This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
-------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org