[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: optional, but at least one required

From: Virginia Wiswell <vwiswell@verizon.net>
Date: Thu, 11 Oct 2007 15:37:26 -0500
To: "Michael Kay" <mike@saxonica.com>,"'Pete Cordell'" <petexmldev@tech-know-ware.com>, "'Marie Bilde Rasmussen'" <mariebilderas@gmail.com>
Cc: "'Virginia Wiswell'" <vwiswell@verizon.net>, <xmlschema-dev@w3.org>
Message-ID: <web-50635784@aliencamel.com>
Re: optional

That's a pretty straightforward solution. I look forward to using it 
:)

Regarding the previous message, Michael, where does one draw the line 
at including every rule in the schema? Some things are more easily 
done when processing, for sure. But it's good to know that I can't get 
arrested for leaving something out of the schema :)

On Thu, 11 Oct 2007 14:38:13 +0100
  "Michael Kay" <mike@saxonica.com> wrote:
> 
>> XSD1.1 is looking at adding an xs:assert schema directive 
>> that includes a set of xpath expressions that a construct 
>> (sequence/choice/etc.) must satisfy.  I would be interested 
>> to know how complicated such an expression for this use-case 
>> would be if anyone cared to submit an example.
> 
> You can write it as
> 
>  <xs:sequence>
>    <xs:element ref="a" minOccurs="0"/>
>    <xs:element ref="b" minOccurs="0"/>
>  </xs:sequence>
>  <xs:assert test="a|b"/>
> 
> Michael Kay
> http://www.saxonica.com/
> 
> 
> 
Received on Thursday, 11 October 2007 20:37:40 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.