Re: XML Schema wildcard question

You may use a union of an enumeration and a string instead:

   <xsd:simpleType name="DeviceEnum">
       <xsd:restriction base="xsd:string">
            <xsd:enumeration value="b"/>
            <xsd:enumeration value="f"/>
            ...
       </xsd:restriction >
   </xsd:simpleType>

   <xsd:element name="DeviceDataType">
        <xsd:simpleType>
            <xsd:union memberTypes="DeviceEnum xsd:string" />
        </xsd:simpleType>
    </xsd:element>


Regards--
mk

 > Is it possible to add a wildcard in the following XML schema enumeration
 > example?
 >
 > <xsd:element name="DeviceDataType">
 >      <xsd:simpleType>
 >       <xsd:restriction base="xsd:string">
 >         <xsd:enumeration value="b"/>
 >         <xsd:enumeration value="f"/>
 >         <xsd:enumeration value="flag"/>
 >         <xsd:enumeration value="h"/>
 >         <xsd:enumeration value="i"/>
 >         <xsd:enumeration value="s"/>
 >                     <xsd:enumeration ! value="*"/>
 >       </xsd:restriction>
 >     </xsd:simpleType>
 >   </xsd:element>

 >
 > Will the enumeration line that contains:  value="*" match any value that
 > wasn't equal to
 > b, f, flag, h, i, or s?  Does a wildcard feature exist in XML Schemas?
 >
 > Thank you for your help,
 >
 > Maureen C. Harig



<http://fr.mail.yahoo.com>Yahoo! Mail -- Une adresse @yahoo.fr gratuite et 
en français !

Received on Friday, 15 March 2002 09:31:22 UTC