- From: Eric van der Vlist <vdv@dyomedea.com>
- Date: Thu, 21 Jun 2001 11:28:55 +0200
- To: xmlschema-dev@w3.org
Eric van der Vlist wrote:
>
> "Anna A. Yacubovitch" wrote:
> >
> > Hello!
> > I need some help.
> > I need a type that allows any order of child elements, every element can
> > appear no more than a single time.
> .../...
> > I need at least one child element.
>
> I don't think you can capture this with W3C XML Schema...
Sorry, I was too harsh with W3C XML Schema, there is a long and verbose
possibility that is to describe all the possibilities.
For instance (with 2 elements):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="ApplicationRequest">
<xs:complexType>
<xs:choice>
<xs:sequence>
<xs:element name="PermissionRequestSet" type="xs:string" />
<xs:element name="LocationRequestSet" type="xs:string"/>
</xs:sequence>
<xs:sequence>
<xs:element name="LocationRequestSet" type="xs:string"/>
<xs:element name="PermissionRequestSet" type="xs:string" />
</xs:sequence>
<xs:element name="PermissionRequestSet" type="xs:string" />
<xs:element name="LocationRequestSet" type="xs:string"/>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
I let you add the 5 remaining elements ;=) .
Eric
--
Pour y voir plus clair dans la nebuleuse XML...
http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist http://xmlfr.org http://dyomedea.com
http://xsltunit.org http://4xt.org http://examplotron.org
------------------------------------------------------------------------
Received on Thursday, 21 June 2001 05:29:17 UTC