diff emeraldtree/tree.py @ 74:a271e50bea43

Tree - Redefine ElementTree write with Node write
author Bastian Blank <bblank@thinkmo.de>
date Fri, 04 Jun 2010 13:46:06 +0200
parents 048d2f8de762
children d9ac9fe47760
line wrap: on
line diff
--- a/emeraldtree/tree.py	Fri Jun 04 13:02:19 2010 +0200
+++ b/emeraldtree/tree.py	Fri Jun 04 13:46:06 2010 +0200
@@ -635,18 +635,12 @@
         write = file.write
         if not encoding:
             encoding = "us-ascii"
-        if not method or method == "xml":
-            Writer = XMLWriter
-        elif method == "html":
-            Writer = HTMLWriter
-        else:
-            Writer = TextWriter
 
         if default_namespace:
             namespaces = namespaces.copy()
             namespaces[default_namespace] = ''
 
-        Writer(encoding, namespaces).write(write, self._root)
+        self._root.write(write, encoding=encoding, namespaces=namespaces, method=method)
 
 # --------------------------------------------------------------------
 # serialization support