Re: XHTML empty elements

> | I understand the compatibility issue, but I still think that the statement
> | in 4.1.6 is a problem, because of the br element type declaration in
> | http://www.w3.org/TR/WD-html-in-xml/DTD/xhtml1-strict.dtd which is:
> |
> | <!ELEMENT br EMPTY>

> | How can a validating XML parser (that conforms to XML 1.0) check the
> | constraint of sec 4.1.6 that it is an error to write <br></br>?

> My understanding of the term, "Empty element" is that it simply has no valid
> attributes. i.e. you can't say <br class="style"> or something like that.

This is clearly an incorrect definition, as plenty of empty elements
(hr, link, img, frame, col, ...) can take attributes.  And br itself
is allowed to take id, class, style or title (and clear, in the
transitional DTD) as an attribute.

> Although, just writing that gives me an interesting idea... what if <br
> line="3"> created the HTML equivelent of <br><br><br>? Is there any
> practicality in that?

This is the sort of thing that should be done with stylesheets.  I
doubt you'll see any more presentational attributes added to HTML
elements.
					John T. Whelan
					whelan@iname.com
					http://www.slack.net/~whelan/

Received on Wednesday, 5 May 1999 15:30:08 UTC