diff emeraldtree/ElementTree.py @ 12:1eb02b658530

Simplify serializer. emeraldtree/ElementTree.py: Allow any input as element in serializer.
author Bastian Blank <bblank@thinkmo.de>
date Sat, 31 May 2008 16:25:04 +0200
parents ec93cdb38b9e
children 99619772e57c
line wrap: on
line diff
--- a/emeraldtree/ElementTree.py	Sat May 31 16:23:20 2008 +0200
+++ b/emeraldtree/ElementTree.py	Sat May 31 16:25:04 2008 +0200
@@ -887,13 +887,12 @@
             if len(elem):
                 write(">")
                 for e in elem:
-                    if isinstance(e, Node):
-                        _serialize_xml(write, e, encoding, qnames, None)
-                    else:
-                        write(_escape_cdata(unicode(e), encoding))
+                    _serialize_xml(write, e, encoding, qnames, None)
                 write("</" + tag + ">")
             else:
                 write(" />")
+    else:
+        write(_escape_cdata(unicode(elem), encoding))
 
 HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
               "img", "input", "isindex", "link", "meta" "param")