<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](xml.sax.reader.xhtml "xml.sax.xmlreader --- Interface for XML parsers") | - [上一頁](xml.sax.handler.xhtml "xml.sax.handler --- Base classes for SAX handlers") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [結構化標記處理工具](markup.xhtml) ? - $('.inline-search').show(0); | # [`xml.sax.saxutils`](#module-xml.sax.saxutils "xml.sax.saxutils: Convenience functions and classes for use with SAX.") --- SAX Utilities **Source code:** [Lib/xml/sax/saxutils.py](https://github.com/python/cpython/tree/3.7/Lib/xml/sax/saxutils.py) \[https://github.com/python/cpython/tree/3.7/Lib/xml/sax/saxutils.py\] - - - - - - The module [`xml.sax.saxutils`](#module-xml.sax.saxutils "xml.sax.saxutils: Convenience functions and classes for use with SAX.") contains a number of classes and functions that are commonly useful when creating SAX applications, either in direct use, or as base classes. `xml.sax.saxutils.``escape`(*data*, *entities={}*)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. The characters `'&'`, `'<'` and `'>'` are always escaped, even if *entities* is provided. `xml.sax.saxutils.``unescape`(*data*, *entities={}*)Unescape `'&'`, `'<'`, and `'>'` 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. `'&amp'`, `'<'`, and `'>'`are always unescaped, even if *entities* is provided. `xml.sax.saxutils.``quoteattr`(*data*, *entities={}*)Similar to [`escape()`](#xml.sax.saxutils.escape "xml.sax.saxutils.escape"), but also prepares *data* to be used as an attribute value. The return value is a quoted version of *data* with any additional required replacements. [`quoteattr()`](#xml.sax.saxutils.quoteattr "xml.sax.saxutils.quoteattr") will select a quote character based on the content of *data*, attempting to avoid encoding any quote characters in the string. If both single- and double-quote characters are already in *data*, the double-quote characters will be encoded and *data*will be wrapped in double-quotes. The resulting string can be used directly as an attribute value: ``` >>> print("<element attr=%s>" % quoteattr("ab ' cd \" ef")) <element attr="ab ' cd " ef"> ``` This function is useful when generating attribute values for HTML or any SGML using the reference concrete syntax. *class* `xml.sax.saxutils.``XMLGenerator`(*out=None*, *encoding='iso-8859-1'*, *short\_empty\_elements=False*)This class implements the [`ContentHandler`](xml.sax.handler.xhtml#xml.sax.handler.ContentHandler "xml.sax.handler.ContentHandler") interface by writing SAX events back into an XML document. In other words, using an [`XMLGenerator`](#xml.sax.saxutils.XMLGenerator "xml.sax.saxutils.XMLGenerator")as the content handler will reproduce the original document being parsed. *out*should be a file-like object which will default to *sys.stdout*. *encoding* is the encoding of the output stream which defaults to `'iso-8859-1'`. *short\_empty\_elements* controls the formatting of elements that contain no content: if `False` (the default) they are emitted as a pair of start/end tags, if set to `True` they are emitted as a single self-closed tag. 3\.2 新版功能: The *short\_empty\_elements* parameter. *class* `xml.sax.saxutils.``XMLFilterBase`(*base*)This class is designed to sit between an [`XMLReader`](xml.sax.reader.xhtml#xml.sax.xmlreader.XMLReader "xml.sax.xmlreader.XMLReader") and the client application's event handlers. By default, it does nothing but pass requests up to the reader and events on to the handlers unmodified, but subclasses can override specific methods to modify the event stream or the configuration requests as they pass through. `xml.sax.saxutils.``prepare_input_source`(*source*, *base=''*)This function takes an input source and an optional base URL and returns a fully resolved [`InputSource`](xml.sax.reader.xhtml#xml.sax.xmlreader.InputSource "xml.sax.xmlreader.InputSource") object ready for reading. The input source can be given as a string, a file-like object, or an [`InputSource`](xml.sax.reader.xhtml#xml.sax.xmlreader.InputSource "xml.sax.xmlreader.InputSource") object; parsers will use this function to implement the polymorphic *source* argument to their `parse()` method. ### 導航 - [索引](../genindex.xhtml "總目錄") - [模塊](../py-modindex.xhtml "Python 模塊索引") | - [下一頁](xml.sax.reader.xhtml "xml.sax.xmlreader --- Interface for XML parsers") | - [上一頁](xml.sax.handler.xhtml "xml.sax.handler --- Base classes for SAX handlers") | - ![](https://box.kancloud.cn/a721fc7ec672275e257bbbfde49a4d4e_16x16.png) - [Python](https://www.python.org/) ? - zh\_CN 3.7.3 [文檔](../index.xhtml) ? - [Python 標準庫](index.xhtml) ? - [結構化標記處理工具](markup.xhtml) ? - $('.inline-search').show(0); | ? [版權所有](../copyright.xhtml) 2001-2019, Python Software Foundation. Python 軟件基金會是一個非盈利組織。 [請捐助。](https://www.python.org/psf/donations/) 最后更新于 5月 21, 2019. [發現了問題](../bugs.xhtml)? 使用[Sphinx](http://sphinx.pocoo.org/)1.8.4 創建。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看