Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: inquiry into the element behavior

From: Alex Porras <alex.porras@---.----------.--->
To: xmlschema-dev@--.---
Date: 10/31/2008 2:57:00 PM
Michael,

Thanks for your prompt response.  If you could be so kind to help me 
understand the result when the maxOccurs exists at both the choice and 
the nested elements, it would be greatly appreciated.

Scenario 1:

<xs:choice maxOccurs="1">
     <xs:element name="foo" type="xs:string" maxOccurs="unbounded"/>
     <xs:element name="bar" type="xs:string" maxOccurs="unbounded"/>
</xs:choice>

Is it correct to interpret this as: only one of either "foo" or "bar" 
allowed, with the implication that the "maxOccurs" attributes in the 
nested elements are essentially limited to 1 by the parent's 
"maxOccurrs" attribute?

Scenario 2:

<xs:choice maxOccurs="unbounded">
     <xs:element name="foo" type="xs:string" maxOccurs="unbounded"/>
     <xs:element name="bar" type="xs:string" maxOccurs="unbounded"/>
</xs:choice>

This would allow any number of both "foo" *and* "bar" elements, right? 
Does this contradict the purpose of the choice element to begin with, or 
am I just misunderstanding the function of the choice element?  In other 
words, how is scenario 2 different than just having the elements on 
their own, without the choice element?

Thanks,

Alex




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