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

Function _write_data

Lib/xml/dom/minidom.py:296–317  ·  view source on GitHub ↗

Writes datachars to writer.

(writer, text, attr)

Source from the content-addressed store, hash-verified

294
295
296def _write_data(writer, text, attr):
297 "Writes datachars to writer."
298 if not text:
299 return
300 # See the comments in ElementTree.py for behavior and
301 # implementation details.
302 if "&" in text:
303 text = text.replace("&", "&")
304 if "<" in text:
305 text = text.replace("<", "&lt;")
306 if ">" in text:
307 text = text.replace(">", "&gt;")
308 if attr:
309 if '"' in text:
310 text = text.replace('"', "&quot;")
311 if "\r" in text:
312 text = text.replace("\r", "&#13;")
313 if "\n" in text:
314 text = text.replace("\n", "&#10;")
315 if "\t" in text:
316 text = text.replace("\t", "&#9;")
317 writer.write(text)
318
319def _get_elements_by_tagName_helper(parent, name, rc):
320 for node in parent.childNodes:

Callers 2

writexmlMethod · 0.85
writexmlMethod · 0.85

Calls 2

replaceMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…