Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: optional, but at least one required

From: "Pete Cordell" <petexmldev@--------------.--->
To: "Michael Kay" <mike@--------.--->, "'Marie Bilde Rasmussen'" <mariebilderas@-----.--->
Date: 10/11/2007 4:39:00 PM
- Original Message From: "Michael Kay"

>  <xs:sequence>
>    <xs:element ref="a" minOccurs="0"/>
>    <xs:element ref="b" minOccurs="0"/>
>  </xs:sequence>
>  <xs:assert test="a|b"/>

Hum, seems simple enough :-)

And, just to confirm that the simple case does not hide any nasties when 
extended up to bigger examples, Marie's case would simply be (ignoring the 
specific names):

    <xs:assert test="a|b|c|d|e|f|..."/>

BTW - If, in another schema snippet, I wanted either attribute A or element 
E, but not both, then my expression would be:

    <xs:assert test="@A and fn:not(E) or fn:not(@A) and E"/>

I don't think I can do the following though, because I can't do "...eq 1":

    <xs:assert test="op:count(@A|E) eq 1"/>

Is that the case?

Thanks,

Pete.
=============================================
Pete Cordell
Codalogic
for XML Schema to C++ data binding visit
 http://www.codalogic.com/lmx/
=============================================



From mike@s... Thu Oct 11 15:02:57 2007
Received: from aji.w3.org ([133.27.2


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