|
[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] One of more elements required
From: Age Bosma <agebosma@gmail.com>
Date: Wed, 22 Oct 2008 21:51:20 +0200 Message-ID: <48FF8438.6030104@gmail.com> To: xmlschema-dev@w3.org Hi, I can't seem to find a solution for the following problem. I hope you can help me out. Here's a stripped down version of what I've got: <xsd:complexType name="rootType"> <xsd:sequence> <xsd:element name="platform" type="platformType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="device" type="deviceType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> Basically, as you can see, the parent element can have zero or more platform elements AND zero or more device elements. I'd like to add an additional requirement. The parent element should at least have one of the two child (platform OR device) elements. How can this be expressed in XML Schema? Can it be done at all? Using 'choice' doesn't seem like an option to me since that would only allow me to include one of the two and not both. Thank in advance, Age BosmaReceived on Wednesday, 22 October 2008 21:38:53 GMT |
Subscribe in XML format
|






