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

F

Fender Mussel

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,585
Members
45,080
Latest member
mikkipirss

Latest Threads

Top