Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Need help with Unique Particle Attribution Rule

From: Burak Emir <Burak.Emir@----.-->
To: Michael Kay <mike@--------.--->
Date: 1/7/2005 4:18:00 PM
Dear Michael,

Please correct me if I am wrong, but I think your suggestion is not 
equivalent. In the original example it was possible to have

[admin,error,error]

whereas now one can only have

[admin,error,deviceTypeInfo,error]

In your definition, the last error (not of the ones that follow "admin") 
is always preceded by at least one deviceTypeInfo, which removes the 
ambiguity.

cheers,
Burak

Michael Kay wrote:

> This is actually one of those examples where the Thompson/Tobin 
> algorithm used by XSV and Saxon doesn't give a UPA error, because the 
> two particles for element "error" both refer to the same element 
> declaration. The Thompson/Tobin algorithm lets a content model through 
> if the element declaration for each element can be determined 
> unambiguously, even if the particle can't.
>  
> I think the following content model is equivalent, and passes the 
> stricter version of the UPA test:
>  
> <xsd:element name="systemProvider">
>     <xsd:complexType>
>         <xsd:sequence>
>             <xsd:sequence minOccurs="0" maxOccurs="unbounded">
>                 <xsd:element ref="admin"/>
>                 <xsd:element ref="error" minOccurs="0"/>
>             </xsd:sequence>
>             <xsd:sequence minOccurs="0">
>                <xsd:element ref="deviceTypeInfo" maxOccurs="unbounded"/>
>                <xsd:element ref="error" minOccurs="0"/>
>             </xsd:sequence>
>         </xsd:sequence>
>     </xsd:complexType>
> </xsd:element>
>  
> Michael Kay
> http://www.saxonica.com/
>
>     ------------------------------------------------------------------------
>     *From:* xmlschema-dev-request@w...
>     [mailto:xmlschema-dev-request@w...] *On Behalf Of *Vinotha
>     Suntharalingam
>     *Sent:* 07 January 2005 05:33
>     *To:* xmlschema-dev@w...
>     *Subject:* Need help with Unique Particle Attribution Rule
>
>     Hi,
>
>     I'm trying to parse an xsd with Xerces and I'm running into UPA
>     rule violation problems. Attached below is relevant sections in
>     the xsd where the problem is encountered. I'm finding it difficult
>     to define the 'systemProvider' element in such way it doesn't
>     violate this rule. Could someone please assist me on how it can be
>     done?
>
>     (I tried to follow the name, first-name, last-name example to fix
>     the problem, but this particular element definition seems to be a
>     bit more complicated. Any help would be much appreciated.)
>
>     <xsd:element name="systemProvider">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:sequence minOccurs="0" maxOccurs="unbounded">
>                     <xsd:element ref="admin"/>
>                     <xsd:element ref="error" minOccurs="0"/>
>                 </xsd:sequence>
>                 <xsd:element ref="deviceTypeInfo" minOccurs="0"
>     maxOccurs="unbounded"/>
>                 <xsd:element ref="error" minOccurs="0"/>
>             </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
>
>     <!-- The following elements are referenced in the above piece of
>     code -->
>
>     <xsd:element name="deviceTypeInfo">
>       <xsd:complexType>
>        <xsd:sequence>
>         <xsd:element ref="deviceType"/>
>         <xsd:element ref="category"/>
>         <xsd:element ref="maxPorts"/>
>         <xsd:element ref="protocolSupported" maxOccurs="unbounded"/>
>        </xsd:sequence>
>       </xsd:complexType>
>      </xsd:element>
>      
>     <xsd:element name="protocolSupported">
>       <xsd:complexType>
>        <xsd:simpleContent>
>         <xsd:extension base="xsd:string">
>          <xsd:attribute name="default" use="optional">
>           <xsd:simpleType>
>            <xsd:restriction base="xsd:string">
>             <xsd:enumeration value="true"/>
>            </xsd:restriction>
>           </xsd:simpleType>
>          </xsd:attribute>
>         </xsd:extension>
>        </xsd:simpleContent>
>       </xsd:complexType>
>      </xsd:element>
>      
>     <xsd:element name="error">
>       <xsd:complexType>
>        <xsd:sequence>
>         <xsd:element ref="id"/>
>         <xsd:element ref="summary"/>
>         <xsd:element ref="detail" minOccurs="0"/>
>        </xsd:sequence>
>       </xsd:complexType>
>      </xsd:element>
>     <xsd:element name="admin">
>       <xsd:complexType>
>        <xsd:sequence>
>         <xsd:element ref="userId"/>
>         <xsd:element ref="password" minOccurs="0"/>
>         <xsd:element ref="userName" minOccurs="0"/>
>        </xsd:sequence>
>       </xsd:complexType>
>      </xsd:element>
>     <xsd:element name="summary" type="xsd:string"/>
>     <xsd:element name="id" type="xsd:string"/>
>     <xsd:element name="detail" type="xsd:string"/>
>     <xsd:element name="userId" type="xsd:string"/>
>     <xsd:element name="password" type="xsd:string"/>
>     <xsd:element name="userName" type="xsd:string"/>
>     <xsd:element name="deviceType" type="xsd:string"/>
>     <xsd:element name="category" type="xsd:string"/>
>     <xsd:element name="maxPorts" type="xsd:string"/>
>
>
>     Thank you in advance.
>     Vino
>


-- 
Burak Emir

http://lamp.epfl.ch/~buraq


From tmoog@s... Fri Jan 07 14:25:38 2005
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4.34)
	id 1Cmv3a-0002b9-IG
	for xmlschema-dev@l....


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent