[BangPypers] Empty element in xml

Gora Mohanty gora at mimirtech.com
Mon Nov 4 17:05:51 CET 2013


On 4 November 2013 21:07, Amit Sethi <amit.pureenergy at gmail.com> wrote:
> I ended up using method=html for writing the xml.
>
> tree.write(filename, encoding="utf-8", xml_declaration=True, method='html')
>
> I am not sure if there are going to be any problems with this but for
> the time being my nosetests seem to be working fine

I would not do that at all. There are subtle differences between HTML
and XML, e.g., HTML allows tags that are not explicitly closed with
</tag>. Try a sub-element with the <img> or <input> tag. In general,
valid HTML is not necessarily valid XML, and vice versa. The bugs
that such an assumption might exercise can be subtle and hard to
catch.

Regards,
Gora


More information about the BangPypers mailing list