W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2011

Re: Question about checking dependencies between fields in xml document via xsd

From: Michael Kay <mike@saxonica.com>
Date: Wed, 11 May 2011 21:22:05 +0100
Message-ID: <4DCAEFED.2010408@saxonica.com>
To: xmlschema-dev@w3.org
On 11/05/2011 17:25, Ионов Дмитрий Петрович wrote:
>
> Hello.
>
> During a few days I can't solve one problem.
>
> There are two groups of fields in the xml file
>
> first
>
> <field1></field1>
> <field2></field2>
> <field3></field3>
>
> second
>
> <field4></field4>
> <field5></field5>
>
> All fields in the same level of document.
>
> I need to check filled/presents or not at least one of these groups.
>
>
It's not entirely clear to me what your requirement is. Perhaps you want

<xs:choice minOccurs="1" maxOccurs="unbounded">
<xs:sequence>
<xs:element name="f1"/>
<xs:element name="f2"/>
<xs:element name="f3"/>
</xs:sequence>
<xs:sequence>
<xs:element name="f4"/>
<xs:element name="f5"/>
</xs:sequence>
</xs:choice>
Received on Wednesday, 11 May 2011 20:22:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 11 May 2011 20:22:30 GMT