Files
hustoj/web/python-docs/library/xml.dom.pulldom.html
2025-03-09 17:10:56 +08:00

386 lines
28 KiB
HTML

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh_CN">
<head>
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>xml.dom.pulldom --- 支持构建部分 DOM 树 &#8212; Python 3.8.20 文档</title><meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/language_data.js"></script>
<script src="../_static/translations.js"></script>
<script src="../_static/sidebar.js"></script>
<link rel="search" type="application/opensearchdescription+xml"
title="在 Python 3.8.20 文档 中搜索"
href="../_static/opensearch.xml"/>
<link rel="author" title="关于这些文档" href="../about.html" />
<link rel="index" title="索引" href="../genindex.html" />
<link rel="search" title="搜索" href="../search.html" />
<link rel="copyright" title="版权所有" href="../copyright.html" />
<link rel="next" title="xml.sax --- 支持 SAX2 解析器" href="xml.sax.html" />
<link rel="prev" title="xml.dom.minidom --- 最小化的 DOM 实现" href="xml.dom.minidom.html" />
<link rel="canonical" href="https://docs.python.org/3/library/xml.dom.pulldom.html" />
<style>
@media only screen {
table.full-width-table {
width: 100%;
}
}
</style>
<link rel="shortcut icon" type="image/png" href="../_static/py.svg" />
<script type="text/javascript" src="../_static/copybutton.js"></script>
<script type="text/javascript" src="../_static/menu.js"></script>
</head>
<body>
<div class="mobile-nav">
<input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation"
aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" />
<label for="menuToggler" class="toggler__label">
<span></span>
</label>
<nav class="nav-content" role="navigation">
<a href="https://www.python.org/" class="nav-logo">
<img src="../_static/py.svg" alt="Logo"/>
</a>
<div class="version_switcher_placeholder"></div>
<form role="search" class="search" action="../search.html" method="get">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon">
<path fill-rule="nonzero"
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" fill="#444"></path>
</svg>
<input type="text" name="q" aria-label="快速搜索"/>
<input type="submit" value="转向"/>
</form>
</nav>
<div class="menu-wrapper">
<nav class="menu" role="navigation" aria-label="main navigation">
<div class="language_switcher_placeholder"></div>
<h3><a href="../contents.html">目录</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.pulldom</span></code> --- 支持构建部分 DOM 树</a><ul>
<li><a class="reference internal" href="#domeventstream-objects">DOMEventStream 对象</a></li>
</ul>
</li>
</ul>
<h4>上一个主题</h4>
<p class="topless"><a href="xml.dom.minidom.html"
title="上一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.minidom</span></code> --- 最小化的 DOM 实现</a></p>
<h4>下一个主题</h4>
<p class="topless"><a href="xml.sax.html"
title="下一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.sax</span></code> --- 支持 SAX2 解析器</a></p>
<div role="note" aria-label="source link">
<h3>本页</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">报告 Bug</a></li>
<li>
<a href="https://github.com/python/cpython/blob/3.8/Doc/library/xml.dom.pulldom.rst"
rel="nofollow">显示源代码
</a>
</li>
</ul>
</div>
</nav>
</div>
</div>
<div id="outdated-warning" style="padding: .5em; text-align: center; background-color: #FFBABA; color: #6A0E0E;">
这个文档所针对的是一个已不再受支持的 Python 旧版本。
你应当升级版本,并阅读
<a href="/3/library/xml.dom.pulldom.html"> Python 当前稳定版本的文档</a>.
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>导航</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="总目录"
accesskey="I">索引</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python 模块索引"
>模块</a> |</li>
<li class="right" >
<a href="xml.sax.html" title="xml.sax --- 支持 SAX2 解析器"
accesskey="N">下一页</a> |</li>
<li class="right" >
<a href="xml.dom.minidom.html" title="xml.dom.minidom --- 最小化的 DOM 实现"
accesskey="P">上一页</a> |</li>
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> &#187;</li>
<li class="switchers">
<div class="language_switcher_placeholder"></div>
<div class="version_switcher_placeholder"></div>
</li>
<li>
</li>
<li id="cpython-language-and-version">
<a href="../index.html">3.8.20 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python 标准库</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="markup.html" accesskey="U">结构化标记处理工具</a> &#187;</li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
<input type="submit" value="转向" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
|
</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section id="module-xml.dom.pulldom">
<span id="xml-dom-pulldom-support-for-building-partial-dom-trees"></span><h1><a class="reference internal" href="#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> --- 支持构建部分 DOM 树<a class="headerlink" href="#module-xml.dom.pulldom" title="永久链接至标题"></a></h1>
<p><strong>源代码:</strong> <a class="reference external" href="https://github.com/python/cpython/tree/3.8/Lib/xml/dom/pulldom.py">Lib/xml/dom/pulldom.py</a></p>
<hr class="docutils" />
<p><a class="reference internal" href="#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> 模块提供了一个“拉取解析器”,它能在必要时被用于产生文件的可访问 DOM 的片段。 其基本概念包括从输入的 XML 流拉取“事件”并处理它们。 与同样地同时应用了事件驱动处理模型加回调函数的 SAX 不同,拉取解析器的用户要负责显式地从流拉取事件,并循环遍历这些事件直到处理结束或者发生了错误条件。</p>
<div class="admonition warning">
<p class="admonition-title">警告</p>
<p><a class="reference internal" href="#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> 模块对于恶意构建的数据是不安全的。 如果你需要解析不受信任或未经身份验证的数据,请参阅 <a class="reference internal" href="xml.html#xml-vulnerabilities"><span class="std std-ref">XML 漏洞</span></a></p>
</div>
<div class="versionchanged">
<p><span class="versionmodified changed">在 3.7.1 版更改: </span>SAX 解析器默认不再处理一般外部实体以提升在默认情况下的安全性。 要启用外部实体处理,请传入一个自定义的解析器实例:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">xml.dom.pulldom</span> <span class="kn">import</span> <span class="n">parse</span>
<span class="kn">from</span> <span class="nn">xml.sax</span> <span class="kn">import</span> <span class="n">make_parser</span>
<span class="kn">from</span> <span class="nn">xml.sax.handler</span> <span class="kn">import</span> <span class="n">feature_external_ges</span>
<span class="n">parser</span> <span class="o">=</span> <span class="n">make_parser</span><span class="p">()</span>
<span class="n">parser</span><span class="o">.</span><span class="n">setFeature</span><span class="p">(</span><span class="n">feature_external_ges</span><span class="p">,</span> <span class="kc">True</span><span class="p">)</span>
<span class="n">parse</span><span class="p">(</span><span class="n">filename</span><span class="p">,</span> <span class="n">parser</span><span class="o">=</span><span class="n">parser</span><span class="p">)</span>
</pre></div>
</div>
</div>
<p>示例:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">xml.dom</span> <span class="kn">import</span> <span class="n">pulldom</span>
<span class="n">doc</span> <span class="o">=</span> <span class="n">pulldom</span><span class="o">.</span><span class="n">parse</span><span class="p">(</span><span class="s1">&#39;sales_items.xml&#39;</span><span class="p">)</span>
<span class="k">for</span> <span class="n">event</span><span class="p">,</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">doc</span><span class="p">:</span>
<span class="k">if</span> <span class="n">event</span> <span class="o">==</span> <span class="n">pulldom</span><span class="o">.</span><span class="n">START_ELEMENT</span> <span class="ow">and</span> <span class="n">node</span><span class="o">.</span><span class="n">tagName</span> <span class="o">==</span> <span class="s1">&#39;item&#39;</span><span class="p">:</span>
<span class="k">if</span> <span class="nb">int</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">getAttribute</span><span class="p">(</span><span class="s1">&#39;price&#39;</span><span class="p">))</span> <span class="o">&gt;</span> <span class="mi">50</span><span class="p">:</span>
<span class="n">doc</span><span class="o">.</span><span class="n">expandNode</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">toxml</span><span class="p">())</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">event</span></code> 是一个常量,可以取下列值之一:</p>
<ul class="simple">
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">START_ELEMENT</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">END_ELEMENT</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">COMMENT</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">START_DOCUMENT</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">END_DOCUMENT</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">CHARACTERS</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">PROCESSING_INSTRUCTION</span></code></p></li>
<li><p><code class="xref py py-data docutils literal notranslate"><span class="pre">IGNORABLE_WHITESPACE</span></code></p></li>
</ul>
<p><code class="docutils literal notranslate"><span class="pre">node</span></code> 是一个 <code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Document</span></code>, <code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Element</span></code><code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Text</span></code> 类型的对象。</p>
<p>由于文档是被当作“展平”的事件流来处理的,文档“树”会被隐式地遍历并且无论所需元素在树中的深度如何都会被找到。 换句话说,不需要考虑层级问题,例如文档节点的递归搜索等,但是如果元素的内容很重要,则有必要保留一些上下文相关的状态(例如记住任意给定点在文档中的位置)或者使用 <a class="reference internal" href="#xml.dom.pulldom.DOMEventStream.expandNode" title="xml.dom.pulldom.DOMEventStream.expandNode"><code class="xref py py-func docutils literal notranslate"><span class="pre">DOMEventStream.expandNode()</span></code></a> 方法并切换到 DOM 相关的处理过程。</p>
<dl class="class">
<dt id="xml.dom.pulldom.PullDom">
<em class="property">class </em><code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">PullDom</code><span class="sig-paren">(</span><em class="sig-param">documentFactory=None</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.PullDom" title="永久链接至目标"></a></dt>
<dd><p><a class="reference internal" href="xml.sax.handler.html#xml.sax.handler.ContentHandler" title="xml.sax.handler.ContentHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">xml.sax.handler.ContentHandler</span></code></a> 的子类。</p>
</dd></dl>
<dl class="class">
<dt id="xml.dom.pulldom.SAX2DOM">
<em class="property">class </em><code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">SAX2DOM</code><span class="sig-paren">(</span><em class="sig-param">documentFactory=None</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.SAX2DOM" title="永久链接至目标"></a></dt>
<dd><p><a class="reference internal" href="xml.sax.handler.html#xml.sax.handler.ContentHandler" title="xml.sax.handler.ContentHandler"><code class="xref py py-class docutils literal notranslate"><span class="pre">xml.sax.handler.ContentHandler</span></code></a> 的子类。</p>
</dd></dl>
<dl class="function">
<dt id="xml.dom.pulldom.parse">
<code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">parse</code><span class="sig-paren">(</span><em class="sig-param">stream_or_string</em>, <em class="sig-param">parser=None</em>, <em class="sig-param">bufsize=None</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.parse" title="永久链接至目标"></a></dt>
<dd><p>基于给定的输入返回一个 <a class="reference internal" href="#xml.dom.pulldom.DOMEventStream" title="xml.dom.pulldom.DOMEventStream"><code class="xref py py-class docutils literal notranslate"><span class="pre">DOMEventStream</span></code></a><em>stream_or_string</em> 可以是一个文件名,或是一个文件型对象。 <em>parser</em> 如果给出,则必须是一个 <a class="reference internal" href="xml.sax.reader.html#xml.sax.xmlreader.XMLReader" title="xml.sax.xmlreader.XMLReader"><code class="xref py py-class docutils literal notranslate"><span class="pre">XMLReader</span></code></a> 对象。 此函数将改变解析器的文档处理程序并激活命名空间支持;其他解析器配置(例如设置实体解析器)必须在之前已完成。</p>
</dd></dl>
<p>如果你将 XML 存放为字符串形式,则可以改用 <a class="reference internal" href="#xml.dom.pulldom.parseString" title="xml.dom.pulldom.parseString"><code class="xref py py-func docutils literal notranslate"><span class="pre">parseString()</span></code></a> 函数:</p>
<dl class="function">
<dt id="xml.dom.pulldom.parseString">
<code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">parseString</code><span class="sig-paren">(</span><em class="sig-param">string</em>, <em class="sig-param">parser=None</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.parseString" title="永久链接至目标"></a></dt>
<dd><p>返回一个 <a class="reference internal" href="#xml.dom.pulldom.DOMEventStream" title="xml.dom.pulldom.DOMEventStream"><code class="xref py py-class docutils literal notranslate"><span class="pre">DOMEventStream</span></code></a> 来表示 (Unicode) <em>string</em></p>
</dd></dl>
<dl class="data">
<dt id="xml.dom.pulldom.default_bufsize">
<code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">default_bufsize</code><a class="headerlink" href="#xml.dom.pulldom.default_bufsize" title="永久链接至目标"></a></dt>
<dd><p><em>bufsize</em> 形参的默认值设为 <a class="reference internal" href="#xml.dom.pulldom.parse" title="xml.dom.pulldom.parse"><code class="xref py py-func docutils literal notranslate"><span class="pre">parse()</span></code></a></p>
<p>此变量的值可在调用 <a class="reference internal" href="#xml.dom.pulldom.parse" title="xml.dom.pulldom.parse"><code class="xref py py-func docutils literal notranslate"><span class="pre">parse()</span></code></a> 之前修改并使新值生效。</p>
</dd></dl>
<section id="domeventstream-objects">
<span id="id1"></span><h2>DOMEventStream 对象<a class="headerlink" href="#domeventstream-objects" title="永久链接至标题"></a></h2>
<dl class="class">
<dt id="xml.dom.pulldom.DOMEventStream">
<em class="property">class </em><code class="sig-prename descclassname">xml.dom.pulldom.</code><code class="sig-name descname">DOMEventStream</code><span class="sig-paren">(</span><em class="sig-param">stream</em>, <em class="sig-param">parser</em>, <em class="sig-param">bufsize</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.DOMEventStream" title="永久链接至目标"></a></dt>
<dd><div class="deprecated">
<p><span class="versionmodified deprecated">3.8 版后已移除: </span><a class="reference internal" href="../reference/datamodel.html#object.__getitem__" title="object.__getitem__"><code class="xref py py-meth docutils literal notranslate"><span class="pre">序列协议</span></code></a> 的支持已被弃用。</p>
</div>
<dl class="method">
<dt id="xml.dom.pulldom.DOMEventStream.getEvent">
<code class="sig-name descname">getEvent</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.DOMEventStream.getEvent" title="永久链接至目标"></a></dt>
<dd><p>返回一个元组,其中包含 <em>event</em><code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Document</span></code> 形式的当前 <em>node</em> 如果 event 等于 <code class="xref py py-data docutils literal notranslate"><span class="pre">START_DOCUMENT</span></code>,包含 <code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Element</span></code> 如果 event 等于 <code class="xref py py-data docutils literal notranslate"><span class="pre">START_ELEMENT</span></code><code class="xref py py-data docutils literal notranslate"><span class="pre">END_ELEMENT</span></code> 或者 <code class="xref py py-class docutils literal notranslate"><span class="pre">xml.dom.minidom.Text</span></code> 如果 event 等于 <code class="xref py py-data docutils literal notranslate"><span class="pre">CHARACTERS</span></code>。 当前 node 不包含有关其子节点的信息,除非 <a class="reference internal" href="#xml.dom.pulldom.DOMEventStream.expandNode" title="xml.dom.pulldom.DOMEventStream.expandNode"><code class="xref py py-func docutils literal notranslate"><span class="pre">expandNode()</span></code></a> 被调用。</p>
</dd></dl>
<dl class="method">
<dt id="xml.dom.pulldom.DOMEventStream.expandNode">
<code class="sig-name descname">expandNode</code><span class="sig-paren">(</span><em class="sig-param">node</em><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.DOMEventStream.expandNode" title="永久链接至目标"></a></dt>
<dd><p><em>node</em> 的所有子节点扩展到 <em>node</em> 中。 例如:</p>
<div class="highlight-python3 notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">xml.dom</span> <span class="kn">import</span> <span class="n">pulldom</span>
<span class="n">xml</span> <span class="o">=</span> <span class="s1">&#39;&lt;html&gt;&lt;title&gt;Foo&lt;/title&gt; &lt;p&gt;Some text &lt;div&gt;and more&lt;/div&gt;&lt;/p&gt; &lt;/html&gt;&#39;</span>
<span class="n">doc</span> <span class="o">=</span> <span class="n">pulldom</span><span class="o">.</span><span class="n">parseString</span><span class="p">(</span><span class="n">xml</span><span class="p">)</span>
<span class="k">for</span> <span class="n">event</span><span class="p">,</span> <span class="n">node</span> <span class="ow">in</span> <span class="n">doc</span><span class="p">:</span>
<span class="k">if</span> <span class="n">event</span> <span class="o">==</span> <span class="n">pulldom</span><span class="o">.</span><span class="n">START_ELEMENT</span> <span class="ow">and</span> <span class="n">node</span><span class="o">.</span><span class="n">tagName</span> <span class="o">==</span> <span class="s1">&#39;p&#39;</span><span class="p">:</span>
<span class="c1"># Following statement only prints &#39;&lt;p/&gt;&#39;</span>
<span class="nb">print</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">toxml</span><span class="p">())</span>
<span class="n">doc</span><span class="o">.</span><span class="n">expandNode</span><span class="p">(</span><span class="n">node</span><span class="p">)</span>
<span class="c1"># Following statement prints node with all its children &#39;&lt;p&gt;Some text &lt;div&gt;and more&lt;/div&gt;&lt;/p&gt;&#39;</span>
<span class="nb">print</span><span class="p">(</span><span class="n">node</span><span class="o">.</span><span class="n">toxml</span><span class="p">())</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="xml.dom.pulldom.DOMEventStream.reset">
<code class="sig-name descname">reset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#xml.dom.pulldom.DOMEventStream.reset" title="永久链接至目标"></a></dt>
<dd></dd></dl>
</dd></dl>
</section>
</section>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="../contents.html">目录</a></h3>
<ul>
<li><a class="reference internal" href="#"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.pulldom</span></code> --- 支持构建部分 DOM 树</a><ul>
<li><a class="reference internal" href="#domeventstream-objects">DOMEventStream 对象</a></li>
</ul>
</li>
</ul>
<h4>上一个主题</h4>
<p class="topless"><a href="xml.dom.minidom.html"
title="上一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.dom.minidom</span></code> --- 最小化的 DOM 实现</a></p>
<h4>下一个主题</h4>
<p class="topless"><a href="xml.sax.html"
title="下一章"><code class="xref py py-mod docutils literal notranslate"><span class="pre">xml.sax</span></code> --- 支持 SAX2 解析器</a></p>
<div role="note" aria-label="source link">
<h3>本页</h3>
<ul class="this-page-menu">
<li><a href="../bugs.html">报告 Bug</a></li>
<li>
<a href="https://github.com/python/cpython/blob/3.8/Doc/library/xml.dom.pulldom.rst"
rel="nofollow">显示源代码
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>导航</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="总目录"
>索引</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python 模块索引"
>模块</a> |</li>
<li class="right" >
<a href="xml.sax.html" title="xml.sax --- 支持 SAX2 解析器"
>下一页</a> |</li>
<li class="right" >
<a href="xml.dom.minidom.html" title="xml.dom.minidom --- 最小化的 DOM 实现"
>上一页</a> |</li>
<li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li>
<li><a href="https://www.python.org/">Python</a> &#187;</li>
<li class="switchers">
<div class="language_switcher_placeholder"></div>
<div class="version_switcher_placeholder"></div>
</li>
<li>
</li>
<li id="cpython-language-and-version">
<a href="../index.html">3.8.20 Documentation</a> &#187;
</li>
<li class="nav-item nav-item-1"><a href="index.html" >Python 标准库</a> &#187;</li>
<li class="nav-item nav-item-2"><a href="markup.html" >结构化标记处理工具</a> &#187;</li>
<li class="right">
<div class="inline-search" role="search">
<form class="inline-search" action="../search.html" method="get">
<input placeholder="快速搜索" aria-label="快速搜索" type="text" name="q" />
<input type="submit" value="转向" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
|
</li>
</ul>
</div>
<div class="footer">
&copy; <a href="../copyright.html">版权所有</a> 2001-2024, Python Software Foundation.
<br />
This page is licensed under the Python Software Foundation License Version 2.
<br />
Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License.
<br />
<br />
The Python Software Foundation is a non-profit corporation.
<a href="https://www.python.org/psf/donations/">Please donate.</a>
<br />
<br />
最后更新于 12月 09, 2024.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br />
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 2.4.4.
</div>
</body>
</html>