MCPcopy Create free account
hub / github.com/nodejs/node / _Replacement_writexml

Function _Replacement_writexml

tools/gyp/pylib/gyp/xml_fix.py:24–43  ·  view source on GitHub ↗
(self, writer, indent="", addindent="", newl="")

Source from the content-addressed store, hash-verified

22
23
24def _Replacement_writexml(self, writer, indent="", addindent="", newl=""):
25 # indent = current indentation
26 # addindent = indentation to add to higher levels
27 # newl = newline string
28 writer.write(indent + "<" + self.tagName)
29
30 attrs = self._get_attributes()
31 a_names = sorted(attrs.keys())
32
33 for a_name in a_names:
34 writer.write(' %s="' % a_name)
35 _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True)
36 writer.write('"')
37 if self.childNodes:
38 writer.write(">%s" % newl)
39 for node in self.childNodes:
40 node.writexml(writer, indent + addindent, addindent, newl)
41 writer.write(f"{indent}</{self.tagName}>{newl}")
42 else:
43 writer.write("/>%s" % newl)
44
45
46class XmlFix:

Callers

nothing calls this directly

Calls 4

sortedFunction · 0.85
_Replacement_write_dataFunction · 0.85
keysMethod · 0.65
writeMethod · 0.45

Tested by

no test coverage detected