elementtree -

Fredrik Lundh fredrik at pythonware.com
Sun Oct 3 10:53:45 EDT 2004


Jesper Olsen wrote:

> I'd like to output the element "<span> </span>"
> and I try this
>
> w=XMLWriter(f)
> w.element("span", " ", id="txt")
>
> But that does not work because " " gets escaped to "&nbsp;"
> - and using " " does not work either because space does not get
> escaped...
> Is there a way to do this?

use chr(160).

(" " isn't a standard XML entity, and the simple writer doesn't support
custom entities.)

</F> 






More information about the Python-list mailing list