[XML-SIG] newbie HTMLBuilder question; avoiding HTML escaping

Dickon Reed Dickon.Reed@cl.cam.ac.uk
Mon, 08 Mar 1999 15:29:32 +0000


I've recently started playing about with the python XML stuff. I'm
currently trying to build, using HTMLBuilder, a HTML document
containing things like non-breaking spaces (ie a   in the
HTML). I can't however find a simple way of getting this through the
HTMLBuilder without it being escaped by the doText method of
XmlWriter. Am I missing something obvious? What is the best way of try
to do this?

(As a hacky workaround, I added magic characters to the start of my
strings by means of a new method in XML builder, and hacked XmlWriter
doText not to call escape if it detects the magic characters, but this
is clearly inelegant. I'd attached patches if this wasn't such a nasty

(If anyone is interested, an early version of my code is at
http://www.cl.cam.ac.uk/~dr10009/xmltophys-0.01.tar.gz, so people can
see what I'm doing).