← Prev in month ← Prev in thread

Schema for unordered elements, with additional requirements

From
Robert Hall <>
To
Date
2008-02-29T18:51:47Z
ID
<>
Thread
Schema for unordered elements, with additional requirements
Here's what I'd like to do, but <xs:all> does not allow
maxOccurs="unbounded" and it doesn't accept <xs:any> elements.

<xs:element name="root">
	<xs:complexType>
		<xs:all>
			<xs:element name="foo" />
			<xs:element name="bar" />
			<xs:element name="zzz" maxOccurs="unbounded" />
			<xs:any namespace="##other"
processContents="skip" maxOccurs="unbounded" />
		</xs:all>
	</xs:complexType>
</xs:element>

Here are the requirements:
 
1. Elements can appear in any order.
2. Elements foo, bar, and zzz are required.
3. Element zzz can appear more than once.
4. Elements from other namespaces are allowed but ignored.

I have tried various combinations of <xs:sequence> and <xs:choice> and
<xs:group> elements with various minOccurs and maxOccurs values, but
haven't been able to meet all the requirements.
Is it possible with XML Schema?

Thanks,
-rh
← Prev in month ← Prev in thread