[XML-SIG] Re: Minidom empty script element bug

Ryan Tomayko rtomayko at gmail.com
Wed Mar 16 16:23:04 CET 2005

On Mar 15, 2005, at 6:14 PM, Martin v. Löwis wrote:
> Derek Basch wrote:
>> XHTML 1.0 specs, Appendix C
>> ~~~~@~~~~
>> C.3 Element Minimization and Empty Element Content
>> 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 />)
>> ~~~~@~~~~
> I'd like to point out that this is *not* a minidom bug. minidom cannot
> possibly know that the document type is XHTML, and that strange, 
> non-XML
> rules apply to XHTML (i.e. rules which are not present in XML itself).
> I'd also like to point out that XHTML Appendix C is informative (i.e.
> non-normative), meaning that failure to comply to it does not imply
> non-compliance with XHTML. An XML file which uses the minimized form
> for the script element is still proper, well-formed, valid XHTML.

Perfectly said. Here's the WONTFIX:


>> How do I get minidom to NOT render an empty script element? Should I 
>> submit a
>> bug report?

You need to serve XHTML as "application/xhtml+xml" for Mozilla based 
browsers to consider it XML. If you are serving using "text/html" or 
"application/html", mozilla will assume tag soup.

This won't be your last problem with serving XHTML to the browser 
(note: link doesn't render in Safari):


These issues have led to the development of Kid, a template language 
for generating correct XML (and HTML when you need it):



More information about the XML-SIG mailing list