W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

IF-ELSE in XML Schema

From: Ankit <ankitc@ltp.soft.net>
Date: Tue, 19 Nov 2002 11:27:11 -0500
Message-Id: <>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
Is it possible to have IF-ELSE functionality in XML SChema
In my SCHEMA I have to select a Enumeration based on the values from 
another enumeration

    <simpleType name="Attributes">
     <restriction base="string">
      <enumeration value="Flight Number"/>
      <enumeration value="Class"/>
      <enumeration value="Fare"/>
      <enumeration value="Equipment"/>
      <enumeration value="Origin"/>
      <enumeration vlue="Destination"/>
      <enumeration value="Departure Date"/>
      <enumeration value="Arrival Date"/>
      <enumeration value="Record Locator"/>
      <enumeration value="Reservation Number"/>

    <complexType name="AttrVal">
      <element name="attrName" type="tns:Attributes">
      <element name="valueText" type="string" minOccurs="0">

In AttrVal schema I want ' valueText ' to be an Enumeration


if(attrName=="Flight Number") then valueText="values from other enum"

Thanx in advance
Received on Tuesday, 19 November 2002 11:40:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:00 UTC