
Lee Passey wrote:
On the other hand, I don't see how Mr. Hutchinson's second example could validate if the first does not, particularly given the fact that DTD's are not structured in such a way to permit a validator to make that kind of a judgment ("if a <div> contains a <div> it must be the last element of the first <div>" or "if a <div> contains a <div> it may be preceded by a <p>, but not followed by one").
This simple declaration does exactly that: <!ELEMENT div (p*, div*)> "A div may contain zero or more p followed by zero or more div."
In this particular case, I suspect a bug in the validator program. I mean, writing validators is hard, and I am aware of at least one bug in the W3C's online HTML validator.
No bug. The TEI dtd is broken as designed.
Supposedly, Xerces is a validating parser. Maybe I'll see if I can find the time to run the snippet through Xerces and see if (and where) it breaks.
Get libxml2 from xmlsoft.org and use xmllint. -- Marcello Perathoner webmaster@gutenberg.org