OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]

In article <200208071539.LAA00666@mail2.reutershealth.com> 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS