xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mik Lernout <...@futurestreet.org>
Subject Re: scomp does not validate <xs:choice> properly?
Date Mon, 05 Jul 2004 20:48:47 GMT

It is very strange that the XSV validator does not catch this error as 
it is definitely invalid. The basic premise is that when there is a 
choice, there can be no particles in its options that can be ambitious: 
for an element to be valid for a choice, the validator must be able to 
determine in the very beginning to which of the different choices it 
should match...

A less confusing explanation can be found in the Spec: 


Lachlan Paterson wrote:

>I attempted to run scomp, using a simple schema that contains a choice between two sequences,
and I received this error:
>"Content model violates the unique particle attribution rule"
>But using this:
>...it is valid.
>and, interestingly, using this:
>...it is not valid.
>I think it should be valid. This is the schema:
>   xmlns:xs="http://www.w3.org/2001/XMLSchema"
>   elementFormDefault="qualified">
><xs:element name="x" type="MyType"/>
><xs:complexType name="MyType">
>  <xs:choice>
>    <xs:sequence>
>      <xs:element name="a" type="xs:string"/>
>      <xs:element name="b" type="xs:string"/>
>      <xs:element name="c" type="xs:string"/>
>    </xs:sequence>
>    <xs:sequence>
>      <xs:element name="a" type="xs:string"/>
>      <xs:element name="b" type="xs:string"/>
>      <xs:element name="d" type="xs:string"/>
>    </xs:sequence>
>  </xs:choice>
>- ---------------------------------------------------------------------
>To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
>For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
>Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/

View raw message