W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2003

Possible XMLSchema for data value

From: Avin Patel <vze49rz3@verizon.net>
Date: Mon, 6 Jan 2003 18:19:46 -0500
Message-ID: <01a801c2b5da$1a596780$643a42d1@Avin>
To: "xmlschema" <xmlschema-dev@w3.org>
Hi All,
How can I write the XML Schema definition for following data value:


One possible way I can think about is:
<xsd:element name = "Size" type="SizeType">
<xsd:complexType name ="SizeType">
    <xsd:union memberTypes="xsd:integer">
       <xsd:restriction base="xsd:token">
          <xsd:enumeration value =  "&lt;midium/&gt;"/>
          <xsd:enumeration value =  "&lt;large/&gt;"/>
          <xsd:enumeration value =  "&lt;small/&gt;"/>

But SAX validators considers value1:<size><medium/></size>, medium as "element" of size "element", not as "value". I can write in another way as:

<xsd:element name = "Size" type="SizeType">
<xsd:complexType name ="SizeType">
        <xsd:element name = "small" type="xsd:integer" default="0" />
        <xsd:element name = "large" type="xsd:integer" default="1" />
        <xsd:element name = "medium" type="xsd:integer" default="2" />

But I am not able mix this definition with integer value definition.
complexType mix mode can work for this case, but it is mostly not
supported by many XML parser. So I can't use mix mode.

Please provide any suggestion.

Thank you
Avin Patel
Received on Monday, 6 January 2003 18:20:08 UTC

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