gooderp18绿色标准版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

488 lines
26KB

  1. <!DOCTYPE html>
  2. <html lang="en" data-content_root="../">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <meta property="og:title" content="XML Processing Modules" />
  7. <meta property="og:type" content="website" />
  8. <meta property="og:url" content="https://docs.python.org/3/library/xml.html" />
  9. <meta property="og:site_name" content="Python documentation" />
  10. <meta property="og:description" content="Source code: Lib/xml/ Python’s interfaces for processing XML are grouped in the xml package. It is important to note that modules in the xml package require that there be at least one SAX-compliant..." />
  11. <meta property="og:image" content="https://docs.python.org/3/_static/og-image.png" />
  12. <meta property="og:image:alt" content="Python documentation" />
  13. <meta name="description" content="Source code: Lib/xml/ Python’s interfaces for processing XML are grouped in the xml package. It is important to note that modules in the xml package require that there be at least one SAX-compliant..." />
  14. <meta property="og:image:width" content="200" />
  15. <meta property="og:image:height" content="200" />
  16. <meta name="theme-color" content="#3776ab" />
  17. <title>XML Processing Modules &#8212; Python 3.12.3 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
  18. <link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
  19. <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?v=bb723527" />
  20. <link id="pygments_dark_css" media="(prefers-color-scheme: dark)" rel="stylesheet" type="text/css" href="../_static/pygments_dark.css?v=b20cc3f5" />
  21. <script src="../_static/documentation_options.js?v=2c828074"></script>
  22. <script src="../_static/doctools.js?v=888ff710"></script>
  23. <script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
  24. <script src="../_static/sidebar.js"></script>
  25. <link rel="search" type="application/opensearchdescription+xml"
  26. title="Search within Python 3.12.3 documentation"
  27. href="../_static/opensearch.xml"/>
  28. <link rel="author" title="About these documents" href="../about.html" />
  29. <link rel="index" title="Index" href="../genindex.html" />
  30. <link rel="search" title="Search" href="../search.html" />
  31. <link rel="copyright" title="Copyright" href="../copyright.html" />
  32. <link rel="next" title="xml.etree.ElementTree — The ElementTree XML API" href="xml.etree.elementtree.html" />
  33. <link rel="prev" title="html.entities — Definitions of HTML general entities" href="html.entities.html" />
  34. <link rel="canonical" href="https://docs.python.org/3/library/xml.html" />
  35. <style>
  36. @media only screen {
  37. table.full-width-table {
  38. width: 100%;
  39. }
  40. }
  41. </style>
  42. <link rel="stylesheet" href="../_static/pydoctheme_dark.css" media="(prefers-color-scheme: dark)" id="pydoctheme_dark_css">
  43. <link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
  44. <script type="text/javascript" src="../_static/copybutton.js"></script>
  45. <script type="text/javascript" src="../_static/menu.js"></script>
  46. <script type="text/javascript" src="../_static/search-focus.js"></script>
  47. <script type="text/javascript" src="../_static/themetoggle.js"></script>
  48. </head>
  49. <body>
  50. <div class="mobile-nav">
  51. <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
  52. aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
  53. <nav class="nav-content" role="navigation">
  54. <label for="menuToggler" class="toggler__label">
  55. <span></span>
  56. </label>
  57. <span class="nav-items-wrapper">
  58. <a href="https://www.python.org/" class="nav-logo">
  59. <img src="../_static/py.svg" alt="Python logo"/>
  60. </a>
  61. <span class="version_switcher_placeholder"></span>
  62. <form role="search" class="search" action="../search.html" method="get">
  63. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
  64. <path fill-rule="nonzero" fill="currentColor" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"></path>
  65. </svg>
  66. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" />
  67. <input type="submit" value="Go"/>
  68. </form>
  69. </span>
  70. </nav>
  71. <div class="menu-wrapper">
  72. <nav class="menu" role="navigation" aria-label="main navigation">
  73. <div class="language_switcher_placeholder"></div>
  74. <label class="theme-selector-label">
  75. Theme
  76. <select class="theme-selector" oninput="activateTheme(this.value)">
  77. <option value="auto" selected>Auto</option>
  78. <option value="light">Light</option>
  79. <option value="dark">Dark</option>
  80. </select>
  81. </label>
  82. <div>
  83. <h3><a href="../contents.html">Table of Contents</a></h3>
  84. <ul>
  85. <li><a class="reference internal" href="#">XML Processing Modules</a><ul>
  86. <li><a class="reference internal" href="#xml-vulnerabilities">XML vulnerabilities</a></li>
  87. <li><a class="reference internal" href="#the-defusedxml-package">The <code class="xref py py-mod docutils literal notranslate"><span class="pre">defusedxml</span></code> Package</a></li>
  88. </ul>
  89. </li>
  90. </ul>
  91. </div>
  92. <div>
  93. <h4>Previous topic</h4>
  94. <p class="topless"><a href="html.entities.html"
  95. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">html.entities</span></code> — Definitions of HTML general entities</a></p>
  96. </div>
  97. <div>
  98. <h4>Next topic</h4>
  99. <p class="topless"><a href="xml.etree.elementtree.html"
  100. title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> — The ElementTree XML API</a></p>
  101. </div>
  102. <div role="note" aria-label="source link">
  103. <h3>This Page</h3>
  104. <ul class="this-page-menu">
  105. <li><a href="../bugs.html">Report a Bug</a></li>
  106. <li>
  107. <a href="https://github.com/python/cpython/blob/main/Doc/library/xml.rst"
  108. rel="nofollow">Show Source
  109. </a>
  110. </li>
  111. </ul>
  112. </div>
  113. </nav>
  114. </div>
  115. </div>
  116. <div class="related" role="navigation" aria-label="related navigation">
  117. <h3>Navigation</h3>
  118. <ul>
  119. <li class="right" style="margin-right: 10px">
  120. <a href="../genindex.html" title="General Index"
  121. accesskey="I">index</a></li>
  122. <li class="right" >
  123. <a href="../py-modindex.html" title="Python Module Index"
  124. >modules</a> |</li>
  125. <li class="right" >
  126. <a href="xml.etree.elementtree.html" title="xml.etree.ElementTree — The ElementTree XML API"
  127. accesskey="N">next</a> |</li>
  128. <li class="right" >
  129. <a href="html.entities.html" title="html.entities — Definitions of HTML general entities"
  130. accesskey="P">previous</a> |</li>
  131. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  132. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  133. <li class="switchers">
  134. <div class="language_switcher_placeholder"></div>
  135. <div class="version_switcher_placeholder"></div>
  136. </li>
  137. <li>
  138. </li>
  139. <li id="cpython-language-and-version">
  140. <a href="../index.html">3.12.3 Documentation</a> &#187;
  141. </li>
  142. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  143. <li class="nav-item nav-item-2"><a href="markup.html" accesskey="U">Structured Markup Processing Tools</a> &#187;</li>
  144. <li class="nav-item nav-item-this"><a href="">XML Processing Modules</a></li>
  145. <li class="right">
  146. <div class="inline-search" role="search">
  147. <form class="inline-search" action="../search.html" method="get">
  148. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  149. <input type="submit" value="Go" />
  150. </form>
  151. </div>
  152. |
  153. </li>
  154. <li class="right">
  155. <label class="theme-selector-label">
  156. Theme
  157. <select class="theme-selector" oninput="activateTheme(this.value)">
  158. <option value="auto" selected>Auto</option>
  159. <option value="light">Light</option>
  160. <option value="dark">Dark</option>
  161. </select>
  162. </label> |</li>
  163. </ul>
  164. </div>
  165. <div class="document">
  166. <div class="documentwrapper">
  167. <div class="bodywrapper">
  168. <div class="body" role="main">
  169. <section id="module-xml">
  170. <span id="xml-processing-modules"></span><span id="xml"></span><h1>XML Processing Modules<a class="headerlink" href="#module-xml" title="Link to this heading">¶</a></h1>
  171. <p><strong>Source code:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.12/Lib/xml/">Lib/xml/</a></p>
  172. <hr class="docutils" />
  173. <p>Python’s interfaces for processing XML are grouped in the <code class="docutils literal notranslate"><span class="pre">xml</span></code> package.</p>
  174. <div class="admonition warning">
  175. <p class="admonition-title">Warning</p>
  176. <p>The XML modules are not secure against erroneous or maliciously
  177. constructed data. If you need to parse untrusted or
  178. unauthenticated data see the <a class="reference internal" href="#xml-vulnerabilities"><span class="std std-ref">XML vulnerabilities</span></a> and
  179. <a class="reference internal" href="#defusedxml-package"><span class="std std-ref">The defusedxml Package</span></a> sections.</p>
  180. </div>
  181. <p>It is important to note that modules in the <a class="reference internal" href="#module-xml" title="xml: Package containing XML processing modules"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml</span></code></a> package require that
  182. there be at least one SAX-compliant XML parser available. The Expat parser is
  183. included with Python, so the <a class="reference internal" href="pyexpat.html#module-xml.parsers.expat" title="xml.parsers.expat: An interface to the Expat non-validating XML parser."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.parsers.expat</span></code></a> module will always be
  184. available.</p>
  185. <p>The documentation for the <a class="reference internal" href="xml.dom.html#module-xml.dom" title="xml.dom: Document Object Model API for Python."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom</span></code></a> and <a class="reference internal" href="xml.sax.html#module-xml.sax" title="xml.sax: Package containing SAX2 base classes and convenience functions."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.sax</span></code></a> packages are the
  186. definition of the Python bindings for the DOM and SAX interfaces.</p>
  187. <p>The XML handling submodules are:</p>
  188. <ul class="simple">
  189. <li><p><a class="reference internal" href="xml.etree.elementtree.html#module-xml.etree.ElementTree" title="xml.etree.ElementTree: Implementation of the ElementTree API."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code></a>: the ElementTree API, a simple and lightweight
  190. XML processor</p></li>
  191. </ul>
  192. <ul class="simple">
  193. <li><p><a class="reference internal" href="xml.dom.html#module-xml.dom" title="xml.dom: Document Object Model API for Python."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom</span></code></a>: the DOM API definition</p></li>
  194. <li><p><a class="reference internal" href="xml.dom.minidom.html#module-xml.dom.minidom" title="xml.dom.minidom: Minimal Document Object Model (DOM) implementation."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.minidom</span></code></a>: a minimal DOM implementation</p></li>
  195. <li><p><a class="reference internal" href="xml.dom.pulldom.html#module-xml.dom.pulldom" title="xml.dom.pulldom: Support for building partial DOM trees from SAX events."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.pulldom</span></code></a>: support for building partial DOM trees</p></li>
  196. </ul>
  197. <ul class="simple">
  198. <li><p><a class="reference internal" href="xml.sax.html#module-xml.sax" title="xml.sax: Package containing SAX2 base classes and convenience functions."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.sax</span></code></a>: SAX2 base classes and convenience functions</p></li>
  199. <li><p><a class="reference internal" href="pyexpat.html#module-xml.parsers.expat" title="xml.parsers.expat: An interface to the Expat non-validating XML parser."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.parsers.expat</span></code></a>: the Expat parser binding</p></li>
  200. </ul>
  201. <section id="xml-vulnerabilities">
  202. <span id="id1"></span><h2>XML vulnerabilities<a class="headerlink" href="#xml-vulnerabilities" title="Link to this heading">¶</a></h2>
  203. <p>The XML processing modules are not secure against maliciously constructed data.
  204. An attacker can abuse XML features to carry out denial of service attacks,
  205. access local files, generate network connections to other machines, or
  206. circumvent firewalls.</p>
  207. <p>The following table gives an overview of the known attacks and whether
  208. the various modules are vulnerable to them.</p>
  209. <table class="docutils align-default">
  210. <thead>
  211. <tr class="row-odd"><th class="head"><p>kind</p></th>
  212. <th class="head"><p>sax</p></th>
  213. <th class="head"><p>etree</p></th>
  214. <th class="head"><p>minidom</p></th>
  215. <th class="head"><p>pulldom</p></th>
  216. <th class="head"><p>xmlrpc</p></th>
  217. </tr>
  218. </thead>
  219. <tbody>
  220. <tr class="row-even"><td><p>billion laughs</p></td>
  221. <td><p><strong>Vulnerable</strong> (1)</p></td>
  222. <td><p><strong>Vulnerable</strong> (1)</p></td>
  223. <td><p><strong>Vulnerable</strong> (1)</p></td>
  224. <td><p><strong>Vulnerable</strong> (1)</p></td>
  225. <td><p><strong>Vulnerable</strong> (1)</p></td>
  226. </tr>
  227. <tr class="row-odd"><td><p>quadratic blowup</p></td>
  228. <td><p><strong>Vulnerable</strong> (1)</p></td>
  229. <td><p><strong>Vulnerable</strong> (1)</p></td>
  230. <td><p><strong>Vulnerable</strong> (1)</p></td>
  231. <td><p><strong>Vulnerable</strong> (1)</p></td>
  232. <td><p><strong>Vulnerable</strong> (1)</p></td>
  233. </tr>
  234. <tr class="row-even"><td><p>external entity expansion</p></td>
  235. <td><p>Safe (5)</p></td>
  236. <td><p>Safe (2)</p></td>
  237. <td><p>Safe (3)</p></td>
  238. <td><p>Safe (5)</p></td>
  239. <td><p>Safe (4)</p></td>
  240. </tr>
  241. <tr class="row-odd"><td><p><a class="reference external" href="https://en.wikipedia.org/wiki/Document_type_definition">DTD</a> retrieval</p></td>
  242. <td><p>Safe (5)</p></td>
  243. <td><p>Safe</p></td>
  244. <td><p>Safe</p></td>
  245. <td><p>Safe (5)</p></td>
  246. <td><p>Safe</p></td>
  247. </tr>
  248. <tr class="row-even"><td><p>decompression bomb</p></td>
  249. <td><p>Safe</p></td>
  250. <td><p>Safe</p></td>
  251. <td><p>Safe</p></td>
  252. <td><p>Safe</p></td>
  253. <td><p><strong>Vulnerable</strong></p></td>
  254. </tr>
  255. <tr class="row-odd"><td><p>large tokens</p></td>
  256. <td><p><strong>Vulnerable</strong> (6)</p></td>
  257. <td><p><strong>Vulnerable</strong> (6)</p></td>
  258. <td><p><strong>Vulnerable</strong> (6)</p></td>
  259. <td><p><strong>Vulnerable</strong> (6)</p></td>
  260. <td><p><strong>Vulnerable</strong> (6)</p></td>
  261. </tr>
  262. </tbody>
  263. </table>
  264. <ol class="arabic simple">
  265. <li><p>Expat 2.4.1 and newer is not vulnerable to the “billion laughs” and
  266. “quadratic blowup” vulnerabilities. Items still listed as vulnerable due to
  267. potential reliance on system-provided libraries. Check
  268. <code class="xref py py-const docutils literal notranslate"><span class="pre">pyexpat.EXPAT_VERSION</span></code>.</p></li>
  269. <li><p><a class="reference internal" href="xml.etree.elementtree.html#module-xml.etree.ElementTree" title="xml.etree.ElementTree: Implementation of the ElementTree API."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code></a> doesn’t expand external entities and raises a
  270. <a class="reference internal" href="xml.etree.elementtree.html#xml.etree.ElementTree.ParseError" title="xml.etree.ElementTree.ParseError"><code class="xref py py-exc docutils literal notranslate"><span class="pre">ParseError</span></code></a> when an entity occurs.</p></li>
  271. <li><p><a class="reference internal" href="xml.dom.minidom.html#module-xml.dom.minidom" title="xml.dom.minidom: Minimal Document Object Model (DOM) implementation."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.minidom</span></code></a> doesn’t expand external entities and simply returns
  272. the unexpanded entity verbatim.</p></li>
  273. <li><p><a class="reference internal" href="xmlrpc.client.html#module-xmlrpc.client" title="xmlrpc.client: XML-RPC client access."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xmlrpc.client</span></code></a> doesn’t expand external entities and omits them.</p></li>
  274. <li><p>Since Python 3.7.1, external general entities are no longer processed by
  275. default.</p></li>
  276. <li><p>Expat 2.6.0 and newer is not vulnerable to denial of service
  277. through quadratic runtime caused by parsing large tokens.
  278. Items still listed as vulnerable due to
  279. potential reliance on system-provided libraries. Check
  280. <code class="xref py py-const docutils literal notranslate"><span class="pre">pyexpat.EXPAT_VERSION</span></code>.</p></li>
  281. </ol>
  282. <dl class="simple">
  283. <dt>billion laughs / exponential entity expansion</dt><dd><p>The <a class="reference external" href="https://en.wikipedia.org/wiki/Billion_laughs">Billion Laughs</a> attack – also known as exponential entity expansion –
  284. uses multiple levels of nested entities. Each entity refers to another entity
  285. several times, and the final entity definition contains a small string.
  286. The exponential expansion results in several gigabytes of text and
  287. consumes lots of memory and CPU time.</p>
  288. </dd>
  289. <dt>quadratic blowup entity expansion</dt><dd><p>A quadratic blowup attack is similar to a <a class="reference external" href="https://en.wikipedia.org/wiki/Billion_laughs">Billion Laughs</a> attack; it abuses
  290. entity expansion, too. Instead of nested entities it repeats one large entity
  291. with a couple of thousand chars over and over again. The attack isn’t as
  292. efficient as the exponential case but it avoids triggering parser countermeasures
  293. that forbid deeply nested entities.</p>
  294. </dd>
  295. <dt>external entity expansion</dt><dd><p>Entity declarations can contain more than just text for replacement. They can
  296. also point to external resources or local files. The XML
  297. parser accesses the resource and embeds the content into the XML document.</p>
  298. </dd>
  299. <dt><a class="reference external" href="https://en.wikipedia.org/wiki/Document_type_definition">DTD</a> retrieval</dt><dd><p>Some XML libraries like Python’s <a class="reference internal" href="xml.dom.pulldom.html#module-xml.dom.pulldom" title="xml.dom.pulldom: Support for building partial DOM trees from SAX events."><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.pulldom</span></code></a> retrieve document type
  300. definitions from remote or local locations. The feature has similar
  301. implications as the external entity expansion issue.</p>
  302. </dd>
  303. <dt>decompression bomb</dt><dd><p>Decompression bombs (aka <a class="reference external" href="https://en.wikipedia.org/wiki/Zip_bomb">ZIP bomb</a>) apply to all XML libraries
  304. that can parse compressed XML streams such as gzipped HTTP streams or
  305. LZMA-compressed
  306. files. For an attacker it can reduce the amount of transmitted data by three
  307. magnitudes or more.</p>
  308. </dd>
  309. <dt>large tokens</dt><dd><p>Expat needs to re-parse unfinished tokens; without the protection
  310. introduced in Expat 2.6.0, this can lead to quadratic runtime that can
  311. be used to cause denial of service in the application parsing XML.
  312. The issue is known as
  313. <a class="reference external" href="https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-52425">CVE-2023-52425</a>.</p>
  314. </dd>
  315. </dl>
  316. <p>The documentation for <a class="reference external" href="https://pypi.org/project/defusedxml/">defusedxml</a> on PyPI has further information about
  317. all known attack vectors with examples and references.</p>
  318. </section>
  319. <section id="the-defusedxml-package">
  320. <span id="defusedxml-package"></span><h2>The <code class="xref py py-mod docutils literal notranslate"><span class="pre">defusedxml</span></code> Package<a class="headerlink" href="#the-defusedxml-package" title="Link to this heading">¶</a></h2>
  321. <p><a class="reference external" href="https://pypi.org/project/defusedxml/">defusedxml</a> is a pure Python package with modified subclasses of all stdlib
  322. XML parsers that prevent any potentially malicious operation. Use of this
  323. package is recommended for any server code that parses untrusted XML data. The
  324. package also ships with example exploits and extended documentation on more
  325. XML exploits such as XPath injection.</p>
  326. </section>
  327. </section>
  328. <div class="clearer"></div>
  329. </div>
  330. </div>
  331. </div>
  332. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  333. <div class="sphinxsidebarwrapper">
  334. <div>
  335. <h3><a href="../contents.html">Table of Contents</a></h3>
  336. <ul>
  337. <li><a class="reference internal" href="#">XML Processing Modules</a><ul>
  338. <li><a class="reference internal" href="#xml-vulnerabilities">XML vulnerabilities</a></li>
  339. <li><a class="reference internal" href="#the-defusedxml-package">The <code class="xref py py-mod docutils literal notranslate"><span class="pre">defusedxml</span></code> Package</a></li>
  340. </ul>
  341. </li>
  342. </ul>
  343. </div>
  344. <div>
  345. <h4>Previous topic</h4>
  346. <p class="topless"><a href="html.entities.html"
  347. title="previous chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">html.entities</span></code> — Definitions of HTML general entities</a></p>
  348. </div>
  349. <div>
  350. <h4>Next topic</h4>
  351. <p class="topless"><a href="xml.etree.elementtree.html"
  352. title="next chapter"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.etree.ElementTree</span></code> — The ElementTree XML API</a></p>
  353. </div>
  354. <div role="note" aria-label="source link">
  355. <h3>This Page</h3>
  356. <ul class="this-page-menu">
  357. <li><a href="../bugs.html">Report a Bug</a></li>
  358. <li>
  359. <a href="https://github.com/python/cpython/blob/main/Doc/library/xml.rst"
  360. rel="nofollow">Show Source
  361. </a>
  362. </li>
  363. </ul>
  364. </div>
  365. </div>
  366. <div id="sidebarbutton" title="Collapse sidebar">
  367. <span>«</span>
  368. </div>
  369. </div>
  370. <div class="clearer"></div>
  371. </div>
  372. <div class="related" role="navigation" aria-label="related navigation">
  373. <h3>Navigation</h3>
  374. <ul>
  375. <li class="right" style="margin-right: 10px">
  376. <a href="../genindex.html" title="General Index"
  377. >index</a></li>
  378. <li class="right" >
  379. <a href="../py-modindex.html" title="Python Module Index"
  380. >modules</a> |</li>
  381. <li class="right" >
  382. <a href="xml.etree.elementtree.html" title="xml.etree.ElementTree — The ElementTree XML API"
  383. >next</a> |</li>
  384. <li class="right" >
  385. <a href="html.entities.html" title="html.entities — Definitions of HTML general entities"
  386. >previous</a> |</li>
  387. <li><img src="../_static/py.svg" alt="Python logo" style="vertical-align: middle; margin-top: -1px"/></li>
  388. <li><a href="https://www.python.org/">Python</a> &#187;</li>
  389. <li class="switchers">
  390. <div class="language_switcher_placeholder"></div>
  391. <div class="version_switcher_placeholder"></div>
  392. </li>
  393. <li>
  394. </li>
  395. <li id="cpython-language-and-version">
  396. <a href="../index.html">3.12.3 Documentation</a> &#187;
  397. </li>
  398. <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
  399. <li class="nav-item nav-item-2"><a href="markup.html" >Structured Markup Processing Tools</a> &#187;</li>
  400. <li class="nav-item nav-item-this"><a href="">XML Processing Modules</a></li>
  401. <li class="right">
  402. <div class="inline-search" role="search">
  403. <form class="inline-search" action="../search.html" method="get">
  404. <input placeholder="Quick search" aria-label="Quick search" type="search" name="q" id="search-box" />
  405. <input type="submit" value="Go" />
  406. </form>
  407. </div>
  408. |
  409. </li>
  410. <li class="right">
  411. <label class="theme-selector-label">
  412. Theme
  413. <select class="theme-selector" oninput="activateTheme(this.value)">
  414. <option value="auto" selected>Auto</option>
  415. <option value="light">Light</option>
  416. <option value="dark">Dark</option>
  417. </select>
  418. </label> |</li>
  419. </ul>
  420. </div>
  421. <div class="footer">
  422. &copy;
  423. <a href="../copyright.html">
  424. Copyright
  425. </a>
  426. 2001-2024, Python Software Foundation.
  427. <br />
  428. This page is licensed under the Python Software Foundation License Version 2.
  429. <br />
  430. Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
  431. <br />
  432. See <a href="/license.html">History and License</a> for more information.<br />
  433. <br />
  434. The Python Software Foundation is a non-profit corporation.
  435. <a href="https://www.python.org/psf/donations/">Please donate.</a>
  436. <br />
  437. <br />
  438. Last updated on Apr 09, 2024 (13:47 UTC).
  439. <a href="/bugs.html">Found a bug</a>?
  440. <br />
  441. Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6.
  442. </div>
  443. </body>
  444. </html>
上海开阖软件有限公司 沪ICP备12045867号-1