| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="prev" href="module-xml.sax.xmlreader.html" /> |
| 13 | <link rel="parent" href="markup.html" /> |
| 14 | <link rel="next" href="xml-namespace.html" /> |
| 15 | <meta name='aesop' content='information' /> |
| 16 | <title>13.13 xmllib -- A parser for XML documents</title> |
| 17 | </head> |
| 18 | <body> |
| 19 | <DIV CLASS="navigation"> |
| 20 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 21 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 22 | <tr> |
| 23 | <td class='online-navigation'><a rel="prev" title="13.12.6 The AttributesNS Interface" |
| 24 | href="attributes-ns-objects.html"><img src='../icons/previous.png' |
| 25 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 26 | <td class='online-navigation'><a rel="parent" title="13. Structured Markup Processing" |
| 27 | href="markup.html"><img src='../icons/up.png' |
| 28 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 29 | <td class='online-navigation'><a rel="next" title="13.13.1 XML Namespaces" |
| 30 | href="xml-namespace.html"><img src='../icons/next.png' |
| 31 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 32 | <td align="center" width="100%">Python Library Reference</td> |
| 33 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 34 | href="contents.html"><img src='../icons/contents.png' |
| 35 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 36 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 37 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 38 | <td class='online-navigation'><a rel="index" title="Index" |
| 39 | href="genindex.html"><img src='../icons/index.png' |
| 40 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 41 | </tr></table> |
| 42 | <div class='online-navigation'> |
| 43 | <b class="navlabel">Previous:</b> |
| 44 | <a class="sectref" rel="prev" href="attributes-ns-objects.html">13.12.6 The AttributesNS Interface</A> |
| 45 | <b class="navlabel">Up:</b> |
| 46 | <a class="sectref" rel="parent" href="markup.html">13. Structured Markup Processing</A> |
| 47 | <b class="navlabel">Next:</b> |
| 48 | <a class="sectref" rel="next" href="xml-namespace.html">13.13.1 XML Namespaces</A> |
| 49 | </div> |
| 50 | <hr /></div> |
| 51 | </DIV> |
| 52 | <!--End of Navigation Panel--> |
| 53 | |
| 54 | <H1><A NAME="SECTION00151300000000000000000"> |
| 55 | 13.13 <tt class="module">xmllib</tt> -- |
| 56 | A parser for XML documents</A> |
| 57 | </H1> |
| 58 | |
| 59 | <P> |
| 60 | <A NAME="module-xmllib"></A> |
| 61 | |
| 62 | <P> |
| 63 | <a id='l2h-4588' xml:id='l2h-4588'></a> |
| 64 | |
| 65 | <P> |
| 66 | <div class="versionnote"><b>Deprecated since release 2.0.</b> |
| 67 | Use <tt class="module"><a href="module-xml.sax.html">xml.sax</a></tt> instead. The newer XML |
| 68 | package includes full support for XML 1.0.</div><p></p> |
| 69 | |
| 70 | <P> |
| 71 | |
| 72 | <span class="versionnote">Changed in version 1.5.2: |
| 73 | Added namespace support.</span> |
| 74 | |
| 75 | <P> |
| 76 | This module defines a class <tt class="class">XMLParser</tt> which serves as the basis |
| 77 | for parsing text files formatted in XML (Extensible Markup Language). |
| 78 | |
| 79 | <P> |
| 80 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 81 | <td><nobr><b><span class="typelabel">class</span> <tt id='l2h-4562' xml:id='l2h-4562' class="class">XMLParser</tt></b>(</nobr></td> |
| 82 | <td><var></var>)</td></tr></table></dt> |
| 83 | <dd> |
| 84 | The <tt class="class">XMLParser</tt> class must be instantiated without |
| 85 | arguments.<A NAME="tex2html163" |
| 86 | HREF="#foot66320"><SUP>13.1</SUP></A></dl> |
| 87 | |
| 88 | <P> |
| 89 | This class provides the following interface methods and instance variables: |
| 90 | |
| 91 | <P> |
| 92 | <dl><dt><b><tt id='l2h-4563' xml:id='l2h-4563' class="member">attributes</tt></b></dt> |
| 93 | <dd> |
| 94 | A mapping of element names to mappings. The latter mapping maps |
| 95 | attribute names that are valid for the element to the default value of |
| 96 | the attribute, or if there is no default to <code>None</code>. The default |
| 97 | value is the empty dictionary. This variable is meant to be |
| 98 | overridden, not extended since the default is shared by all instances |
| 99 | of <tt class="class">XMLParser</tt>. |
| 100 | </dl> |
| 101 | |
| 102 | <P> |
| 103 | <dl><dt><b><tt id='l2h-4564' xml:id='l2h-4564' class="member">elements</tt></b></dt> |
| 104 | <dd> |
| 105 | A mapping of element names to tuples. The tuples contain a function |
| 106 | for handling the start and end tag respectively of the element, or |
| 107 | <code>None</code> if the method <tt class="method">unknown_starttag()</tt> or |
| 108 | <tt class="method">unknown_endtag()</tt> is to be called. The default value is the |
| 109 | empty dictionary. This variable is meant to be overridden, not |
| 110 | extended since the default is shared by all instances of |
| 111 | <tt class="class">XMLParser</tt>. |
| 112 | </dl> |
| 113 | |
| 114 | <P> |
| 115 | <dl><dt><b><tt id='l2h-4565' xml:id='l2h-4565' class="member">entitydefs</tt></b></dt> |
| 116 | <dd> |
| 117 | A mapping of entitynames to their values. The default value contains |
| 118 | definitions for <code>'lt'</code>, <code>'gt'</code>, <code>'amp'</code>, <code>'quot'</code>, |
| 119 | and <code>'apos'</code>. |
| 120 | </dl> |
| 121 | |
| 122 | <P> |
| 123 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 124 | <td><nobr><b><tt id='l2h-4566' xml:id='l2h-4566' class="method">reset</tt></b>(</nobr></td> |
| 125 | <td><var></var>)</td></tr></table></dt> |
| 126 | <dd> |
| 127 | Reset the instance. Loses all unprocessed data. This is called |
| 128 | implicitly at the instantiation time. |
| 129 | </dl> |
| 130 | |
| 131 | <P> |
| 132 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 133 | <td><nobr><b><tt id='l2h-4567' xml:id='l2h-4567' class="method">setnomoretags</tt></b>(</nobr></td> |
| 134 | <td><var></var>)</td></tr></table></dt> |
| 135 | <dd> |
| 136 | Stop processing tags. Treat all following input as literal input |
| 137 | (CDATA). |
| 138 | </dl> |
| 139 | |
| 140 | <P> |
| 141 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 142 | <td><nobr><b><tt id='l2h-4568' xml:id='l2h-4568' class="method">setliteral</tt></b>(</nobr></td> |
| 143 | <td><var></var>)</td></tr></table></dt> |
| 144 | <dd> |
| 145 | Enter literal mode (CDATA mode). This mode is automatically exited |
| 146 | when the close tag matching the last unclosed open tag is encountered. |
| 147 | </dl> |
| 148 | |
| 149 | <P> |
| 150 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 151 | <td><nobr><b><tt id='l2h-4569' xml:id='l2h-4569' class="method">feed</tt></b>(</nobr></td> |
| 152 | <td><var>data</var>)</td></tr></table></dt> |
| 153 | <dd> |
| 154 | Feed some text to the parser. It is processed insofar as it consists |
| 155 | of complete tags; incomplete data is buffered until more data is |
| 156 | fed or <tt class="method">close()</tt> is called. |
| 157 | </dl> |
| 158 | |
| 159 | <P> |
| 160 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 161 | <td><nobr><b><tt id='l2h-4570' xml:id='l2h-4570' class="method">close</tt></b>(</nobr></td> |
| 162 | <td><var></var>)</td></tr></table></dt> |
| 163 | <dd> |
| 164 | Force processing of all buffered data as if it were followed by an |
| 165 | end-of-file mark. This method may be redefined by a derived class to |
| 166 | define additional processing at the end of the input, but the |
| 167 | redefined version should always call <tt class="method">close()</tt>. |
| 168 | </dl> |
| 169 | |
| 170 | <P> |
| 171 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 172 | <td><nobr><b><tt id='l2h-4571' xml:id='l2h-4571' class="method">translate_references</tt></b>(</nobr></td> |
| 173 | <td><var>data</var>)</td></tr></table></dt> |
| 174 | <dd> |
| 175 | Translate all entity and character references in <var>data</var> and |
| 176 | return the translated string. |
| 177 | </dl> |
| 178 | |
| 179 | <P> |
| 180 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 181 | <td><nobr><b><tt id='l2h-4572' xml:id='l2h-4572' class="method">getnamespace</tt></b>(</nobr></td> |
| 182 | <td><var></var>)</td></tr></table></dt> |
| 183 | <dd> |
| 184 | Return a mapping of namespace abbreviations to namespace URIs that are |
| 185 | currently in effect. |
| 186 | </dl> |
| 187 | |
| 188 | <P> |
| 189 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 190 | <td><nobr><b><tt id='l2h-4573' xml:id='l2h-4573' class="method">handle_xml</tt></b>(</nobr></td> |
| 191 | <td><var>encoding, standalone</var>)</td></tr></table></dt> |
| 192 | <dd> |
| 193 | This method is called when the "<tt class="samp"><?xml ...?></tt>" tag is processed. |
| 194 | The arguments are the values of the encoding and standalone attributes |
| 195 | in the tag. Both encoding and standalone are optional. The values |
| 196 | passed to <tt class="method">handle_xml()</tt> default to <code>None</code> and the string |
| 197 | <code>'no'</code> respectively. |
| 198 | </dl> |
| 199 | |
| 200 | <P> |
| 201 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 202 | <td><nobr><b><tt id='l2h-4574' xml:id='l2h-4574' class="method">handle_doctype</tt></b>(</nobr></td> |
| 203 | <td><var>tag, pubid, syslit, data</var>)</td></tr></table></dt> |
| 204 | <dd> |
| 205 | This<a id='l2h-4589' xml:id='l2h-4589'></a> method is called when the |
| 206 | "<tt class="samp"><!DOCTYPE...></tt>" declaration is processed. The arguments are the |
| 207 | tag name of the root element, the Formal Public<a id='l2h-4590' xml:id='l2h-4590'></a> Identifier (or <code>None</code> if not specified), the system |
| 208 | identifier, and the uninterpreted contents of the internal DTD subset |
| 209 | as a string (or <code>None</code> if not present). |
| 210 | </dl> |
| 211 | |
| 212 | <P> |
| 213 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 214 | <td><nobr><b><tt id='l2h-4575' xml:id='l2h-4575' class="method">handle_starttag</tt></b>(</nobr></td> |
| 215 | <td><var>tag, method, attributes</var>)</td></tr></table></dt> |
| 216 | <dd> |
| 217 | This method is called to handle start tags for which a start tag |
| 218 | handler is defined in the instance variable <tt class="member">elements</tt>. The |
| 219 | <var>tag</var> argument is the name of the tag, and the |
| 220 | <var>method</var> argument is the function (method) which should be used to |
| 221 | support semantic interpretation of the start tag. The |
| 222 | <var>attributes</var> argument is a dictionary of attributes, the key being |
| 223 | the <var>name</var> and the value being the <var>value</var> of the attribute |
| 224 | found inside the tag's <code><></code> brackets. Character and entity |
| 225 | references in the <var>value</var> have been interpreted. For instance, |
| 226 | for the start tag <code><A HREF="http://www.cwi.nl/"></code>, this method |
| 227 | would be called as <code>handle_starttag('A', self.elements['A'][0], |
| 228 | {'HREF': 'http://www.cwi.nl/'})</code>. The base implementation simply |
| 229 | calls <var>method</var> with <var>attributes</var> as the only argument. |
| 230 | </dl> |
| 231 | |
| 232 | <P> |
| 233 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 234 | <td><nobr><b><tt id='l2h-4576' xml:id='l2h-4576' class="method">handle_endtag</tt></b>(</nobr></td> |
| 235 | <td><var>tag, method</var>)</td></tr></table></dt> |
| 236 | <dd> |
| 237 | This method is called to handle endtags for which an end tag handler |
| 238 | is defined in the instance variable <tt class="member">elements</tt>. The <var>tag</var> |
| 239 | argument is the name of the tag, and the <var>method</var> argument is the |
| 240 | function (method) which should be used to support semantic |
| 241 | interpretation of the end tag. For instance, for the endtag |
| 242 | <code></A></code>, this method would be called as <code>handle_endtag('A', |
| 243 | self.elements['A'][1])</code>. The base implementation simply calls |
| 244 | <var>method</var>. |
| 245 | </dl> |
| 246 | |
| 247 | <P> |
| 248 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 249 | <td><nobr><b><tt id='l2h-4577' xml:id='l2h-4577' class="method">handle_data</tt></b>(</nobr></td> |
| 250 | <td><var>data</var>)</td></tr></table></dt> |
| 251 | <dd> |
| 252 | This method is called to process arbitrary data. It is intended to be |
| 253 | overridden by a derived class; the base class implementation does |
| 254 | nothing. |
| 255 | </dl> |
| 256 | |
| 257 | <P> |
| 258 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 259 | <td><nobr><b><tt id='l2h-4578' xml:id='l2h-4578' class="method">handle_charref</tt></b>(</nobr></td> |
| 260 | <td><var>ref</var>)</td></tr></table></dt> |
| 261 | <dd> |
| 262 | This method is called to process a character reference of the form |
| 263 | "<tt class="samp">&#<var>ref</var>;</tt>". <var>ref</var> can either be a decimal number, |
| 264 | or a hexadecimal number when preceded by an "<tt class="character">x</tt>". |
| 265 | In the base implementation, <var>ref</var> must be a number in the |
| 266 | range 0-255. It translates the character to ASCII and calls the |
| 267 | method <tt class="method">handle_data()</tt> with the character as argument. If |
| 268 | <var>ref</var> is invalid or out of range, the method |
| 269 | <code>unknown_charref(<var>ref</var>)</code> is called to handle the error. A |
| 270 | subclass must override this method to provide support for character |
| 271 | references outside of the ASCII range. |
| 272 | </dl> |
| 273 | |
| 274 | <P> |
| 275 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 276 | <td><nobr><b><tt id='l2h-4579' xml:id='l2h-4579' class="method">handle_comment</tt></b>(</nobr></td> |
| 277 | <td><var>comment</var>)</td></tr></table></dt> |
| 278 | <dd> |
| 279 | This method is called when a comment is encountered. The |
| 280 | <var>comment</var> argument is a string containing the text between the |
| 281 | "<tt class="samp"><!--</tt>" and "<tt class="samp">--></tt>" delimiters, but not the delimiters |
| 282 | themselves. For example, the comment "<tt class="samp"><!--text--></tt>" will |
| 283 | cause this method to be called with the argument <code>'text'</code>. The |
| 284 | default method does nothing. |
| 285 | </dl> |
| 286 | |
| 287 | <P> |
| 288 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 289 | <td><nobr><b><tt id='l2h-4580' xml:id='l2h-4580' class="method">handle_cdata</tt></b>(</nobr></td> |
| 290 | <td><var>data</var>)</td></tr></table></dt> |
| 291 | <dd> |
| 292 | This method is called when a CDATA element is encountered. The |
| 293 | <var>data</var> argument is a string containing the text between the |
| 294 | "<tt class="samp"><![CDATA[</tt>" and "<tt class="samp">]]></tt>" delimiters, but not the delimiters |
| 295 | themselves. For example, the entity "<tt class="samp"><![CDATA[text]]></tt>" will |
| 296 | cause this method to be called with the argument <code>'text'</code>. The |
| 297 | default method does nothing, and is intended to be overridden. |
| 298 | </dl> |
| 299 | |
| 300 | <P> |
| 301 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 302 | <td><nobr><b><tt id='l2h-4581' xml:id='l2h-4581' class="method">handle_proc</tt></b>(</nobr></td> |
| 303 | <td><var>name, data</var>)</td></tr></table></dt> |
| 304 | <dd> |
| 305 | This method is called when a processing instruction (PI) is |
| 306 | encountered. The <var>name</var> is the PI target, and the <var>data</var> |
| 307 | argument is a string containing the text between the PI target and the |
| 308 | closing delimiter, but not the delimiter itself. For example, the |
| 309 | instruction "<tt class="samp"><?XML text?></tt>" will cause this method to be called |
| 310 | with the arguments <code>'XML'</code> and <code>'text'</code>. The default method |
| 311 | does nothing. Note that if a document starts with "<tt class="samp"><?xml |
| 312 | ..?></tt>", <tt class="method">handle_xml()</tt> is called to handle it. |
| 313 | </dl> |
| 314 | |
| 315 | <P> |
| 316 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 317 | <td><nobr><b><tt id='l2h-4582' xml:id='l2h-4582' class="method">handle_special</tt></b>(</nobr></td> |
| 318 | <td><var>data</var>)</td></tr></table></dt> |
| 319 | <dd> |
| 320 | This method is called when a declaration is encountered. The |
| 321 | <var>data</var> argument is a string containing the text between the |
| 322 | "<tt class="samp"><!</tt>" and "<tt class="samp">></tt>" delimiters, but not the delimiters |
| 323 | themselves. For example, the <a id='l2h-4591' xml:id='l2h-4591'></a>entity |
| 324 | declaration "<tt class="samp"><!ENTITY text></tt>" will cause this method to be called |
| 325 | with the argument <code>'ENTITY text'</code>. The default method does |
| 326 | nothing. Note that "<tt class="samp"><!DOCTYPE ...></tt>" is handled separately if it |
| 327 | is located at the start of the document. |
| 328 | </dl> |
| 329 | |
| 330 | <P> |
| 331 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 332 | <td><nobr><b><tt id='l2h-4583' xml:id='l2h-4583' class="method">syntax_error</tt></b>(</nobr></td> |
| 333 | <td><var>message</var>)</td></tr></table></dt> |
| 334 | <dd> |
| 335 | This method is called when a syntax error is encountered. The |
| 336 | <var>message</var> is a description of what was wrong. The default method |
| 337 | raises a <tt class="exception">RuntimeError</tt> exception. If this method is |
| 338 | overridden, it is permissible for it to return. This method is only |
| 339 | called when the error can be recovered from. Unrecoverable errors |
| 340 | raise a <tt class="exception">RuntimeError</tt> without first calling |
| 341 | <tt class="method">syntax_error()</tt>. |
| 342 | </dl> |
| 343 | |
| 344 | <P> |
| 345 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 346 | <td><nobr><b><tt id='l2h-4584' xml:id='l2h-4584' class="method">unknown_starttag</tt></b>(</nobr></td> |
| 347 | <td><var>tag, attributes</var>)</td></tr></table></dt> |
| 348 | <dd> |
| 349 | This method is called to process an unknown start tag. It is intended |
| 350 | to be overridden by a derived class; the base class implementation |
| 351 | does nothing. |
| 352 | </dl> |
| 353 | |
| 354 | <P> |
| 355 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 356 | <td><nobr><b><tt id='l2h-4585' xml:id='l2h-4585' class="method">unknown_endtag</tt></b>(</nobr></td> |
| 357 | <td><var>tag</var>)</td></tr></table></dt> |
| 358 | <dd> |
| 359 | This method is called to process an unknown end tag. It is intended |
| 360 | to be overridden by a derived class; the base class implementation |
| 361 | does nothing. |
| 362 | </dl> |
| 363 | |
| 364 | <P> |
| 365 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 366 | <td><nobr><b><tt id='l2h-4586' xml:id='l2h-4586' class="method">unknown_charref</tt></b>(</nobr></td> |
| 367 | <td><var>ref</var>)</td></tr></table></dt> |
| 368 | <dd> |
| 369 | This method is called to process unresolvable numeric character |
| 370 | references. It is intended to be overridden by a derived class; the |
| 371 | base class implementation does nothing. |
| 372 | </dl> |
| 373 | |
| 374 | <P> |
| 375 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 376 | <td><nobr><b><tt id='l2h-4587' xml:id='l2h-4587' class="method">unknown_entityref</tt></b>(</nobr></td> |
| 377 | <td><var>ref</var>)</td></tr></table></dt> |
| 378 | <dd> |
| 379 | This method is called to process an unknown entity reference. It is |
| 380 | intended to be overridden by a derived class; the base class |
| 381 | implementation calls <tt class="method">syntax_error()</tt> to signal an error. |
| 382 | </dl> |
| 383 | |
| 384 | <P> |
| 385 | <div class="seealso"> |
| 386 | <p class="heading">See Also:</p> |
| 387 | |
| 388 | <dl compact="compact" class="seetitle"> |
| 389 | <dt><em class="citetitle"><a href="http://www.w3.org/TR/REC-xml" |
| 390 | >Extensible Markup Language |
| 391 | (XML) 1.0</a></em></dt> |
| 392 | <dd>The XML specification, published by the World |
| 393 | Wide Web Consortium (W3C), defines the syntax and |
| 394 | processor requirements for XML. References to additional |
| 395 | material on XML, including translations of the |
| 396 | specification, are available at |
| 397 | <a class="url" href="http://www.w3.org/XML/">http://www.w3.org/XML/</a>.</dd> |
| 398 | </dl> |
| 399 | |
| 400 | <P> |
| 401 | <dl compact="compact" class="seetitle"> |
| 402 | <dt><em class="citetitle"><a href="http://www.python.org/topics/xml/" |
| 403 | >Python and XML |
| 404 | Processing</a></em></dt> |
| 405 | <dd>The Python XML Topic Guide provides a great |
| 406 | deal of information on using XML from Python and links to |
| 407 | other sources of information on XML.</dd> |
| 408 | </dl> |
| 409 | |
| 410 | <P> |
| 411 | <dl compact="compact" class="seetitle"> |
| 412 | <dt><em class="citetitle"><a href="http://www.python.org/sigs/xml-sig/" |
| 413 | >SIG for XML |
| 414 | Processing in Python</a></em></dt> |
| 415 | <dd>The Python XML Special Interest |
| 416 | Group is developing substantial support for processing XML |
| 417 | from Python.</dd> |
| 418 | </dl> |
| 419 | </div> |
| 420 | |
| 421 | <P> |
| 422 | <BR><HR><H4>Footnotes</H4> |
| 423 | <DL> |
| 424 | <DT><A NAME="foot66320">... |
| 425 | arguments.</A><A |
| 426 | href="module-xmllib.html#tex2html163"><SUP>13.1</SUP></A></DT> |
| 427 | <DD>Actually, a number of keyword arguments are |
| 428 | recognized which influence the parser to accept certain non-standard |
| 429 | constructs. The following keyword arguments are currently |
| 430 | recognized. The defaults for all of these is <code>0</code> (false) except |
| 431 | for the last one for which the default is <code>1</code> (true). |
| 432 | <var>accept_unquoted_attributes</var> (accept certain attribute values |
| 433 | without requiring quotes), <var>accept_missing_endtag_name</var> (accept |
| 434 | end tags that look like <code></></code>), <var>map_case</var> (map upper case to |
| 435 | lower case in tags and attributes), <var>accept_utf8</var> (allow UTF-8 |
| 436 | characters in input; this is required according to the XML standard, |
| 437 | but Python does not as yet deal properly with these characters, so |
| 438 | this is not the default), <var>translate_attribute_references</var> (don't |
| 439 | attempt to translate character and entity references in attribute values). |
| 440 | |
| 441 | </DD> |
| 442 | </DL> |
| 443 | <p><br /></p><hr class='online-navigation' /> |
| 444 | <div class='online-navigation'> |
| 445 | <!--Table of Child-Links--> |
| 446 | <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></a> |
| 447 | |
| 448 | <UL CLASS="ChildLinks"> |
| 449 | <LI><A href="xml-namespace.html">13.13.1 XML Namespaces</a> |
| 450 | </ul> |
| 451 | <!--End of Table of Child-Links--> |
| 452 | </div> |
| 453 | |
| 454 | <DIV CLASS="navigation"> |
| 455 | <div class='online-navigation'> |
| 456 | <p></p><hr /> |
| 457 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 458 | <tr> |
| 459 | <td class='online-navigation'><a rel="prev" title="13.12.6 The AttributesNS Interface" |
| 460 | href="attributes-ns-objects.html"><img src='../icons/previous.png' |
| 461 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 462 | <td class='online-navigation'><a rel="parent" title="13. Structured Markup Processing" |
| 463 | href="markup.html"><img src='../icons/up.png' |
| 464 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 465 | <td class='online-navigation'><a rel="next" title="13.13.1 XML Namespaces" |
| 466 | href="xml-namespace.html"><img src='../icons/next.png' |
| 467 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 468 | <td align="center" width="100%">Python Library Reference</td> |
| 469 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 470 | href="contents.html"><img src='../icons/contents.png' |
| 471 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 472 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 473 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 474 | <td class='online-navigation'><a rel="index" title="Index" |
| 475 | href="genindex.html"><img src='../icons/index.png' |
| 476 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 477 | </tr></table> |
| 478 | <div class='online-navigation'> |
| 479 | <b class="navlabel">Previous:</b> |
| 480 | <a class="sectref" rel="prev" href="attributes-ns-objects.html">13.12.6 The AttributesNS Interface</A> |
| 481 | <b class="navlabel">Up:</b> |
| 482 | <a class="sectref" rel="parent" href="markup.html">13. Structured Markup Processing</A> |
| 483 | <b class="navlabel">Next:</b> |
| 484 | <a class="sectref" rel="next" href="xml-namespace.html">13.13.1 XML Namespaces</A> |
| 485 | </div> |
| 486 | </div> |
| 487 | <hr /> |
| 488 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 489 | </DIV> |
| 490 | <!--End of Navigation Panel--> |
| 491 | <ADDRESS> |
| 492 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 493 | </ADDRESS> |
| 494 | </BODY> |
| 495 | </HTML> |