Re: XSD Problem

Chris van Mels <[email protected]> Wed, 2 Apr 2003 12:33:58 -0500
Newsgroups gmane.comp.java.sun.xml.general
Message-ID <[email protected]>
Slight amendment:

You're trying to map <!ELEMENT A (B | C)*>,

so use <xs:choice minOccurs="0" maxOccurs="unbounded">

In the example below,  <xs:choice maxOccurs="unbounded"> would
correspond to <!ELEMENT A (B | C)+>

- Chris

> ----------
> From:         Chris van Mels
> Reply To:     XML technologies in the Java Platform
> Sent:         Wednesday, April 02, 2003 12:06 PM
> To:   [email protected]
> Subject:      Re: XSD Problem
>
> Hi,
>
> Have you tried something like:
>
> <?xml version="1.0"?>
>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>
>   <xs:element name="A">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:choice maxOccurs="unbounded">
>           <xs:element ref="B" />
>           <xs:element ref="C" />
>         </xs:choice>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
>
> <xs:element name="B" type="xs:string" />
> <xs:element name="C" type="xs:string" />
>
> </xs:schema>
>
>
> - Chris
>
>
>
> > ----------
> > From:         Stefan H Westlund[SMTP:[email protected]]
> > Reply To:     XML technologies in the Java Platform
> > Sent:         Wednesday, April 02, 2003 10:35 AM
> > To:   [email protected]
> > Subject:      XSD Problem
> >
> > Hello!
> > I have a problem setting up the right XMLSchema.
> > I can't figure out how this DTD would be like in XSD.
> >
> > <!ELEMENT A (B | C)*>
> >
> > So this would parse OK....
> > (I hope you understand what I am trying to explain)
> >
> > <A>
> >   <B>
> >   </B>
> >   <C>
> >   </C>
> >   <B>
> >   </B>
> >   <B>
> >   </B>
> > </A>
> >
> > I have tried several XMLSchema-generators but none seems to generate (a
> > correct) XSD that I can use with xjc.sh.
> > If anyone know about what I am doing wrong please help me...
> > Thanks!
> > /Stefan W
> >
> > -----------------------------------------------------
> > xml-interest: A list for discussing XML technologies in the Java
> Platform.
> > To post, mailto:[email protected]
> > Archives at: http://archives.java.sun.com/xml-interest.html
> > To unsubscribe, mailto:[email protected] the following message;
> > signoff xml-interest.
> >
>
> -----------------------------------------------------
> xml-interest: A list for discussing XML technologies in the Java Platform.
> To post, mailto:[email protected]
> Archives at: http://archives.java.sun.com/xml-interest.html
> To unsubscribe, mailto:[email protected] the following message;
> signoff xml-interest.
>

-----------------------------------------------------
xml-interest: A list for discussing XML technologies in the Java Platform.
To post, mailto:[email protected]
Archives at: http://archives.java.sun.com/xml-interest.html
To unsubscribe, mailto:[email protected] the following message;
signoff xml-interest.