February 2006
Intermediate to advanced
648 pages
14h 53m
English
The xml.sax.saxutils module defines some utility functions and objects that may be useful when writing SAX-based XML parsers.
escape(data [, entities])Given a string, data, this function replaces certain characters with escape sequences. For example, ‘<’ gets replaced by ‘<’. entities is an optional dictionary that maps characters to the escape sequences. For example, setting entities to { u’\xf1’ : ‘ñ’ } would replace occurs of ñ with ‘ñ’.
unescape(data [, entities])Unescapes special escape sequences that appear in data. For instance, ‘<’ is replaced by ‘<’. entities is an optional dictionary mapping entities to unescaped character values. entities is the inverse of the dictionary used with escape()—for ...