Package xml :: Package sax :: Module saxutils
[hide private]
[frames] | no frames]

Module saxutils

source code

A library of useful helper classes to the SAX classes, for the convenience of application and driver writers.

Classes [hide private]
  XMLFilterBase
This class is designed to sit between an XMLReader and the client application's event handlers.
  XMLGenerator
Functions [hide private]
 
__dict_replace(s, d)
Replace substrings of a string using a dictionary.
source code
 
escape(data, entities={})
Escape &, <, and > in a string of data.
source code
 
prepare_input_source(source, base='')
This function takes an InputSource and an optional base URL and returns a fully resolved InputSource object ready for reading.
source code
 
quoteattr(data, entities={})
Escape and quote an attribute value.
source code
 
unescape(data, entities={})
Unescape &amp;, &lt;, and &gt; in a string of data.
source code
Variables [hide private]
  _StringTypes = [<type 'str'>, <type 'unicode'>]
  _error_handling = 'xmlcharrefreplace'
Function Details [hide private]

escape(data, entities={})

source code 

Escape &, <, and > in a string of data.

You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value.

quoteattr(data, entities={})

source code 

Escape and quote an attribute value.

Escape &, <, and > in a string of data, then quote it for use as an attribute value. The " character will be escaped as well, if necessary.

You can escape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value.

unescape(data, entities={})

source code 

Unescape &amp;, &lt;, and &gt; in a string of data.

You can unescape other strings of data by passing a dictionary as the optional entities parameter. The keys and values must all be strings; each key will be replaced with its corresponding value.