MCPcopy Create free account
hub / github.com/Singular/Singular / remove_white_space

Function remove_white_space

Singular/dyn_modules/openmath/omxmlreader.py:39–50  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

37 t += c.nodeValue
38 return t
39def remove_white_space(node):
40 remove_list=[]
41 if node.nodeName=="OMC":
42 return
43 for child in node.childNodes:
44 if child.nodeType==dom.Node.TEXT_NODE and not child.data.strip():
45 remove_list.append(child)
46 elif child.hasChildNodes():
47 remove_white_space(child)
48 for node in remove_list:
49 node.parentNode.removeChild(node)
50 node.unlink()
51
52class OMFromXMLBuilder:
53 def buildFromNode(self, node):

Callers 1

buildMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected