Re: DTD OR equivalent in XML schema

There is a "choice" element that allows choosing one
of several elements.

Try 

<choice>
    <element ref="A" minOccurs="1" maxOccurs="1"/>
    <element ref="B" minOccurs="1" maxOccurs="1"/>
</choice>

where A and B have been declared separately, or you
could include the name and type of those elements in
the choice declaration

<choice>
    <element name="A" type="string" minOccurs="1"
maxOccurs="1"/>
    <element name="B" type="int" minOccurs="1"
maxOccurs="1"/>
</choice>

I hope this helps.

David

--- Neil Archer <neil.archer@viewgate.com> escribió: >
Hi,
> 
> I have been trying to convert some DTD's we are
> using to the equivalent XML
> schema, but I cannot find a way to reflect the DTD
> OR which states that one
> or the other element only can be specified.
> 
> i.e. if a document could contain an element A or an
> element B but not both
> the DTD would state something like:
> 
> <!ELEMENT document((A|B))>
> 
> Can anyone help by suggesting how I can show this in
> an XML schema?  Please
> forgive me if there is an obvious answer to this but
> I'm new to using
> schemas and cant see a simple solution.
> 
> Cheers,
> Neil.
> 


_________________________________________________________
Do You Yahoo!?
Obtenga su dirección de correo-e gratis @yahoo.com
en http://correo.espanol.yahoo.com

Received on Tuesday, 5 September 2000 12:02:12 UTC