Next in thread → Next in month →

Re: [xml-dev] Deterministic content models???

From
Richard Tobin <>
To
Date
2002-08-07T16:12:50Z
ID
<>
Thread
Re: [xml-dev] Deterministic content models???
In article <> 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
Next in thread → Next in month →