August Karlstrom wrote:
> In XHTML, can any empty element <foo></foo> be replaced by <foo />?
>
> Example:
>
> <table>
> <tr><td>1</td><td>2</td></tr>
> <tr><td /><td>4</td></tr>
> </table>
If parsed as XML it will not matter whether you have
<td></td>
or
<td />
or
<td/>
On the other hand the XML 1.0 specification says
"For interoperability, the empty-element tag SHOULD be used, and
SHOULD only be used, for elements which are declared EMPTY."
so as td elements are not declared as empty".
That is also what the XHTML 1.0 specification suggests if you want to
serve XHTML 1.0 documents as text/html. In that case you markup an empty
table cell as <td></td> and only elements defined as being empty (such
as the br element) as <br />.
--
Martin Honnen
http://JavaScript.FAQTs.com/