Skip to Content
Python: Essential Reference, Third Edition
book

Python: Essential Reference, Third Edition

by David Beazley
February 2006
Intermediate to advanced content levelIntermediate to advanced
648 pages
14h 53m
English
Sams
Content preview from Python: Essential Reference, Third Edition

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python: Essential Reference

Python: Essential Reference

David M. Beazley

Publisher Resources

ISBN: 0672328623Purchase book