By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,529 Members | 864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,529 IT Pros & Developers. It's quick & easy.

A few questions about the html dtd

P: n/a
Hi,
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
LI:
<!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
((%flow;)*|INS|DEL)?

Thanks for your consideration.

Regards,
Johnny

Oct 16 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hello,

Johnny wrote:
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;"?
-(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></Awould then be valid).
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
LI:
<!ELEMENT LI - O (%flow;)* -- list item -->
is that to say "minus %block; from %flow;"?
Yes, and not only from the model group of LI, but for every element in a DIR
or MENU.

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
((%flow;)*|INS|DEL)?
'+(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
used.
P.S.: As INS and DEL allow any %flow; element as their childs, something
like

<p><ins><div>foo</div></ins></p>

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.

HTH

--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://pink.odahoda.de/
Oct 16 '06 #2

P: n/a
Johnny wrote:
Hi,
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
LI:
<!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
((%flow;)*|INS|DEL)?

http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3
http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.3.1

--
Gus
Oct 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.