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

Need help with Unique Particle Attribution Rule

From: Vinotha Suntharalingam <vinos@carbontwelve.com>
Date: Fri, 7 Jan 2005 16:32:48 +1100
To: <xmlschema-dev@w3.org>
Message-ID: <005701c4f47a$52cdc120$2a00a8c0@carbontwelve.com>
xsd element unique
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 
Received on Friday, 7 January 2005 12:36:48 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.