A few questions about the html dtd

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

   Could you please tell me what's the meaning of the following element
definition? I have tried to find the meaning myself, but can't get
anything more besides the basic explanation of the dtd file.

1. <!ELEMENT A - - (%inline;)* -(A)       -- anchor -->
   * what's the "-(A)" supposed to mean? is that to say "minus A
element from %inline;"?
2. <!ELEMENT (DIR|MENU) - - (LI)+ -(%block;) -- directory list, menu
list -->
   * if the answer of the first question is "yes", what's the
"-(%block;)" supposed to mean here? I checked with the definition of
<!ELEMENT LI - O (%flow;)*             -- list item -->
   is that to say "minus %block; from %flow;"?
3. <!ELEMENT BODY O O (%flow;)* +(INS|DEL) -- document body -->
   * what's the meaning of "+(INS|DEL)"? is that to say "besides
%flow;, you can also use INS or DEL inside body? if so, why not use

   Thanks for your consideration.


Re: A few questions about the html dtd


Johnny wrote:

Quoted text here. Click to load it

-(A) is an 'exclusion'. This means that A is not allowed to be a child
element of A - not directly and not at any depth down in the element tree.

The A element is one of the elements listed in %inline;, so the model
group '(%inline;)*' would allow an A element as a direct child of an A. And
other elements in %inline; also allow A as a child, so simply removing A
from the model group would not work as intended (e.g.
<A><SPAN><A>..</A></SPAN></A> would then be valid).

Quoted text here. Click to load it

Yes, and not only from the model group of LI, but for every element in a DIR
or MENU.

Quoted text here. Click to load it

'+(INS|DEL)' is an 'inclusion'. Just like exclusions mean that the excluded
elements are not allowed anywhere below this element, and inclusion allows
the use of the included elements everywhere. So you are basically allowed
to use INS and DEL at any point in the document, even if these elements are
not explicitly listed in the model group for any other element.

The model group defines which elements are allowed (and in which order) as
direct childs of the declared element. In- and exclusions extend there
scope to every element down in the element tree where the element is being

P.S.: As INS and DEL allow any %flow; element as their childs, something


is actually valid! The HTML specification forbids this, by making further
constraits on the allowed content of INS and DEL, but this cannot be
expressed in the DTD.


Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de /

Re: A few questions about the html dtd

Johnny wrote:
Quoted text here. Click to load it



Site Timeline