W3C home > Mailing lists > Public > www-archive@w3.org > July 2002

Can I choose one simpleType in one element?

From: Kasahara, Miki <Miki.Kasahara@getronics.com>
Date: Fri, 5 Jul 2002 00:29:39 -0400 (EDT)
Message-ID: <C64BD2FC13ACF34DA58D45F2F24B5B151E1CCA@excjpyo101.asia.unity>
To: "'www-archive@w3.org'" <www-archive@w3.org>




Hi!

We define some  common simpleTypes because we will use them 
several times in XMLs. and I would like to choose one simpleType 
between common simpleType in one tag(element).

If you know some  answers, please advice me!

ex)
==================
in XML, it will be...
------------------
<A>abcde</A>           <!-- 6 small character -->
------------------
OR
------------------
<A>1234567890</A>      <!-- 10 number -->
------------------

==================
in schema, I would like to choose several simpleTypes.
==================

<xs:element name="A">
   <!-- WE WOULD LIKE TO CHOOSE TYPE -->
     CHOOSE
        REF="alf simpleType"
          OR
        REF="num simpleType"
</xs:element>


<!-- "alf" simpleType -->
<xs:simpleType name="alf">
    <xs:restriction base="xs:string">
        <xs:pattern value="[a-z]{6}"/>
    </xs:restriction>
</xs:simpleType>

<!-- "num" simpleType -->
<xs:simpleType name="num">
    <xs:restriction base="xs:string">
        <xs:pattern value="[0-9]{10}"/>
    </xs:restriction>
</xs:simpleType>


Thank you!
miki kasahara



-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Miki Kasahara
http://jp.getronics.com/
Professional ServiceDivision
e-Solutions Development Department
Getronics Japan, LTD
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
Received on Thursday, 11 July 2002 00:27:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:42:08 UTC