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

Re: DTD OR equivalent in XML schema

From: Dan Connolly <connolly@w3.org>
Date: Tue, 05 Sep 2000 10:56:27 -0500
Message-ID: <39B517AB.FB0CEA1A@w3.org>
To: Neil Archer <neil.archer@viewgate.com>
CC: "XML Schema List (E-mail)" <xmlschema-dev@w3.org>
Neil Archer wrote:
> 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?  

Some folks around here have developed a tool that does
just that. From the documentation:


<element name="ROOT">
 <complexType content="elementOnly">
   <element ref="t:A">
   <element ref="t:B">

-- http://www.w3.org/2000/04/schema_hack/

> Please
> forgive me if there is an obvious answer to this but I'm new to using
> schemas and cant see a simple solution.

I think the answer is fairly straightforward, but your
experience shows that it is not obvious. May I ask which
of the specs you have managed to read? Have you
seen the primer?

Did you use other materials
besides the specs to learn about XML Schemas?


The XML Schema Specification in Context
    by Rick Jelliffe, Academia Sinica Computing Centre
    2000-02-24 draft only
	compares XML Schema with XML DTDs, SGML DTDs,
	HyTime, and perl regular expressions 


Both the DTD->schema tool and the "in Context" discussion
document are linked from our page about XML Schema:

Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Tuesday, 5 September 2000 11:57:21 UTC

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