W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

Re: http://www.topologi.com/public/Schtrn_XSD

From: Torsten Curdt <tcurdt@dff.st>
Date: Wed, 12 Jun 2002 10:05:52 +0200
To: Eddie Robertsson <erobertsson@allette.com.au>
Cc: xmlschema-dev@w3.org
Message-Id: <200206121005.52339.tcurdt@dff.st>

On Wednesday 12 June 2002 02:18, Eddie Robertsson wrote:
> Hi Torsten,
>
> > I am trying to have a mixture of ordered and unordered elements:
> >
> > <root>
> >   <seq1/>
> >   <seq2/>
> >   <unordered2/>
> >   <unordered1/>
> > </root>
> >
> > So what IMHO would make sense would be:
> >
> >   <xs:element name="root">
> >     <xs:complexType>
> >       <xs:sequence>
> >         <xs:sequence>
> >           <xs:element name="seq1"/>
> >           <xs:element name="seq2"/>
> >         </xs:sequence>
> >         <xs:all>
> >           <xs:element name="unordered1"/>
> >           <xs:element name="unordered2"/>
> >         </xs:all>
> >       </xs:sequence>
> >     </xs:complexType>
> >   </xs:element>
> > </xs:schema>
> >
> > But obviously this does not work.
> > What is the proposed way to express such a schema?
>
> How about wrapping the unordered content in an extra element:
>
> <root>
>   <seq1/>
>   <seq2/>
>   <unordered>
>     <unordered2/>
>     <unordered1/>
>   </unordered>
> </root>
>
>   <xs:element name="root">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element name="seq1"/>
>         <xs:element name="seq2"/>
>         <xs:element name="unordered">
>           <xs:complexType>
>             <xs:all>
>               <xs:element name="unordered1"/>
>               <xs:element name="unordered2"/>
>             </xs:all>
>           </xs:complexType>
>         </xs:element>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
> </xs:schema>

Well, I had this idea, too. But I don't want to change the XML structure 
because I want do describe it...

> If this doesn't work (or the suggestion by Mark) you have to move to
> RELAX-NG which can define this without problem or use embedded
> Schematron rules in your W3C XML Schema (see [1])

So it's really not possible with Schema? (That's what I feared)

> [1] http://www.topologi.com/public/Schtrn_XSD/Paper.html

Thanks, alot!
--
Torsten
Received on Wednesday, 12 June 2002 04:03:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT