VK wrote:
er*******@gmail .com wrote: Thanks to everyone who has helped me.
Here's something I don't understand:
VK wrote:
<snip> For the posted code table layout was not requested, so
internal subdivisions using <fieldset> were totally logical
*and* more correct then <div> because <fieldset> *is* direct
form's child and direct parent to its elements. Just check
and compare myDiv.form and
myFieldset.form property.
<snip>
The existence of the - form - property of the W3C HTML Level 1 DOM
specified - HTMLFieldSetEle ment - interface does not suggest that
FIELDSET elements should be children of FORM elements. Indeed as the
specification states that the - form - property "Returns null if this
control is not within the context of a form" the implication is that a
FIELDSET is not even expected in a FORM in all cases.
As to whether a FIELDSET element is a "more correct" child of a FORM
than a DIV, and the proposal that a FIELDSET "*is* direct form's child
and direct parent to its elements", The strict HTML DTD defines a form
as:-
<!ELEMENT FORM - - (%block;|SCRIPT )+ -(FORM) -- interactive form -->
- and the transitional DTD as:-
<!ELEMENT FORM - - (%flow;)* -(FORM) -- interactive form -->
So in the strict DTD the direct children of a FORM must be %block and/or
SCRIPT elements, excluding FORM elements. And in the transitional DTD
the direct children may be %flow elements, excluding FORM.
The Strict DTD defines %block as:-
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | NOSCRIPT |
BLOCKQUOTE | FORM | HR | TABLE | FIELDSET | ADDRESS">
- in which DIV and FIELDSET have equal significance.
While the transitional DTD defines %flow as:-
<!ENTITY % flow "%block; | %inline;">
- and %block as:-
<!ENTITY % block
"P | %heading; | %list; | %preformatted; | DL | DIV | CENTER |
NOSCRIPT | NOFRAMES | BLOCKQUOTE | FORM | ISINDEX | HR |
TABLE | FIELDSET | ADDRESS">
- where, again, DIV and FRAMESET have equal status.
The only distinction between the two are their respective semantic
meanings. The DIV element is a semantically neutral division (of
arbitrary page content). As to the meaning of FIELDSET, the text of the
HTML specification says:-
"The FIELDSET element allows authors to group thematically related
controls and labels. Grouping controls makes it easier for users to
understand their purpose while simultaneously facilitating tabbing
navigation for visual user agents and speech navigation for
speech-oriented user agents. The proper use of this element makes
documents more accessible."
The application of semantic mark-up involves the assignment of meaning
by its (human) author, and the observation that the controls within a
form are divided into two divisions is not enough to determine that the
division should mean that the controls are in two "thematic" groups.
So the test of correctness between DIV and FIELDSET hangs on the
author's perception of the contained form controls as "thematical ly
related" to each other while not "thematical ly related" to those in the
other division.
Turning to the FIELDSET element's DTD entry, both DTDs define FIELDSET
as:-
<!ELEMENT FIELDSET - - (#PCDATA,LEGEND ,(%flow;)*)
-- form control group -->
And so the permissible content for FIELDSET is #PCDATA and LEGEND and
%flow elements.
So a FIELDSET may be the direct child of a FORM, but it may also be a
descendant of a FORM and it may also appear in any other element that
allows %block content and outside of any FORM. And form controls may be
direct children of a FIELDSET, but they may also be descendants of a
FIELDSET and they may also appear in many contexts outside of a
FIELDSET.
If a FIELDSET "*is* direct form's child and direct parent to its
elements" it would be possible for the DTD to express that restriction
so the fact that neither of them does suggests that the assertion is
false, incomplete or misconceived.
Richard.