Please enlighten me why XML Spy thinks this is valid. FYI, this specifies an SQL query. Here the XML:
<sideBar title="LabelSearch">
<searchLabel table="ID=*.companies">
<filter accessRight="r">
<and>
<filterElement argument="companies.Type" operator="=" value="Client"/>
</and>
</filter>
</searchLabel>
</sideBar>
The problem: I should not be allowed to put in only one filterElement inside the "and" tag, but at least two. If I only have one filterElement, I should use it without the surrounding "and" tag. Here the XSD:
<xs:complexType name="filterGroupType">
<xs:sequence>
<xs:choice>
<xs:element name="or" type="filterGroupOrType"/>
<xs:element name="and" type="filterGroupAndType"/>
<xs:element name="filterElement" type="filterType"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="accessRight" type="accessRightSimpleType" use="required"/>
</xs:complexType>
<xs:complexType name="filterGroupAndType">
<xs:sequence minOccurs="2" maxOccurs="unbounded">
<xs:element name="or" type="filterGroupOrType" minOccurs="0"/>
<xs:element name="filterElement" type="filterType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="filterGroupOrType">
<xs:sequence minOccurs="2" maxOccurs="unbounded">
<xs:element name="and" type="filterGroupAndType" minOccurs="0"/>
<xs:element name="filterElement" type="filterType" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="filterType">
<xs:attribute name="argument" type="xs:string" use="required"/>
<xs:attribute name="operator" type="operatorSimpleType" use="required"/>
<xs:attribute name="value" type="xs:anySimpleType"/>
<xs:attribute name="field" type="fieldTitleSimpleType"/>
</xs:complexType>
Thanks in advance.