Marta Carrasco wrote:
> Is Something like that right?
> <!ELEMENT A (B,C)>
> <!ELEMENT B (D,E)>
> <!ELEMENT A (F,G)>
The syntax isn't legal, but the intention can certainly be supported.
You wish element A to contain either B followed by C or F followed by G,
but you havven't specified whether the two flavours will coexist in a
single document, or whether some documents require A to contain (B, C)
and other documents need A to contain (F, G). The first scenario is
possible by defining A as follows:
<!ELEMENT A ((B, C) | (F, G))>
The second scenario involves having an element declaration such as the
following in the DTD:
<!ELEMENT A (%ContentsOfA;)>
and a DOCTYPE declaration in the instance document such as:
<!DOCTYPE X SYSTEM "My.dtd" [
<ENTITY % ContentsOfA "(B, C)">
This ensures that all occurrences of the A element will contain the same
thing in a valid instance. If you wanted all occurrences to contain (F,
G), then that's what you would make the entity resolve to.
Perhaps I'm just grumpy because it's Monday morning, but it seems to me
that a handful of answers that say "no, the syntax isn't legal" fall
into the "not very helpful" basket.
Marcus Carr email: [log in to unmask]
Allette Systems (Australia) www: http://www.allette.com.au
"Everything should be made as simple as possible, but not simpler."