[Home] [By Thread] [By Date] [Recent Entries]
Hello Maik,
I think XSD processors make a difference because of the Unique Particle Attribution Constraint, mentioned in the XML Schema specification:
http://www.w3.org/TR/xmlschema-1/#cos-nonambig
"A content model must be formed such that [...] the particle component contained [...] therein with which to attempt to validate each item in the sequence in turn can be uniquely determined [...] without any information about the items in the remainder of the sequence."
Your example corresponds to what is said in the non-normative part H:
http://www.w3.org/TR/xmlschema-1/#non-ambig
"A content model will violate the unique attribution constraint if it contains two particles which overlap and which [...] may validate adjacent information items and the first has {min occurs} less than {max occurs}."
The last two xs:element particles in your first example (below) seem to fulfill this criterion.
I hope this helps?
Kind regards,
Ghislain
On Jan 31, 2011, at 3:27 PM, Maik Stührenberg wrote:
> It would be interesting to know why XSD processors do make a difference
> between
>
> <xs:element name="a">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="b"/>
> <xs:element ref="b"/>
> <xs:element ref="b"/>
> <xs:element ref="b" minOccurs="0" maxOccurs="1"/>
> <xs:element ref="b" minOccurs="0" maxOccurs="1"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
>
> and
>
> <xs:element name="a">
> <xs:complexType>
> <xs:sequence>
> <xs:element ref="b" minOccurs="3" maxOccurs="5"/>
> </xs:sequence>
> </xs:complexType>
> </xs:element>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |

Cart



