W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2001

XML schema supports conditional structure???

From: <sujen.chen@verizon.com>
Date: Fri, 21 Sep 2001 13:03:29 -0400 (EDT)
To: xmlschema-dev@w3.org
Message-ID: <OFBE001353.F3DF497A-ON85256ACE.005D5E89@bell-atl.com>
Hi,

Does XML handles conditional structure?
In otherwords, can the use of a type be conditional?
Please see the following example.

<xsd:complexType name="BindType">
  <xsd:attribute name="type" use="required">
    <xsd:simpleType>
      <xsd:restriction base="xsd:NMTOKEN">
        <xsd:enumeration value="BridgedEthernet"/>
        <xsd:enumeration value="PPPOE"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>

  <!-- the following item is required if value of above attribute "type"
is "BridgeEthernet" : can this be done ???? -->
  <xsd:attribute name="BrEthernetIP" use="optional">
    <xsd:simpleType>
      <xsd:restriction base="xsd:string">
        <xsd:minLength value="7"/>
        <xsd:maxLength value="16"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>

Please advise.

Thanks,

Daniel
Verizon CSM Team
Received on Friday, 21 September 2001 16:36:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT