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

Function buildxml

src/Resource_Files/python3lib/metadata_utils.py:56–71  ·  view source on GitHub ↗
(mentry)

Source from the content-addressed store, hash-verified

54 return newdata
55
56def buildxml(mentry):
57 tname, tcontent, tattr = mentry
58 if tname is None:
59 return ""
60 tag = []
61 tag.append('<' + tname)
62 if tattr is not None:
63 for key in tattr:
64 val = tattr[key]
65 val = xmlencode(val);
66 tag.append(' ' + key + '="'+val+'"' )
67 if tcontent is not None:
68 tag.append('>' + xmlencode(tcontent) + '</' + tname + '>\n')
69 else:
70 tag.append(' />\n')
71 return "".join(tag)
72
73def valid_id(id, idlst):
74 pos = 1

Callers 4

get_other_meta_xmlMethod · 0.90
set_new_metadataFunction · 0.90
get_other_meta_xmlMethod · 0.90
set_new_metadataFunction · 0.90

Calls 2

appendMethod · 0.80
xmlencodeFunction · 0.70

Tested by

no test coverage detected