![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - optional, but at least one required [Thread Next] Re: optional, but at least one requiredTo: xmlschema-dev@--.--- Date: 1/4/2006 3:09:00 PM
Use a 'group' for the 'a', 'b', and 'c' element definitions and
reference this 'group' in the 'options' element definition:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="options">
<xsd:complexType>
<xsd:sequence>
<xsd:group ref="optionsGroup"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:group name="optionsGroup">
<xsd:choice>
<xsd:element name="a"/>
<xsd:element name="b"/>
<xsd:element name="c"/>
</xsd:choice>
</xsd:group>
</xsd:schema>
Brian Bonner wrote:
> Hello,
>
> Is there a way through restrictions or xmlschema in general to create
> the following criteria?
>
> <options>
> <a></a>
> <b></b>
> <c></c>
> </options>
>
> where the rule is that a, b and c are all optional, but at least one
> of a, b or c is required.
>
> Thanks.
>
> Brian
>
>
>
>
From mike@s... Fri Jan 06 09:27:58 2006
Received: from maggie.w3.org ([193.51.208. | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
