Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: optional, but at least one required >Thread Next - RE: optional, but at least one required Re: optional, but at least one requiredTo: "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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
