[Prev][Next][Index][Thread]

Re: CSS1 extension: container/noncontainer property



Joel N. Weber II wrote:
> 
> I'm trying to write the HTML parser in GNU E-scape to not directly use
> the name of the tag wherever possible, and encode all the information in
> the style sheet.
> 
> Other than certain exceptional tags, this information can be encoded
> almost entirely with CSS1 and with tag attributes.  However, there's no
> way to know if I have something like an <IMG> tag, for which there is no
> corresponding </IMG> tag, or something like <PRE>, where there is a
> corresponding </PRE> tag.
> 
> I'd like to add a new property.  I'm thinking about calling it
> `container', with possible values of `container' and `non-container'.  

No,  this would be a big mistake.  The information about what tags
require a closing tag,  which are implied and which are just elements
(what's the SGML nomenclature for this?) is contained in the DTD.  No
simple declaration in CSS1 will fix this.  You need to create a real
parser of some kind.  You can do pretty well with a few boolean
variables per tag,  better yet is to use the DTD to understand what tags
are valid at what levels so you can perform adequate error recovery.

Doug
-- 
Doug Rand <drand@sgi.com>		(508) 567 - 2217	
Silicon Graphics/Silicon Desktop	http://reality.sgi.com/drand
Disclaimer: These are my views,  SGI's views are in 3D


Follow-Ups: References: