Re: [xml-dev] DTD

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