source: trunk/essentials/dev-lang/python/Doc/lib/xmlsaxutils.tex@ 3398

Last change on this file since 3398 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 3.4 KB
Line 
1\section{\module{xml.sax.saxutils} ---
2 SAX Utilities}
3
4\declaremodule{standard}{xml.sax.saxutils}
5\modulesynopsis{Convenience functions and classes for use with SAX.}
6\sectionauthor{Martin v. L\"owis}{[email protected]}
7\moduleauthor{Lars Marius Garshol}{[email protected]}
8
9\versionadded{2.0}
10
11
12The module \module{xml.sax.saxutils} contains a number of classes and
13functions that are commonly useful when creating SAX applications,
14either in direct use, or as base classes.
15
16\begin{funcdesc}{escape}{data\optional{, entities}}
17 Escape \character{\&}, \character{<}, and \character{>} in a string
18 of data.
19
20 You can escape other strings of data by passing a dictionary as the
21 optional \var{entities} parameter. The keys and values must all be
22 strings; each key will be replaced with its corresponding value.
23\end{funcdesc}
24
25\begin{funcdesc}{unescape}{data\optional{, entities}}
26 Unescape \character{\&amp;}, \character{\&lt;}, and \character{\&gt;}
27 in a string of data.
28
29 You can unescape other strings of data by passing a dictionary as the
30 optional \var{entities} parameter. The keys and values must all be
31 strings; each key will be replaced with its corresponding value.
32
33 \versionadded{2.3}
34\end{funcdesc}
35
36\begin{funcdesc}{quoteattr}{data\optional{, entities}}
37 Similar to \function{escape()}, but also prepares \var{data} to be
38 used as an attribute value. The return value is a quoted version of
39 \var{data} with any additional required replacements.
40 \function{quoteattr()} will select a quote character based on the
41 content of \var{data}, attempting to avoid encoding any quote
42 characters in the string. If both single- and double-quote