Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


One of more elements required

From: Age Bosma <agebosma@-----.--->
To: xmlschema-dev@--.---
Date: 10/22/2008 9:41:00 PM
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 Bosma





transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent