OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XML schema cos-nonambig problem

[ Lists Home | Date Index | Thread Index ]
  • To: Michael Kay <mike@saxonica.com>,xml-dev@lists.xml.org
  • Subject: Re: [xml-dev] XML schema cos-nonambig problem
  • From: Niels Peter Strandberg <nielspeter@npstrandberg.com>
  • Date: Fri, 16 Dec 2005 18:16:27 +0100
  • In-reply-to: <20051216171116.021A881748@npstrandberg.com>
  • References: <20051216171116.021A881748@npstrandberg.com>

I did try this solution, but it gave the error:

org.xml.sax.SAXParseException: cos-nonambig: "http://www.polopoly.com/ 
polopoly/cm/app/xml":major and "http://www.polopoly.com/polopoly/cm/ 
app/xml":major (or elements from their substitution group) violate  
"Unique Particle Attribution". During validation against this schema,  
ambiguity would be created for those two particles.


Niels Peter


Den 16/12/2005 kl. 18.11 skrev Michael Kay:

>> However, if the complex type were changed to look as
>> follows:
>>
>>>>>       <xs:complexType name="contentiddef">
>>>>> 		<xs:choice>
>>>>> 			<xs:choice minOccurs="0" maxOccurs="unbounded">
>>>>> 				<xs:element ref="x:externalid"/>
>>>>> 				<xs:element ref="x:major"/>
>>>>> 			</xs:choice>
>>>>> 			<xs:choice minOccurs="0" maxOccurs="unbounded">
>>>>> 				<xs:element ref="x:major"/>
>>>>> 				<xs:element ref="x:minor"/>
>>>>> 				<xs:element ref="x:version"/>
>>>>> 			</xs:choice>
>>>>> 		</xs:choice>
>>>>> 	</xs:complexType>
>>
>> the XML schema processor would know which choice set it is in when it
>> encounters a "major" element because if it first encountered an
>> "externalID" element (which must remain mandatory - as it is
>> above - in
>> order for this to work) it knows that it must be in the first choice
>> set; otherwise, it must be in the second.
>
> I don't think so. The model here is ((e|ma)* | (ma|mi|v)*), and  
> content
> consisting of a single "ma" element would match either branch.
>
> Michael Kay
> http://www.saxonica.com/
>
>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS