MCPcopy Create free account
hub / github.com/Sigil-Ebook/Sigil / xmlencode

Function xmlencode

src/Resource_Files/python3lib/metadata_utils.py:35–43  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

33
34# encode to make xml safe
35def xmlencode(data):
36 if data is None:
37 return ''
38 newdata = xmldecode(data)
39 newdata = newdata.replace('&', '&')
40 newdata = newdata.replace('<', '&lt;')
41 newdata = newdata.replace('>', '&gt;')
42 newdata = newdata.replace('"', '&quot;')
43 return newdata
44
45#decode xml encoded strings
46def xmldecode(data):

Callers 1

buildxmlFunction · 0.70

Calls 2

replaceMethod · 0.80
xmldecodeFunction · 0.70

Tested by

no test coverage detected