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

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 UTC