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>

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:restriction base="xsd:NMTOKEN">
        <xsd:enumeration value="BridgedEthernet"/>
        <xsd:enumeration value="PPPOE"/>

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

Please advise.


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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:53 UTC