Fixed node __str__ conversion bug.
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 23 Dec 2012 05:10:06 +0000 (06:10 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 23 Dec 2012 05:10:06 +0000 (06:10 +0100)
wrw/sp/cons.py

index 8366cc7..168f297 100644 (file)
@@ -1,9 +1,7 @@
 import xml.dom.minidom
 
 class node(object):
-    def __str__(self):
-        doc = xml.dom.minidom.Document()
-        return self.__todom__(doc).toxml()
+    pass
 
 class text(node, unicode):
     def __todom__(self, doc):
@@ -36,6 +34,10 @@ class element(node):
             el.appendChild(child.__todom__(doc))
         return el
 
+    def __str__(self):
+        doc = xml.dom.minidom.Document()
+        return self.__todom__(doc).toxml()
+
 class context(object):
     def __init__(self):
         self.nodeconv = {}