O'Reilly logo

Python: Essential Reference, Third Edition by David Beazley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

xml.sax.saxutils

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 ‘&lt;’. entities is an optional dictionary that maps characters to the escape sequences. For example, setting entities to { u’\xf1’ : ‘&ntilde;’ } would replace occurs of ñ with ‘&ntilde;’.

unescape(data [, entities])

Unescapes special escape sequences that appear in data. For instance, ‘&lt;’ 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required