Re: HTML 4.01 Specification - query

Norman Paterson wrote:

 > Not sure if this is a typo or my mistake.  Section 7.4.2 of
 > REC-HTML401-19991224 has:
 >
 >     <!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- document title
 > -->
 >
 > where
 >
 >     <!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" --
 > repeatable head elements -->
 >
 > I don't see why -(%head.misc;) is necessary in the element definition
 > of TITLE.

This is beacuse of the element declaration for HEAD:
    
<!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head -->

Here, head.misc is included which means that SCRIPT, STYLE, META, LINK 
and OBJECT are
allowed subelements for HEAD. But by doing this inclusion, they will 
also be allowed
subelements for TITLE, which is why they later are excluded.

 > If it is necessary, why is it not also necessary to forbid all other
 > elements besides those in %head.misc;

They are not allowed in the first place. The content model for TITLE is 
(#PCDATA).

 > As far as I have been able to discover, PCDATA may contain character
 > references such as &lt; but no tag-based markup such as <EM>...</EM>;
 > which is consistent with -(%head.misc;) being unnecessary.

Yes, in PCDATA, all markup is recognized, but elements are not allowed.
About the exclusion of head.misc being unnecessary, that is already 
answered :)

-- 
David Håsäther

Received on Friday, 6 May 2005 18:25:01 UTC