MENU Content Model [was: HTML 3.2 Content Models ]

In message <199605101607.CAA25952@oznet02.ozemail.com.au>, "Dianne Gorman" writ
es:
>
>2.  <!ELEMENT (DIR|MENU) - -  (LI)* -(%block)>
>
>How can you exclude %block from the LI element?  
>
>In, for example:
>
><!ELEMENT PRE - - (%text)* -(%pre.exclusion)>
><!ENTITY % pre.exclusion "IMG|BIG|SMALL|SUB|SUP|FONT">
>
>it is clear that the PRE element can contain all the elements in %text 
>except those in %pre.exclusion.
>
>But DIR and MENU can contain LI elements. There are no %block 
>elements to exclude, so (LI)* -(%block) is surely meaningless?

SGML inclusion and exceptions affect not just the children
of an element (e.g. DIR and MENU) but all descendents (see
section 11.2.5 of the SGML standard)

So the above content model for DIR|MENU excludes nested lists and
stuff like::

	<dir>
	<li>blah blah
		<blockquote>...</blockquote>
	<li>jlksjdf
	</dir>

The theory is that the oft-seen idiom:

	Products | Services | Search | Home

or:

	* Products * Services * Search * Home

could be marked up as:

	<menu><li>Products<li>Services<li>Search<li>Home</menu>

User agents would be sure that there are no block elements in
the LIs inside MENU/DIR, so they could use a very compact rendering.

Another theory is that dir/menu are deprecated, and this sort
of thing should be marked up as:

	<ul class=menu><li>Products ...

but the class attribute doesn't affect the content model of
the UL element, so there's no guarantee that <ul class=menu>
doesn't have nested lists and such.

Not that the DTD reliably provides such guarantees in practice... :-)


Dan

Received on Friday, 10 May 1996 12:46:57 UTC