3 Aug
2005
3 Aug
'05
1:24 p.m.
Are named entities ignored by lxml? Even with a suitable DTD declared, the following program does not output the copyright sign; it does, however, if it's provided as a numeric entity. **** from lxml import etree from StringIO import StringIO import sys source = """\ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <p>©2005</p> </html> """ infile = StringIO(source) tree = etree.parse(infile) tree.write(sys.stdout) **** Hamish Lawson