empty tags in XHTML serialization

Bug #932884 reported by Cezar Andrei
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
High
Chris Hillery

Bug Description

Spec sections:
http://www.w3.org/TR/xhtml1/#h-4.3
In SGML-based HTML 4 certain elements were permitted to omit the end tag; with the elements that followed implying closure. XML does not allow end tags to be omitted. All elements other than those declared in the DTD as EMPTY must have an end tag. Elements that are declared in the DTD as EMPTY can have an end tag or can use empty element shorthand (see Empty Elements).

http://www.w3.org/TR/xhtml1/#h-4.6
Empty elements must either have an end tag or the start tag must end with />. For instance, <br/> or <hr></hr>. See HTML Compatibility Guidelines for information on ways to ensure this is backward compatible with HTML 4 user agents.

http://www.w3.org/TR/xhtml1/#C_3
Given an empty instance of an element whose content model is not EMPTY (for example, an empty title or paragraph) do not use the minimized form (e.g. use <p> </p> and not <p />).

In other words:
There are only 10 legal XHTML empty tags. A quick search for “empty” on the XHTML 1.0 DTD returns the following list of tags that can legally use the empty element shorthand:
<area/>
<base/>
<br/>
<col/>
<hr/>
<img/>
<input/>
<link/>
<meta/>
<param/>

All the other elements must use <ELEM></ELEM>.

Related branches

Changed in zorba:
milestone: 2.2 → 2.5
Changed in zorba:
milestone: 2.5 → none
Chris Hillery (ceejatec)
Changed in zorba:
milestone: none → 2.7
Revision history for this message
Chris Hillery (ceejatec) wrote :

I added some test cases (required a minor testdriver change) and determined Zorba is already behaving correctly.

While I was in there, I corrected the corresponding issue for HTML serialization, based on the discussion on zorba-coders in February.

https://lists.inf.ethz.ch/mailman/private/zorba-coders/2012-February/014594.html

Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.