MCPcopy Index your code
hub / github.com/python/cpython / appendChild

Method appendChild

Lib/xml/dom/minidom.py:114–129  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

112 return newChild
113
114 def appendChild(self, node):
115 if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
116 for c in tuple(node.childNodes):
117 self.appendChild(c)
118 ### The DOM does not clearly specify what to return in this case
119 return node
120 if node.nodeType not in self._child_node_types:
121 raise xml.dom.HierarchyRequestErr(
122 "%s cannot be child of %s" % (repr(node), repr(self)))
123 elif node.nodeType in _nodeTypes_with_children:
124 _clear_id_cache(self)
125 if node.parentNode is not None:
126 node.parentNode.removeChild(node)
127 _append_child(self, node)
128 node.nextSibling = None
129 return node
130
131 def replaceChild(self, newChild, oldChild):
132 if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:

Callers 15

insertBeforeMethod · 0.95
constructorMethod · 0.45
_renderSourceMethod · 0.45
constructorMethod · 0.45
pushFrameMethod · 0.45
createStackCloneMethod · 0.45
constructorMethod · 0.45
_updateBarsMethod · 0.45
_createBarRowMethod · 0.45
showImpactEffectMethod · 0.45
_createControlsMethod · 0.45
constructorMethod · 0.45

Calls 3

_clear_id_cacheFunction · 0.85
_append_childFunction · 0.85
removeChildMethod · 0.45

Tested by 15

testAppendChildMethod · 0.36
workMethod · 0.36
testLegalChildrenMethod · 0.36
testNonZeroMethod · 0.36
testGetAttributeNSMethod · 0.36
test_toxml_quote_textMethod · 0.36
testTextReprMethod · 0.36
testNormalizeMethod · 0.36