MCPcopy Index your code
hub / github.com/clips/pattern / xml_encode

Function xml_encode

pattern/text/tree.py:1159–1167  ·  view source on GitHub ↗

Returns the string with XML-safe special characters.

(string)

Source from the content-addressed store, hash-verified

1157}
1158
1159def xml_encode(string):
1160 """ Returns the string with XML-safe special characters.
1161 """
1162 string = string.replace("&", "&")
1163 string = string.replace("<", "&lt;")
1164 string = string.replace(">", "&gt;")
1165 string = string.replace("\"","&quot;")
1166 string = string.replace(SLASH, "/")
1167 return string
1168
1169def xml_decode(string):
1170 """ Returns the string with special characters decoded.

Callers 1

parse_xmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…