March 2003
Intermediate to advanced
656 pages
39h 30m
English
escape
escape(data,entities={})
Returns a copy of string data with
characters <, >, and
& changed into entity references
<, >, and
&. entities is
a dictionary with strings as keys and values; each substring
s of data that
is a key in entities is changed in
escape’s result string into
string
entities
[
s
].
For example, to escape single and double quote characters, in
addition to angle brackets and ampersands, you can call:
xml.sax.saxutils.escape(data,{'"':'"', "'":"'"})