diff --git a/threefive/xml.py b/threefive/xml.py index abd5ab7a..1dc380a8 100644 --- a/threefive/xml.py +++ b/threefive/xml.py @@ -127,13 +127,14 @@ class Node: print(ts) """ - def __init__(self, name, value=None, attrs={}): + def __init__(self, name, value=None, attrs={}, ns=None): self.name = name - self.name=name - self.value = escape(value) -## if self.value: -## if isinstance(self.value, str): -## self.value = escape(self.value) + if ns: + self.name = ":".join((ns, name)) + self.value = value + if self.value: + if isinstance(self.value, str): + self.value = escape(self.value) self.attrs = attrs self.children = [] self.depth = 0 @@ -167,7 +168,7 @@ def set_ns(self,obj=None,ns=None,attrns=False): the attributes """ obj = obj.chk_obj(obj) - obj._strip_set_ns(ns) + obj._strip_set_ns(self,ns) if attrns: obj.set_attrns(ns) for child in obj.children: