comparison emeraldtree/tree.py @ 91:08644d45d0c4

Tree - Revert XML change and fix typo
author Bastian Blank <bblank@thinkmo.de>
date Sun, 23 Dec 2012 17:58:33 +0100
parents 77a556fb6e1f
children 6fcfe20719ce
comparison
equal deleted inserted replaced
90:77a556fb6e1f 91:08644d45d0c4
1350 1350
1351 else: 1351 else:
1352 for e in elem: 1352 for e in elem:
1353 self.serialize(write, e, qnames) 1353 self.serialize(write, e, qnames)
1354 1354
1355 def serialize_dicument_start(self, write): 1355 def serialize_document_start(self, write):
1356 write(u"<?xml version='1.0' encoding='%s'?>\n" % self.encoding) 1356 if self.encoding and self.encoding not in ("utf-8", "us-ascii"):
1357 write(u"<?xml version='1.0' encoding='%s'?>\n" % self.encoding)
1357 1358
1358 1359
1359 class HTMLWriter(MLBaseWriter): 1360 class HTMLWriter(MLBaseWriter):
1360 empty_elements = frozenset(("area", "base", "basefont", "br", "col", "frame", "hr", 1361 empty_elements = frozenset(("area", "base", "basefont", "br", "col", "frame", "hr",
1361 "img", "input", "isindex", "link", "meta" "param")) 1362 "img", "input", "isindex", "link", "meta" "param"))