File tree 2 files changed +4
-8
lines changed
2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -28,15 +28,12 @@ def __init__(self, name):
28
28
value - The value of the current node (applies to text nodes and
29
29
comments
30
30
attributes - a dict holding name, value pairs for attributes of the node
31
- childNodes - a list of child nodes of the current node. This must
32
- include all elements but not necessarily other node types
33
31
_flags - A list of miscellaneous flags that can be set on the node
34
32
"""
35
33
self .name = name
36
34
self .parent = None
37
35
self .value = None
38
36
self .attributes = {}
39
- self .childNodes = []
40
37
self ._flags = []
41
38
42
39
def __str__ (self ):
@@ -78,10 +75,7 @@ def reparentChildren(self, newParent):
78
75
This is needed so that trees that don't store text as nodes move the
79
76
text in the correct way
80
77
"""
81
- # XXX - should this method be made more general?
82
- for child in self .childNodes :
83
- newParent .appendChild (child )
84
- self .childNodes = []
78
+ raise NotImplementedError
85
79
86
80
def cloneNode (self ):
87
81
"""Return a shallow copy of the current node i.e. a node with the same
Original file line number Diff line number Diff line change @@ -142,7 +142,9 @@ def reparentChildren(self, newParent):
142
142
if self ._element .text is not None :
143
143
newParent ._element .text += self ._element .text
144
144
self ._element .text = ""
145
- _base .Node .reparentChildren (self , newParent )
145
+ for child in self .childNodes :
146
+ newParent .appendChild (child )
147
+ self .childNodes = []
146
148
147
149
class Comment (Element ):
148
150
def __init__ (self , data ):
You can’t perform that action at this time.
0 commit comments