Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xml schema question

From: Peter Menzel <peter.menzel@-----.-----------.-->
To: xmlschema-dev@--.---
Date: 7/23/2004 3:53:00 PM
Hi all,

i am working on a xml schema and have the following problem, maybe 
somebody can help me.

I would like to have the follwoing element with content:

<element>
   <aa/>
   <cc/>
   <bb/>
</element>

The elements aa and bb are required to be there and they have to occur exactly once.
Other sub elements of element can occur many times. Especially 
the order of the elements is random, so i may not use xsd:sequence.

My xml schema snippet for this element:

<xsd:element name='element'>
  <xsd:complexType>
      <xsd:choice>
           <xsd:element ref='dd' minOccurs='0' maxOccurs='unbounded'/>
           <xsd:element ref='cc' minOccurs='0' maxOccurs='unbounded'/>
           <xsd:element ref='aa' minOccurs='1' maxOccurs="1"/>
           <xsd:element ref='bb' minOccurs='1' maxOccurs="1"/>
       </xsd:choice>
   </xsd:complexType>
</xsd:element>

Unfortunately this wont work.
xmllint says that the above xml document is not valid with this schema.

Has anybody any idea concerning this problem? Is it generally possible 
to mix elements in a complexType  with different minOccurs/maxOccurs ?

Greetings, Peter 



From george@s...  Fri Jul 23 08:33:16 2004
Return-Path: <george@s...>
X-Original-T


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