HTMLBuilder and <A HREF=''>yeah teah</A>

Ben Skelton b.skelton at
Thu Mar 9 15:14:08 CET 2000


I am using python1.5.1 and xml0.5.2.

I build a html page like this:
from xml.dom.html_builder import HtmlBuilder 
from xml.dom.writer import HtmlLineariser 

b = HtmlBuilder ()
b.startElement ('html')
b.startElement ('a', {'href': ''})
b.text ('Press me')
b.endElement ('a')
b.endElement ('html')

but this gives:
>>print HtmlLineariser().linearise(b.document)
<HTML><A HREF="">Press me</A></HTML> 

note the '&' in the href argument.

How can I do this properly?

thanks in advance

More information about the Python-list mailing list