Skip to content

Commit

Permalink
Update xml.py
Browse files Browse the repository at this point in the history
  • Loading branch information
futzu authored Nov 20, 2024
1 parent de33006 commit aba8e8d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions threefive/xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit aba8e8d

Please sign in to comment.