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

RE: UPA or not UPA violation?

From: Michael Kay <mike@saxonica.com>
Date: Wed, 16 Apr 2008 12:24:29 +0100
To: <lists@fgeorges.org>, <xmlschema-dev@w3.org>
Message-ID: <6A04F69F17724B8299C93EC0913E8232@Sealion>
RE: UPA or not UPA violation?

Remember what UPA stands for: unique particle attribution. Every child
element can be unambiguously associated with exactly one particle in the
content model. If there are no child elements, this is trivially true.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w3.org 
> [mailto:xmlschema-dev-request@w3.org] On Behalf Of Florent Georges
> Sent: 16 April 2008 12:15
> To: xmlschema-dev@w3.org
> Subject: UPA or not UPA violation?
> 
> 
>   Hi
> 
>   Considering the following schema:
> 
>     <xs:group name="g1">
>        <xs:sequence>
>           <xs:element name="a" type="xs:int" minOccurs="0"/>
>           <xs:element name="b" type="xs:int" minOccurs="0"/>
>        </xs:sequence>
>     </xs:group>
> 
>     <xs:group name="g2">
>        <xs:sequence>
>           <xs:element name="c" type="xs:int" minOccurs="0"/>
>           <xs:element name="d" type="xs:int" minOccurs="0"/>
>        </xs:sequence>
>     </xs:group>
> 
>     <xs:element name="elem">
>        <xs:complexType>
>           <xs:sequence>
>              <xs:choice>
>                 <xs:group ref="g1"/>
>                 <xs:group ref="g2"/>
>              </xs:choice>
>           </xs:sequence>
>        </xs:complexType>
>     </xs:element>
> 
>   Should it be an UPA violation if we have an "elem" element 
> with no child?  Because in this case we know the content of 
> the element is either of the groups but we don't know which 
> one (because both can be empty).
> 
>   Or I missed something?
> 
>   Regards,
> 
> --drkm
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>       
> ______________________________________________________________
> _______________
> Envoyez avec Yahoo! Mail. Une boite mail plus intelligente 
> http://mail.yahoo.fr
> 
> 
Received on Wednesday, 16 April 2008 11:25:09 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.