diff 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
line wrap: on
line diff
--- a/emeraldtree/tree.py	Sun Dec 23 17:39:51 2012 +0100
+++ b/emeraldtree/tree.py	Sun Dec 23 17:58:33 2012 +0100
@@ -1352,8 +1352,9 @@
             for e in elem:
                 self.serialize(write, e, qnames)
 
-    def serialize_dicument_start(self, write):
-        write(u"<?xml version='1.0' encoding='%s'?>\n" % self.encoding)
+    def serialize_document_start(self, write):
+        if self.encoding and self.encoding not in ("utf-8", "us-ascii"):
+            write(u"<?xml version='1.0' encoding='%s'?>\n" % self.encoding)
 
 
 class HTMLWriter(MLBaseWriter):