def __todom__(self, doc):
return doc.createTextNode(self)
+class raw(node, unicode):
+ def __todom__(self, doc):
+ raise Exception("Cannot convert raw code to DOM objects")
+
class element(node):
def __init__(self, ns, name, ctx):
self.ns = ns
def text(self, el):
self.quotewrite(el)
+ def rawcode(self, el):
+ self.write(el)
+
def attrval(self, buf):
qc, qt = (u"'", u"'") if u'"' in buf else (u'"', u""")
self.write(qc)
self.element(el)
elif isinstance(el, cons.text):
self.text(el)
+ elif isinstance(el, cons.raw):
+ self.rawcode(el)
else:
raise Exception("Unknown object in element tree: " + el)