Merge branch 'master' into python3
[wrw.git] / wrw / sp / cons.py
index 99656a3..0c36458 100644 (file)
@@ -59,6 +59,8 @@ class context(object):
         raise Exception("No node conversion known for %s objects" % str(type(ob)))
 
     def addchild(self, node, child):
+        if child is None:
+            return
         node.children.append(self.nodefrom(child))
 
     def addattr(self, node, k, v):
@@ -74,3 +76,9 @@ class constructor(object):
 
     def __getattr__(self, name):
         return self._elcls(self._ns, name, self._ctx)
+
+class doctype(node):
+    def __init__(self, rootname, pubid, dtdid):
+        self.rootname = rootname
+        self.pubid = pubid
+        self.dtdid = dtdid