On Fri, 04 Sep 2009 13:21:54 +0200, Stefan Behnel wrote: >>>> Not a bug in IE (this time), which is correctly parsing the file as html. >>> ... which is obviously not the correct thing to do when it's XHTML. >> >> It isn't though; it's HTML with a XHTML DOCTYPE > > Not the page I look at (i.e. the link provided by the OP). It clearly has > an XHTML namespace, so it's X(HT)ML, not HTML.
It depends upon your User-Agent header. By default, it returns a Content-Type of application/xhtml+xml, so it should be parsed as XML, i.e. <script /> should be treated as <script></script>. But if the User-Agent header indicates MSIE, it returns a Content-Type of text/html, which should be parsed as HTML, where <script /> won't work. XHTML can be either HTML or XML, and it makes a difference as to whether you parse it as HTML or XML. If you want to create a document which parses the same way in either case, you must adhere to the compatibility rules in Appendix C of the XHTML standard, which means (amongst other things) not minimising tags which can have content (i.e. not EMPTY), regardless of whether or not they do have content. -- http://mail.python.org/mailman/listinfo/python-list