Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: optional, but at least one required

From: "Michael Kay" <mike@--------.--->
To: "'Pete Cordell'" <petexmldev@--------------.--->, "'Marie Bilde Rasmussen'" <mariebilderas@-----.--->
Date: 10/11/2007 5:03:00 PM
> 
> 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|..."/>

Of course, you could also reduce it to test="*", or if you want a less terse
expression

test="exists(child::*)"

> 
> 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've toyed with different ways of writing this, and I'm inclined to:

<xs:assert test="exists(@A) = empty(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"/>
> 

The current draft spec defines a very restricted subset of XPath 2.0 which
processors must implement, but allows them to implement the whole of XPath
2.0 if they prefer. That's what the Saxon implementation does (it's
supported in 8.9.9.2 which is out as a beta release). I hope that other
processors, and indeed the spec, will follow suit. (If you agree, please
comment on the last call draft!) I personally find it very frustrating to
work within the subset.

Michael Kay
http://www.saxonica.com/


From noah_mendelsohn@u... Thu Oct 11 15:12:24 2007
Received: from maggie.w3.o


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