[Home] [By Thread] [By Date] [Recent Entries]


In article <200208071539.LAA00666@m...> you write:

>> 42: <!ELEMENT SMARTDOC (HEADER, ((DATA, VIEW*) | (DATA?, VIEW+)),
>> SIGNATURES?)>

>DTDs can't cope with choices of this sort.  This declaration has to be
>loosened to:
>
>	<!ELEMENT SMARTDOC (HEADER, DATA?, VIEW*, SIGNATURES?)>

You can do a bit better than that.  The original declaration allows

 (DATA, VIEW*):
   DATA, no VIEWs
   DATA, some VIEWs
 (DATA?, VIEW+)
   DATA, some VIEWs
   some VIEWS

So use this:

   <!ELEMENT SMARTDOC (HEADER, ((DATA, VIEW*) | VIEW+), SIGNATURES?)>

which allows precisely those cases.

There *are* content models that can't be made deterministic without
allowing undesired combinations, but they're very rare.  The example
usually quoted (I forget who discovered this) is the chess game:

  (WHITE, (BLACK, WHITE)*, BLACK?)

-- Richard

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member