[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: DTD vs XSD: No Duplicate Types in (Mixed) ContentModels

  • From: "Fourny Ghislain" <gfourny@inf.ethz.ch>
  • To: Maik Stührenberg <maik.stuehrenberg@uni-bielefeld.de>
  • Date: Mon, 31 Jan 2011 16:04:27 +0100

Re:  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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.