W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2002

Re: [xml-dev] DTD

From: John Cowan <jcowan@reutershealth.com>
Date: Wed, 17 Jul 2002 14:59:51 -0400 (EDT)
Message-Id: <200207171900.PAA27213@mail.reutershealth.com>
To: B_Yallala@DirectAdvice.com (Yallala, Bhaskar)
Cc: xml-dev@lists.xml.org ("Xml-Dev (E-mail)"), xmlschema-dev@w3.org ("Xmlschema-Dev (E-mail)")

Yallala, Bhaskar scripsit:

> How can I represent things like a box can have zero or more Red and/or Black
> and/or Yellow balls?
> Is it like this?
> 
> <!ELEMENT Box (Red* | Black* |Yellow*) >

No.  That gives you a choice between all red balls, all black balls, and
all yellow balls.  You need to make a choice on the individual level and
put the zero-or-more operator outside, thus:

<!ELEMENT Box (Red | Black | Yellow)*>

> When I create xml file like
> <Box>
> <Red/>
> <Red/>
> </Box>
> 
> it says it must match Box( Red| Black | Yellow).
> 
> Any ideas?

What is "it" that says this?  "It" doesn't seem to know what it is talking
about, since multiple Red elements are explicitly allowed.


-- 
John Cowan                              <jcowan@reutershealth.com>
http://www.ccil.org/~cowan              http://www.reutershealth.com
                Charles li reis, nostre emperesdre magnes,
                Set anz totz pleinz ad ested in Espagnes.
Received on Wednesday, 17 July 2002 15:01:33 UTC

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