W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2000

Re: DTD OR equivalent in XML schema

From: David Vázquez Guerrero <d_vazquez_g@yahoo.com>
Date: Tue, 5 Sep 2000 11:02:08 -0500 (CDT)
Message-ID: <20000905160208.24810.qmail@web1404.mail.yahoo.com>
To: Neil Archer <neil.archer@viewgate.com>, "XML Schema List \(E-mail\)" <xmlschema-dev@w3.org>
There is a "choice" element that allows choosing one
of several elements.


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

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

    <element name="A" type="string" minOccurs="1"
    <element name="B" type="int" minOccurs="1"

I hope this helps.


--- Neil Archer <neil.archer@viewgate.com> escribió: >
> 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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:49 UTC