XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] DTD vs XSD: No Duplicate Types in (Mixed) ContentModels

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]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS