[xsd] Can the content of a mixed type be an enumeration?

Discussion in 'XML' started by Fender Mussel, Sep 14, 2004.

  1. Hi all,

    Is it possible to check the content of a mixed type? I would like to
    define an enumeration for it. The following example works syntactically,
    but XMLSpy does no checks on the content at all:

    <xsd:simpleType name="my_enum_type">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="enum1"/>
    <xsd:enumeration value="enum2"/>
    <xsd:enumeration value="enum3"/>
    <xsd:enumeration value="enum4"/>
    <xsd:enumeration value="enum5"/>
    </xsd:restriction>
    </xsd:simpleType>


    <xsd:complexType name="complex_type_x" mixed="true">
    <xsd:complexContent>
    <xsd:extension base="my_enum_type">
    <xsd:choice>
    <xsd:element name="sub_elem_1"/>
    <xsd:element name="sub_elem_2"/>
    </xsd:choice>
    </xsd:extension>
    </xsd:complexContent>
    </xsd:complexType>


    Thanks in advance for your help!

    FM
     
    Fender Mussel, Sep 14, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bob Foster
    Replies:
    7
    Views:
    822
    Bob Foster
    Aug 6, 2003
  2. JamesSmithMz

    XSD enumeration based on elements

    JamesSmithMz, Nov 30, 2005, in forum: XML
    Replies:
    0
    Views:
    434
    JamesSmithMz
    Nov 30, 2005
  3. news.emn.fr

    xsd enumeration and pattern

    news.emn.fr, May 31, 2006, in forum: XML
    Replies:
    0
    Views:
    517
    news.emn.fr
    May 31, 2006
  4. puvit82
    Replies:
    4
    Views:
    779
    puvit82
    Feb 1, 2008
  5. kanpeter

    conditional enumeration in XSD

    kanpeter, Oct 26, 2010, in forum: XML
    Replies:
    1
    Views:
    1,861
    Joe Kesselman
    Oct 27, 2010
Loading...

Share This Page