I have an XSD with this group
<xsd:group name="value">
<xsd:choice>
<xsd:element name="STRING"/>
<xsd:element name="NUMBER"/>
<xsd:element name="NULL"/>
<xsd:element name="OBJECT"/>
<xsd:element name="ARRAY"/>
</xsd:choice>
</xsd:group>
I then use it in this element
<xsd:element name="MEMBER">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:group ref="value" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="name" use="required"/>
</xsd:complexType>
</xsd:element>
----------------
I validate it against a document which has this fragment
<MEMBER name="_text">
<STRING> </STRING>
<STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING> <STRING>
</STRING>
</MEMBER>
It validates as successful in every schema validator I've tried (including Saxon, XSV, MS XML).
What am I missing ???
I want to have MEBMER element contain One and Only One element of STRING|NUMBER|NULL|OBJECT|ARRAY
Thanks for any suggestions !
Here's the full schema
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="OBJECT">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="MEMBER"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="MEMBER">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="1">
<xsd:group ref="value" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="name" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:element name="ARRAY">
<xsd:complexType>
<xsd:sequence maxOccurs="unbounded" minOccurs="0">
<xsd:group ref="value"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="STRING">
<xsd:simpleType>
<xsd:restriction base="xsd:string"/>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NUMBER">
<xsd:simpleType>
<xsd:restriction base="xsd:double"/>
</xsd:simpleType>
</xsd:element>
<xsd:element name="NULL"/>
<xsd:group name="value">
<xsd:choice>
<xsd:element name="STRING"/>
<xsd:element name="NUMBER"/>
<xsd:element name="NULL"/>
<xsd:element name="OBJECT"/>
<xsd:element name="ARRAY"/>
</xsd:choice>
</xsd:group>
</xsd:schema>
----------------------------------------
David A. Lee
dlee@calldei.com
http://www.xmlsh.org