Imported Upstream version 4.6.2 upstream upstream/4.6.2
authorJinWang An <jinwang.an@samsung.com>
Wed, 30 Dec 2020 01:21:20 +0000 (10:21 +0900)
committerJinWang An <jinwang.an@samsung.com>
Wed, 30 Dec 2020 01:21:20 +0000 (10:21 +0900)
77 files changed:
CHANGES.txt
PKG-INFO
doc/FAQ.txt
doc/html/FAQ.html
doc/html/api.html
doc/html/apidoc/_modules/collections/abc.html
doc/html/apidoc/_modules/index.html
doc/html/apidoc/_modules/lxml.html
doc/html/apidoc/_modules/lxml/ElementInclude.html
doc/html/apidoc/_modules/lxml/doctestcompare.html
doc/html/apidoc/_modules/lxml/html.html
doc/html/apidoc/_modules/lxml/html/_diffcommand.html
doc/html/apidoc/_modules/lxml/html/_setmixin.html
doc/html/apidoc/_modules/lxml/html/builder.html
doc/html/apidoc/_modules/lxml/html/formfill.html
doc/html/apidoc/_modules/lxml/isoschematron.html
doc/html/apidoc/genindex.html
doc/html/apidoc/index.html
doc/html/apidoc/lxml.ElementInclude.html
doc/html/apidoc/lxml._elementpath.html
doc/html/apidoc/lxml.builder.html
doc/html/apidoc/lxml.cssselect.html
doc/html/apidoc/lxml.doctestcompare.html
doc/html/apidoc/lxml.etree.html
doc/html/apidoc/lxml.html
doc/html/apidoc/lxml.html.ElementSoup.html
doc/html/apidoc/lxml.html._diffcommand.html
doc/html/apidoc/lxml.html._setmixin.html
doc/html/apidoc/lxml.html.builder.html
doc/html/apidoc/lxml.html.clean.html
doc/html/apidoc/lxml.html.defs.html
doc/html/apidoc/lxml.html.diff.html
doc/html/apidoc/lxml.html.formfill.html
doc/html/apidoc/lxml.html.html
doc/html/apidoc/lxml.html.html5parser.html
doc/html/apidoc/lxml.html.soupparser.html
doc/html/apidoc/lxml.isoschematron.html
doc/html/apidoc/lxml.objectify.html
doc/html/apidoc/lxml.sax.html
doc/html/apidoc/py-modindex.html
doc/html/apidoc/search.html
doc/html/build.html
doc/html/capi.html
doc/html/changes-4.6.1.html [deleted file]
doc/html/changes-4.6.2.html [new file with mode: 0644]
doc/html/compatibility.html
doc/html/credits.html
doc/html/cssselect.html
doc/html/element_classes.html
doc/html/elementsoup.html
doc/html/extensions.html
doc/html/html5parser.html
doc/html/index.html
doc/html/installation.html
doc/html/intro.html
doc/html/lxml-source-howto.html
doc/html/lxmlhtml.html
doc/html/objectify.html
doc/html/parsing.html
doc/html/performance.html
doc/html/resolvers.html
doc/html/sax.html
doc/html/sitemap.html
doc/html/tutorial.html
doc/html/validation.html
doc/html/xpathxslt.html
doc/main.txt
doc/xpathxslt.txt
setup.py
src/lxml.egg-info/PKG-INFO
src/lxml.egg-info/SOURCES.txt
src/lxml/__init__.py
src/lxml/html/clean.c
src/lxml/html/clean.py
src/lxml/html/tests/test_clean.py
src/lxml/html/tests/test_clean.txt
src/lxml/includes/lxml-version.h

index 7afec7e28161967161e1841728b7620b6f1f92fa..e3b77140137bc9d9908de6b462e75a51ff4f2eb5 100644 (file)
@@ -2,6 +2,17 @@
 lxml changelog
 ==============
 
+4.6.2 (2020-11-26)
+==================
+
+Bugs fixed
+----------
+
+* A vulnerability (CVE-2020-27783) was discovered in the HTML Cleaner by Yaniv Nizry,
+  which allowed JavaScript to pass through.  The cleaner now removes more sneaky
+  "style" content.
+
+
 4.6.1 (2020-10-18)
 ==================
 
index d2d538c2b3d0c77e6cd10c37d2e1d94571799f8b..479c5639f76fc63983c7d7f0511fb47c199ec477 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: lxml
-Version: 4.6.1
+Version: 4.6.2
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: https://lxml.de/
 Author: lxml dev team
@@ -38,14 +38,15 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr
         as soon as a maintenance branch has been established.  Note that this
         requires Cython to be installed at an appropriate version for the build.
         
-        4.6.1 (2020-10-18)
+        4.6.2 (2020-11-26)
         ==================
         
         Bugs fixed
         ----------
         
-        * A vulnerability was discovered in the HTML Cleaner by Yaniv Nizry, which allowed
-          JavaScript to pass through.  The cleaner now removes more sneaky "style" content.
+        * A vulnerability (CVE-2020-27783) was discovered in the HTML Cleaner by Yaniv Nizry,
+          which allowed JavaScript to pass through.  The cleaner now removes more sneaky
+          "style" content.
         
         
         
@@ -62,6 +63,7 @@ Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: C
 Classifier: Operating System :: OS Independent
 Classifier: Topic :: Text Processing :: Markup :: HTML
index 02df686252e310fadf69846f3d6c8852a27b8995..24ec8c42e36849b6029b2e8b290bd3c330fb9f02 100644 (file)
@@ -63,6 +63,7 @@ ElementTree_.
      7.2  Why doesn't ``findall()`` support full XPath expressions?
      7.3  How can I find out which namespace prefixes are used in a document?
      7.4  How can I specify a default namespace for XPath expressions?
+     7.5  How can I modify the tree during iteration?
 
 
 The code examples below use the `'lxml.etree`` module:
@@ -1241,3 +1242,38 @@ How can I specify a default namespace for XPath expressions?
 You can't.  In XPath, there is no such thing as a default namespace.  Just use
 an arbitrary prefix and let the namespace dictionary of the XPath evaluators
 map it to your namespace.  See also the question above.
+
+
+How can I modify the tree during iteration?
+-------------------------------------------
+
+lxml's iterators need to hold on to an element in the tree in order to remember
+their current position.  Therefore, tree modifications between two calls into the
+iterator can lead to surprising results if such an element is deleted or moved
+around, for example.
+
+If your code risks modifying elements that the iterator might still need, and
+you know that the number of elements returned by the iterator is small, then just
+read them all into a list (or use ``.findall()``), and iterate over that list.
+
+If the number of elements can be larger and you really want to process the tree
+incrementally, you can often use a read-ahead generator to make the iterator
+advance beyond the critical point before touching the tree structure.
+
+For example:
+
+.. sourcecode:: python
+
+    from itertools import islice
+    from collections import deque
+
+    def readahead(iterator, count=1):
+        iterator = iter(iterator)  # allow iterables as well
+        elements = deque(islice(iterator, 0, count))
+        for element in iterator:
+            elements.append(element)
+            yield elements.popleft()
+        yield from elements
+
+    for element in readahead(root.iterfind("path/to/children")):
+        element.getparent().remove(element)
index 6efc1d9f2f907beb2d76452a3ffa93a6dd55c21f..0f9867b036ddfd146f8bc20974dfe6512300b121 100644 (file)
@@ -26,7 +26,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-faq-frequently-asked-questions">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu current" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml FAQ - Frequently Asked Questions</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu current" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml FAQ - Frequently Asked Questions</h1>
 
 <p>Frequently asked questions on lxml.  See also the notes on <a class="reference external" href="compatibility.html">compatibility</a> to
 <a class="reference external" href="http://effbot.org/zone/element-index.htm">ElementTree</a>.</p>
@@ -92,6 +92,7 @@ function hide_menu() {
 <li><a class="reference internal" href="#why-doesn-t-findall-support-full-xpath-expressions" id="id46">Why doesn't <tt class="docutils literal">findall()</tt> support full XPath expressions?</a></li>
 <li><a class="reference internal" href="#how-can-i-find-out-which-namespace-prefixes-are-used-in-a-document" id="id47">How can I find out which namespace prefixes are used in a document?</a></li>
 <li><a class="reference internal" href="#how-can-i-specify-a-default-namespace-for-xpath-expressions" id="id48">How can I specify a default namespace for XPath expressions?</a></li>
+<li><a class="reference internal" href="#how-can-i-modify-the-tree-during-iteration" id="id49">How can I modify the tree during iteration?</a></li>
 </ul>
 </li>
 </ul>
@@ -1017,11 +1018,39 @@ Element.  Its children will then inherit this prefix for serialization.</p>
 an arbitrary prefix and let the namespace dictionary of the XPath evaluators
 map it to your namespace.  See also the question above.</p>
 </div>
+<div class="section" id="how-can-i-modify-the-tree-during-iteration">
+<h2>How can I modify the tree during iteration?</h2>
+<p>lxml's iterators need to hold on to an element in the tree in order to remember
+their current position.  Therefore, tree modifications between two calls into the
+iterator can lead to surprising results if such an element is deleted or moved
+around, for example.</p>
+<p>If your code risks modifying elements that the iterator might still need, and
+you know that the number of elements returned by the iterator is small, then just
+read them all into a list (or use <tt class="docutils literal">.findall()</tt>), and iterate over that list.</p>
+<p>If the number of elements can be larger and you really want to process the tree
+incrementally, you can often use a read-ahead generator to make the iterator
+advance beyond the critical point before touching the tree structure.</p>
+<p>For example:</p>
+<div class="syntax"><pre><span></span><span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">islice</span>
+<span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">deque</span>
+
+<span class="k">def</span> <span class="nf">readahead</span><span class="p">(</span><span class="n">iterator</span><span class="p">,</span> <span class="n">count</span><span class="o">=</span><span class="mi">1</span><span class="p">):</span>
+    <span class="n">iterator</span> <span class="o">=</span> <span class="nb">iter</span><span class="p">(</span><span class="n">iterator</span><span class="p">)</span>  <span class="c1"># allow iterables as well</span>
+    <span class="n">elements</span> <span class="o">=</span> <span class="n">deque</span><span class="p">(</span><span class="n">islice</span><span class="p">(</span><span class="n">iterator</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">count</span><span class="p">))</span>
+    <span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">iterator</span><span class="p">:</span>
+        <span class="n">elements</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">element</span><span class="p">)</span>
+        <span class="k">yield</span> <span class="n">elements</span><span class="o">.</span><span class="n">popleft</span><span class="p">()</span>
+    <span class="k">yield from</span> <span class="n">elements</span>
+
+<span class="k">for</span> <span class="n">element</span> <span class="ow">in</span> <span class="n">readahead</span><span class="p">(</span><span class="n">root</span><span class="o">.</span><span class="n">iterfind</span><span class="p">(</span><span class="s2">"path/to/children"</span><span class="p">)):</span>
+    <span class="n">element</span><span class="o">.</span><span class="n">getparent</span><span class="p">()</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="n">element</span><span class="p">)</span>
+</pre></div>
+</div>
 </div>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 531f6c0f075f85708fb2f4cdc1ad915d971e17d2..d63b7f4e222f8138d98145550e55aae9036d5c64 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="apis-specific-to-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu current" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">APIs specific to lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu current" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">APIs specific to lxml.etree</h1>
 
 <p>lxml.etree tries to follow established APIs wherever possible.  Sometimes,
 however, the need to expose a feature in an easy way led to the invention of a
@@ -534,7 +534,7 @@ resolvers, you have to stick to the external Python module.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index fbc532abaedead16d9c9a2b08adb8c5a64de31b1..77841937ff0e6f28de22da5f94b222cb0ef48de6 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index b16b0b3df63bd2cc62d9dc3a979ad01c2b3e1cab..8b7ffcc8ed2650cc3039bd86e61c2d4a096f095b 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index fcf30ca74d803406d3aa0d1e985c47fe5018f38d..06405901f2c6151acfc16625048bcf32900384f8 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
   <h1>Source code for lxml</h1><div class="highlight"><pre>
 <span></span><span class="c1"># this is a package</span>
 
-<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;4.6.1&quot;</span>
+<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;4.6.2&quot;</span>
 
 
 <div class="viewcode-block" id="get_include"><a class="viewcode-back" href="../lxml.html#lxml.get_include">[docs]</a><span class="k">def</span> <span class="nf">get_include</span><span class="p">():</span>
index 32ae197bed4558de85e89d0770c9c8a5974fcfa7..1d76824ff034e180f33dbefc1a3937e713201d27 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 49ee57f853b9b20216a36e67716b53169c877443..6db6349b27fc5b25ddc97267b0a7cf08620777dd 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index f84d684ed88d9b735593106ba354c746b6ef1719..966c713c559cc62681a141de35eed59aa5c5c199 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index e6609d249de0ed8c763a3a2dfbca39d27dae4d72..5a9d6b03cc4457c6f923770920603174668bd09a 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index c184515f4b768150d58d11efc38213489e1c76cb..9ddca7cdb02c573634f925b607e7da8ced598852 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index bbdad6f7e22d9009f5e5775b0ba7087f5f154650..a04ddce3a734d96d9e19b0b2d22c9dbd46e7beb6 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index bcec9d35bb303424fb41a82ef140aae6a4cc8289..a7928ac9cea973e3b666be1264dd44c4bf16f338 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 949ae181485b72632874c06d379ea9c2a24d029a..8ebc1b9eb0bb7795279a38352ecc58fde18d535e 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 66f22292df7d80ee0453c64b5ac4458e366c2b93..31098278ce1eaa68457df0d252ab940662972f77 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
       </ul></li>
       <li><a href="lxml.html.clean.html#lxml.html.clean.Cleaner._has_sneaky_javascript">_has_sneaky_javascript() (lxml.html.clean.Cleaner method)</a>
 </li>
-  </ul></td>
-  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="lxml.etree.html#lxml.etree._IDDict">_IDDict (class in lxml.etree)</a>
 </li>
+  </ul></td>
+  <td style="width: 33%; vertical-align: top;"><ul>
       <li><a href="lxml.isoschematron.html#lxml.isoschematron.Schematron._include">_include (lxml.isoschematron.Schematron attribute)</a>
 </li>
       <li><a href="lxml.ElementInclude.html#lxml.ElementInclude._include">_include() (in module lxml.ElementInclude)</a>
       <li><a href="lxml.html.html#lxml.html._looks_like_full_html_unicode">_looks_like_full_html_unicode() (in module lxml.html)</a>
 </li>
       <li><a href="lxml.doctestcompare.html#lxml.doctestcompare.LXMLOutputChecker._looks_like_markup">_looks_like_markup() (lxml.doctestcompare.LXMLOutputChecker method)</a>
+</li>
+      <li><a href="lxml.html.clean.html#lxml.html.clean._looks_like_tag_content">_looks_like_tag_content() (in module lxml.html.clean)</a>
 </li>
       <li><a href="lxml.ElementInclude.html#lxml.ElementInclude._lxml_default_loader">_lxml_default_loader() (in module lxml.ElementInclude)</a>
 </li>
       <li><a href="lxml.etree.html#lxml.etree._ProcessingInstruction">_ProcessingInstruction (class in lxml.etree)</a>
 </li>
       <li><a href="lxml.html.clean.html#lxml.html.clean.Cleaner._remove_javascript_link">_remove_javascript_link() (lxml.html.clean.Cleaner method)</a>
+</li>
+      <li><a href="lxml.html.clean.html#lxml.html.clean._replace_css_import">_replace_css_import() (in module lxml.html.clean)</a>
+</li>
+      <li><a href="lxml.html.clean.html#lxml.html.clean._replace_css_javascript">_replace_css_javascript() (in module lxml.html.clean)</a>
 </li>
       <li><a href="lxml.doctestcompare.html#lxml.doctestcompare._RestoreChecker">_RestoreChecker (class in lxml.doctestcompare)</a>
 </li>
index fc27068358a52337496fc08a7b8dc8f1783f82ef..46aedd2e55fd3ec60ff66710573b1a59d0c8b3ff 100644 (file)
@@ -63,7 +63,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 27a0d21231a5d4b6203934eeb46bebfa01ae5a62..807898b16107fe641898dc16ee51587758657d15 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 61b3fa467d5f960f73d03cf0a10403f86db83206..302a6f355e3c10493d98b8906b31f15d98c56202 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 1c00a13565a690702d57ac61e2ef21ba50a11ff4..5892110f656ed2caddf9650a0b4d903c172ec4df 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index e58059ebaab59112c6f90c0461f6c7509cbfc5fe..43d42297c6c5bedae6ddc962c081b683f6dbc7ec 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 94659d19b66868a07b4ef297a2395097008aa017..c25a0b9b438bdab2ef48baff30466a028a338e55 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 759780b0ae304289d177c7879aa8f623d94fef4a..630787961a8a3870dcf320c7a4d1ebf8be686efa 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 01fe1203464f9d2de44319faae6713677c37a081..0cabb8857570525d5e2b2de9435d1d53c9eca5de 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index bc54af376589433410bbe15e9543a8199dbf8dad..dbb1d447105d21881ad90929215da027e4fbeba7 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 4d5b860291cd9eea8fffff2a63943bda2b8e5817..d05567682bca29407af2a8295f4a2ef6a2c69e58 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index d00d0d9ac764cb813dd99034a164a3f4a1b53b84..460ab1bf775f9fe28eb0ac23300a9885af58af2d 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 0d856179959e4544e0ed9ef3cfc9c934b57fd7b7..44c9a8d01f585f6c1a28d31cfd2c2b90623d5413 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 383117316393ae78846a8ae7b8dfed3575e0db40..b1fe54bc725b7e23fcddbe83ceee92207c78c403 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
@@ -491,6 +491,25 @@ we’ll kill any comments that could be conditional.</p>
 <code class="sig-prename descclassname">lxml.html.clean.</code><code class="sig-name descname">_link_text</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">text</span></em>, <em class="sig-param"><span class="n">link_regexes</span></em>, <em class="sig-param"><span class="n">avoid_hosts</span></em>, <em class="sig-param"><span class="n">factory</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.html.clean._link_text" title="Permalink to this definition">¶</a></dt>
 <dd></dd></dl>
 
+<dl class="py function">
+<dt id="lxml.html.clean._looks_like_tag_content">
+<code class="sig-prename descclassname">lxml.html.clean.</code><code class="sig-name descname">_looks_like_tag_content</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">string</span></em>, <em class="sig-param"><span class="n">pos</span><span class="o">=</span><span class="default_value">0</span></em>, <em class="sig-param"><span class="n">endpos</span><span class="o">=</span><span class="default_value">9223372036854775807</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.html.clean._looks_like_tag_content" title="Permalink to this definition">¶</a></dt>
+<dd><p>Scan through string looking for a match, and return a corresponding match object instance.</p>
+<p>Return None if no position in the string matches.</p>
+</dd></dl>
+
+<dl class="py function">
+<dt id="lxml.html.clean._replace_css_import">
+<code class="sig-prename descclassname">lxml.html.clean.</code><code class="sig-name descname">_replace_css_import</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repl</span></em>, <em class="sig-param"><span class="n">string</span></em>, <em class="sig-param"><span class="n">count</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.html.clean._replace_css_import" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
+</dd></dl>
+
+<dl class="py function">
+<dt id="lxml.html.clean._replace_css_javascript">
+<code class="sig-prename descclassname">lxml.html.clean.</code><code class="sig-name descname">_replace_css_javascript</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repl</span></em>, <em class="sig-param"><span class="n">string</span></em>, <em class="sig-param"><span class="n">count</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.html.clean._replace_css_javascript" title="Permalink to this definition">¶</a></dt>
+<dd><p>Return the string obtained by replacing the leftmost non-overlapping occurrences of pattern in string by the replacement repl.</p>
+</dd></dl>
+
 <dl class="py function">
 <dt id="lxml.html.clean._substitute_whitespace">
 <code class="sig-prename descclassname">lxml.html.clean.</code><code class="sig-name descname">_substitute_whitespace</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">repl</span></em>, <em class="sig-param"><span class="n">string</span></em>, <em class="sig-param"><span class="n">count</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.html.clean._substitute_whitespace" title="Permalink to this definition">¶</a></dt>
index 9c8bf18387d400fd53c14f6b9afe000506e3a977..a71c10e0e70638e4c58274472993fed66054ca40 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index b51a1f8e6ead19fc0670449af56a6e1af59799be..b4202d0fe9b704941f1a8e2350e8bae03e4f4e2b 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 933e7cf5c8ccccb124802c90ec1e13e1fd1a74cb..96d1810443f82e6f17500608499bba7e43c9a00b 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index e55e59a18e7e33409ae3a61f0622da975dc29733..58733c0c66fa0dce0a034138aa8740649c6262b6 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 38b19bf4409450164e657ca6f16d2dff7fd40e8a..53791f96e4e47e95c544bdca2710df2185891a5c 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index acf6c848f0cd7627684dedac4b226cee0761a98a..3a45aaa6f11a9fc67420868bb1293c0a87344749 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 61b08fb1df7c6150b04b1338ad894619cfefd61a..ff2a05be1910bb2a31bcf01c9a9ee3fe3aaffd76 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 797b0a3b41d57ea145fa95eb398c3c537a53bccf..7c957314a951ffae132f700246381b30a06c9f38 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 2b191f70df0da9bef7b3cf9854b1fe07c2ff20ff..8fb41637ff798e1e8447ca1d1c13fb77cbb6881b 100644 (file)
@@ -63,7 +63,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index 347a7148591f27184b3b675a62c2fe09a6fbbd8e..75cf09af2d013c3561b8fcb2a93669c33a31a262 100644 (file)
@@ -65,7 +65,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index aabfb4843bb08ddca5ef7353cc4a6ccec47f2fba..c119ba29aa119a03ae62deab60bd691ede412ad0 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.1
+                4.6.2
               </div>
             
           
index f30cc55ceef523ea6acfbccc2ebdd8ea1f39c159..86ff549575071fc5260ccd96addeb25ff97060f2 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="how-to-build-lxml-from-source">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu current" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">How to build lxml from source</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu current" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">How to build lxml from source</h1>
 
 <p>To build lxml from source, you need libxml2 and libxslt properly
 installed, <em>including the header files</em>.  These are likely shipped in
@@ -317,7 +317,7 @@ installed using <tt class="docutils literal">dpkg <span class="pre">-i</span></t
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 9f5161e78932133372cc67669fb65328bb5808e0..79e15eb50ffcd04578fb47507969238b6b0a4ccf 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="the-public-c-api-of-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu current" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">The public C-API of lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu current" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">The public C-API of lxml.etree</h1>
 
 <p>As of version 1.1, lxml.etree provides a public C-API.  This allows external
 C extensions to efficiently access public functions and classes of lxml,
@@ -133,7 +133,7 @@ includes may not be sufficient.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
diff --git a/doc/html/changes-4.6.1.html b/doc/html/changes-4.6.1.html
deleted file mode 100644 (file)
index f64c936..0000000
+++ /dev/null
@@ -1,3690 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
-<title>lxml changelog</title>
-<link rel="stylesheet" href="style.css" type="text/css" />
-</head>
-<body>
-<div class="document" id="lxml-changelog">
-<h1 class="title">lxml changelog</h1>
-
-<div class="section" id="id1">
-<h1>4.6.1 (2020-10-18)</h1>
-<div class="section" id="bugs-fixed">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>A vulnerability was discovered in the HTML Cleaner by Yaniv Nizry, which allowed
-JavaScript to pass through.  The cleaner now removes more sneaky &quot;style&quot; content.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id2">
-<h1>4.6.0 (2020-10-17)</h1>
-<div class="section" id="features-added">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/310">GH#310</a>: <tt class="docutils literal">lxml.html.InputGetter</tt> supports <tt class="docutils literal">__len__()</tt> to count the number of input fields.
-Patch by Aidan Woolley.</li>
-<li><tt class="docutils literal">lxml.html.InputGetter</tt> has a new <tt class="docutils literal">.items()</tt> method to ease processing all input fields.</li>
-<li><tt class="docutils literal">lxml.html.InputGetter.keys()</tt> now returns the field names in document order.</li>
-<li>GH-309: The API documentation is now generated using <tt class="docutils literal"><span class="pre">sphinx-apidoc</span></tt>.
-Patch by Chris Mayo.</li>
-</ul>
-</div>
-<div class="section" id="id3">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1869455">LP#1869455</a>: C14N 2.0 serialisation failed for unprefixed attributes
-when a default namespace was defined.</li>
-<li><tt class="docutils literal">TreeBuilder.close()</tt> raised <tt class="docutils literal">AssertionError</tt> in some error cases where it
-should have raised <tt class="docutils literal">XMLSyntaxError</tt>.  It now raises a combined exception to
-keep up backwards compatibility, while switching to <tt class="docutils literal">XMLSyntaxError</tt> as an
-interface.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id4">
-<h1>4.5.2 (2020-07-09)</h1>
-<div class="section" id="id5">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">Cleaner()</tt> now validates that only known configuration options can be set.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1882606">LP#1882606</a>: <tt class="docutils literal">Cleaner.clean_html()</tt> discarded comments and PIs regardless of the
-corresponding configuration option, if <tt class="docutils literal">remove_unknown_tags</tt> was set.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1880251">LP#1880251</a>: Instead of globally overwriting the document loader in libxml2, lxml now
-sets it per parser run, which improves the interoperability with other users of libxml2
-such as libxmlsec.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1881960">LP#1881960</a>: Fix build in CPython 3.10 by using Cython 0.29.21.</li>
-<li>The setup options &quot;--with-xml2-config&quot; and &quot;--with-xslt-config&quot; were accidentally renamed
-to &quot;--xml2-config&quot; and &quot;--xslt-config&quot; in 4.5.1 and are now available again.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id6">
-<h1>4.5.1 (2020-05-19)</h1>
-<div class="section" id="id7">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1570388">LP#1570388</a>: Fix failures when serialising documents larger than 2GB in some cases.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1865141">LP#1865141</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/298">GH#298</a>: <tt class="docutils literal">QName</tt> values were not accepted by the <tt class="docutils literal">el.iter()</tt> method.
-Patch by xmo-odoo.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1863413">LP#1863413</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/297">GH#297</a>: The build failed to detect libraries on Linux that are only
-configured via pkg-config.
-Patch by Hugh McMaster.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id8">
-<h1>4.5.0 (2020-01-29)</h1>
-<div class="section" id="id9">
-<h2>Features added</h2>
-<ul class="simple">
-<li>A new function <tt class="docutils literal">indent()</tt> was added to insert tail whitespace for pretty-printing
-an XML tree.</li>
-</ul>
-</div>
-<div class="section" id="id10">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1857794">LP#1857794</a>: Tail text of nodes that get removed from a document using item
-deletion disappeared silently instead of sticking with the node that was removed.</li>
-</ul>
-</div>
-<div class="section" id="other-changes">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>MacOS builds are 64-bit-only by default.
-Set CFLAGS and LDFLAGS explicitly to override it.</li>
-<li>Linux/MacOS Binary wheels now use libxml2 2.9.10 and libxslt 1.1.34.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1840234">LP#1840234</a>: The package version number is now available as <tt class="docutils literal">lxml.__version__</tt>.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id11">
-<h1>4.4.3 (2020-01-28)</h1>
-<div class="section" id="id12">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1844674">LP#1844674</a>: <tt class="docutils literal">itertext()</tt> was missing tail text of comments and PIs since 4.4.0.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id13">
-<h1>4.4.2 (2019-11-25)</h1>
-<div class="section" id="id14">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1835708">LP#1835708</a>: <tt class="docutils literal">ElementInclude</tt> incorrectly rejected repeated non-recursive
-includes as recursive.
-Patch by Rainer Hausdorf.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id15">
-<h1>4.4.1 (2019-08-11)</h1>
-<div class="section" id="id16">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1838252">LP#1838252</a>: The order of an OrderedDict was lost in 4.4.0 when passing it as
-attrib mapping during element creation.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1838521">LP#1838521</a>: The package metadata now lists the supported Python versions.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id17">
-<h1>4.4.0 (2019-07-27)</h1>
-<div class="section" id="id18">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">Element.clear()</tt> accepts a new keyword argument <tt class="docutils literal">keep_tail=True</tt> to clear
-everything but the tail text.  This is helpful in some document-style use cases
-and for clearing the current element in <tt class="docutils literal">iterparse()</tt> and pull parsing.</li>
-<li>When creating attributes or namespaces from a dict in Python 3.6+, lxml now
-preserves the original insertion order of that dict, instead of always sorting
-the items by name.  A similar change was made for ElementTree in CPython 3.8.
-See <a class="reference external" href="https://bugs.python.org/issue34160">https://bugs.python.org/issue34160</a></li>
-<li>Integer elements in <tt class="docutils literal">lxml.objectify</tt> implement the <tt class="docutils literal">__index__()</tt> special method.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/269">GH#269</a>: Read-only elements in XSLT were missing the <tt class="docutils literal">nsmap</tt> property.
-Original patch by Jan Pazdziora.</li>
-<li>ElementInclude can now restrict the maximum inclusion depth via a <tt class="docutils literal">max_depth</tt>
-argument to prevent content explosion.  It is limited to 6 by default.</li>
-<li>The <tt class="docutils literal">target</tt> object of the XMLParser can have <tt class="docutils literal">start_ns()</tt> and <tt class="docutils literal">end_ns()</tt>
-callback methods to listen to namespace declarations.</li>
-<li>The <tt class="docutils literal">TreeBuilder</tt> has new arguments <tt class="docutils literal">comment_factory</tt> and <tt class="docutils literal">pi_factory</tt> to
-pass factories for creating comments and processing instructions, as well as
-flag arguments <tt class="docutils literal">insert_comments</tt> and <tt class="docutils literal">insert_pis</tt> to discard them from the
-tree when set to false.</li>
-<li>A <a class="reference external" href="https://www.w3.org/TR/xml-c14n2/">C14N 2.0</a> implementation was added as
-<tt class="docutils literal">etree.canonicalize()</tt>, a corresponding <tt class="docutils literal">C14NWriterTarget</tt> class, and
-a <tt class="docutils literal">c14n2</tt> serialisation method.</li>
-</ul>
-</div>
-<div class="section" id="id19">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When writing to file paths that contain the URL escape character '%', the file
-path could wrongly be mangled by URL unescaping and thus write to a different
-file or directory.  Code that writes to file paths that are provided by untrusted
-sources, but that must work with previous versions of lxml, should best either
-reject paths that contain '%' characters, or otherwise make sure that the path
-does not contain maliciously injected '%XX' URL hex escapes for paths like '../'.</li>
-<li>Assigning to Element child slices with negative step could insert the slice at
-the wrong position, starting too far on the left.</li>
-<li>Assigning to Element child slices with overly large step size could take very
-long, regardless of the length of the actual slice.</li>
-<li>Assigning to Element child slices of the wrong size could sometimes fail to
-raise a ValueError (like a list assignment would) and instead assign outside
-of the original slice bounds or leave parts of it unreplaced.</li>
-<li>The <tt class="docutils literal">comment</tt> and <tt class="docutils literal">pi</tt> events in <tt class="docutils literal">iterwalk()</tt> were never triggered, and
-instead, comments and processing instructions in the tree were reported as
-<tt class="docutils literal">start</tt> elements.  Also, when walking an ElementTree (as opposed to its root
-element), comments and PIs outside of the root element are now reported.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1827833">LP#1827833</a>: The RelaxNG compact syntax support was broken with recent versions
-of <tt class="docutils literal">rnc2rng</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1758553">LP#1758553</a>: The HTML elements <tt class="docutils literal">source</tt> and <tt class="docutils literal">track</tt> were added to the list
-of empty tags in <tt class="docutils literal">lxml.html.defs</tt>.</li>
-<li>Registering a prefix other than &quot;xml&quot; for the XML namespace is now rejected.</li>
-<li>Failing to write XSLT output to a file could raise a misleading exception.
-It now raises <tt class="docutils literal">IOError</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id20">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Support for Python 3.4 was removed.</li>
-<li>When using <tt class="docutils literal"><span class="pre">Element.find*()</span></tt> with prefix-namespace mappings, the empty string
-is now accepted to define a default namespace, in addition to the previously
-supported <tt class="docutils literal">None</tt> prefix.  Empty strings are more convenient since they keep
-all prefix keys in a namespace dict strings, which simplifies sorting etc.</li>
-<li>The <tt class="docutils literal">ElementTree.write_c14n()</tt> method has been deprecated in favour of the
-long preferred <tt class="docutils literal">ElementTree.write(f, <span class="pre">method=&quot;c14n&quot;)</span></tt>.  It will be removed
-in a future release.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id21">
-<h1>4.3.5 (2019-07-27)</h1>
-<ul class="simple">
-<li>Rebuilt with Cython 0.29.13 to support Python 3.8.</li>
-</ul>
-</div>
-<div class="section" id="id22">
-<h1>4.3.4 (2019-06-10)</h1>
-<ul class="simple">
-<li>Rebuilt with Cython 0.29.10 to support Python 3.8.</li>
-</ul>
-</div>
-<div class="section" id="id23">
-<h1>4.3.3 (2019-03-26)</h1>
-<div class="section" id="id24">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix leak of output buffer and unclosed files in <tt class="docutils literal">_XSLTResultTree.write_output()</tt>.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id25">
-<h1>4.3.2 (2019-02-29)</h1>
-<div class="section" id="id26">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in 4.3.1 when appending a child subtree with certain text nodes.</li>
-</ul>
-</div>
-<div class="section" id="id27">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Built with Cython 0.29.6.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id28">
-<h1>4.3.1 (2019-02-08)</h1>
-<div class="section" id="id29">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1814522">LP#1814522</a>: Crash when appending a child subtree that contains unsubstituted
-entity references.</li>
-</ul>
-</div>
-<div class="section" id="id30">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Built with Cython 0.29.5.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id31">
-<h1>4.3.0 (2019-01-04)</h1>
-<div class="section" id="id32">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The module <tt class="docutils literal">lxml.sax</tt> is compiled using Cython in order to speed it up.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/267">GH#267</a>: <tt class="docutils literal">lxml.sax.ElementTreeProducer</tt> now preserves the namespace prefixes.
-If two prefixes point to the same URI, the first prefix in alphabetical order
-is used.  Patch by Lennart Regebro.</li>
-<li>Updated ISO-Schematron implementation to 2013 version (now MIT licensed)
-and the corresponding schema to the 2016 version (with optional &quot;properties&quot;).</li>
-</ul>
-</div>
-<div class="section" id="id33">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/270">GH#270</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/271">GH#271</a>: Support for Python 2.6 and 3.3 was removed.
-Patch by hugovk.</li>
-<li>The minimum dependency versions were raised to libxml2 2.9.2 and libxslt 1.1.27,
-which were released in 2014 and 2012 respectively.</li>
-<li>Built with Cython 0.29.2.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id34">
-<h1>4.2.6 (2019-01-02)</h1>
-<div class="section" id="id35">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1799755">LP#1799755</a>: Fix a DeprecationWarning in Py3.7+.</li>
-<li>Import warnings in Python 3.6+ were resolved.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id36">
-<h1>4.2.5 (2018-09-09)</h1>
-<div class="section" id="id37">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Javascript URLs that used URL escaping were not removed by the HTML cleaner.
-Security problem found by Omar Eissa.  (CVE-2018-19787)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id38">
-<h1>4.2.4 (2018-08-03)</h1>
-<div class="section" id="id39">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/259">GH#259</a>: Allow using <tt class="docutils literal"><span class="pre">pkg-config</span></tt> for build configuration.
-Patch by Patrick Griffis.</li>
-</ul>
-</div>
-<div class="section" id="id40">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1773749">LP#1773749</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/268">GH#268</a>: Crash when moving an element to another document with
-<tt class="docutils literal">Element.insert()</tt>.
-Patch by Alexander Weggerle.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id41">
-<h1>4.2.3 (2018-06-27)</h1>
-<div class="section" id="id42">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Reverted <a class="reference external" href="https://github.com/lxml/lxml/issues/265">GH#265</a>: lxml links against zlib as a shared library again.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id43">
-<h1>4.2.2 (2018-06-22)</h1>
-<div class="section" id="id44">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/266">GH#266</a>: Fix sporadic crash during GC when parse-time schema validation is used
-and the parser participates in a reference cycle.
-Original patch by Julien Greard.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/265">GH#265</a>: lxml no longer links against zlib as a shared library, only on static builds.
-Patch by Nehal J Wani.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id46">
-<h1>4.2.1 (2018-03-21)</h1>
-<div class="section" id="id47">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1755825">LP#1755825</a>: <tt class="docutils literal">iterwalk()</tt> failed to return the 'start' event for the initial
-element if a tag selector is used.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1756314">LP#1756314</a>: Failure to import 4.2.0 into PyPy due to a missing library symbol.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1727864">LP#1727864</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/258">GH#258</a>: Add &quot;-isysroot&quot; linker option on MacOS as needed by XCode 9.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id48">
-<h1>4.2.0 (2018-03-13)</h1>
-<div class="section" id="id49">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/255">GH#255</a>: <tt class="docutils literal">SelectElement.value</tt> returns more standard-compliant and
-browser-like defaults for non-multi-selects.  If no option is selected, the
-value of the first option is returned (instead of None).  If multiple options
-are selected, the value of the last one is returned (instead of that of the
-first one).  If no options are present (not standard-compliant)
-<tt class="docutils literal">SelectElement.value</tt> still returns <tt class="docutils literal">None</tt>.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/261">GH#261</a>: The <tt class="docutils literal">HTMLParser()</tt> now supports the <tt class="docutils literal">huge_tree</tt> option.
-Patch by stranac.</li>
-</ul>
-</div>
-<div class="section" id="id50">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Some XSLT messages were not captured by the transform error log.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1737825">LP#1737825</a>: Crash at shutdown after an interrupted iterparse run with XMLSchema
-validation.</li>
-</ul>
-</div>
-<div class="section" id="id51">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id52">
-<h1>4.1.1 (2017-11-04)</h1>
-<ul class="simple">
-<li>Rebuild with Cython 0.27.3 to improve support for Py3.7.</li>
-</ul>
-</div>
-<div class="section" id="id53">
-<h1>4.1.0 (2017-10-13)</h1>
-<div class="section" id="id54">
-<h2>Features added</h2>
-<ul class="simple">
-<li>ElementPath supports text predicates for current node, like &quot;[.='text']&quot;.</li>
-<li>ElementPath allows spaces in predicates.</li>
-<li>Custom Element classes and XPath functions can now be registered with a
-decorator rather than explicit dict assignments.</li>
-<li>Static Linux wheels are now built with link time optimisation (LTO) enabled.
-This should have a beneficial impact on the overall performance by providing
-a tighter compiler integration between lxml and libxml2/libxslt.</li>
-</ul>
-</div>
-<div class="section" id="id55">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1722776">LP#1722776</a>: Requesting non-Element objects like comments from a document with
-<tt class="docutils literal">PythonElementClassLookup</tt> could fail with a TypeError.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id56">
-<h1>4.0.0 (2017-09-17)</h1>
-<div class="section" id="id57">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The ElementPath implementation is now compiled using Cython,
-which speeds up the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods quite significantly.</li>
-<li>The modules <tt class="docutils literal">lxml.builder</tt>, <tt class="docutils literal">lxml.html.diff</tt> and <tt class="docutils literal">lxml.html.clean</tt>
-are also compiled using Cython in order to speed them up.</li>
-<li><tt class="docutils literal">xmlfile()</tt> supports async coroutines using <tt class="docutils literal">async with</tt> and <tt class="docutils literal">await</tt>.</li>
-<li><tt class="docutils literal">iterwalk()</tt> has a new method <tt class="docutils literal">skip_subtree()</tt> that prevents walking into
-the descendants of the current element.</li>
-<li><tt class="docutils literal">RelaxNG.from_rnc_string()</tt> accepts a <tt class="docutils literal">base_url</tt> argument to
-allow relative resource lookups.</li>
-<li>The XSLT result object has a new method <tt class="docutils literal">.write_output(file)</tt> that serialises
-output data into a file according to the <tt class="docutils literal">&lt;xsl:output&gt;</tt> configuration.</li>
-</ul>
-</div>
-<div class="section" id="id58">
-<h2>Bugs fixed</h2>
-<ul>
-<li><p class="first"><a class="reference external" href="https://github.com/lxml/lxml/issues/251">GH#251</a>: HTML comments were handled incorrectly by the soupparser.
-Patch by mozbugbox.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1654544">LP#1654544</a>: The html5parser no longer passes the <tt class="docutils literal">useChardet</tt> option
-if the input is a Unicode string, unless explicitly requested.  When parsing
-files, the default is to enable it when a URL or file path is passed (because
-the file is then opened in binary mode), and to disable it when reading from
-a file(-like) object.</p>
-<p>Note: This is a backwards incompatible change of the default configuration.
-If your code parses byte strings/streams and depends on character detection,
-please pass the option <tt class="docutils literal">guess_charset=True</tt> explicitly, which already worked
-in older lxml versions.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1703810">LP#1703810</a>: <tt class="docutils literal">etree.fromstring()</tt> failed to parse UTF-32 data with BOM.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1526522">LP#1526522</a>: Some RelaxNG errors were not reported in the error log.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1567526">LP#1567526</a>: Empty and plain text input raised a TypeError in soupparser.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1710429">LP#1710429</a>: Uninitialised variable usage in HTML diff.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415643">LP#1415643</a>: The closing tags context manager in <tt class="docutils literal">xmlfile()</tt> could continue
-to output end tags even after writing failed with an exception.</p>
-</li>
-<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1465357">LP#1465357</a>: <tt class="docutils literal">xmlfile.write()</tt> now accepts and ignores None as input argument.</p>
-</li>
-<li><p class="first">Compilation under Py3.7-pre failed due to a modified function signature.</p>
-</li>
-</ul>
-</div>
-<div class="section" id="id59">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The main module source files were renamed from <tt class="docutils literal"><span class="pre">lxml.*.pyx</span></tt> to plain
-<tt class="docutils literal">*.pyx</tt> (e.g. <tt class="docutils literal">etree.pyx</tt>) to simplify their handling in the build
-process.  Care was taken to keep the old header files as fallbacks for
-code that compiles against the public C-API of lxml, but it might still
-be worth validating that third-party code does not notice this change.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id60">
-<h1>3.8.0 (2017-06-03)</h1>
-<div class="section" id="id61">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">ElementTree.write()</tt> has a new option <tt class="docutils literal">doctype</tt> that writes out a
-doctype string before the serialisation, in the same way as <tt class="docutils literal">tostring()</tt>.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1595781">LP#1595781</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/240">GH#240</a>: added a PyCapsule Python API and C-level API for
-passing externally generated libxml2 documents into lxml.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/244">GH#244</a>: error log entries have a new property <tt class="docutils literal">path</tt> with an XPath
-expression (if known, None otherwise) that points to the tree element
-responsible for the error. Patch by Bob Kline.</li>
-<li>The namespace prefix mapping that can be used in ElementPath now injects
-a default namespace when passing a None prefix.</li>
-</ul>
-</div>
-<div class="section" id="id62">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/238">GH#238</a>: Character escapes were not hex-encoded in the <tt class="docutils literal">xmlfile</tt> serialiser.
-Patch by matejcik.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/229">GH#229</a>: fix for externally created XML documents.  Patch by Theodore Dubois.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1665241">LP#1665241</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/228">GH#228</a>: Form data handling in lxml.html no longer strips the
-option values specified in form attributes but only the text values.
-Patch by Ashish Kulkarni.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
-multi-threaded XSLT processing.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
-</ul>
-</div>
-<div class="section" id="id64">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The previously undocumented <tt class="docutils literal">docstring</tt> option in <tt class="docutils literal">ElementTree.write()</tt>
-produces a deprecation warning and will eventually be removed.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id65">
-<h1>3.7.4 (2017-??-??)</h1>
-<div class="section" id="id66">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
-multi-threaded XSLT processing.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id70">
-<h1>3.7.3 (2017-02-18)</h1>
-<div class="section" id="id71">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a> was ineffective in Python 3.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/222">GH#222</a>: <tt class="docutils literal">lxml.html.submit_form()</tt> failed in Python 3.
-Patch by Jakub Wilk.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id72">
-<h1>3.7.2 (2017-01-08)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
-Patch by Burak Arslan.</li>
-</ul>
-<div class="section" id="id74">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Work around installation problems in recent Python 2.7 versions
-due to FTP download failures.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/219">GH#219</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly quoting attribute values.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly escaping text content of
-script/style tags.  Patch by Burak Arslan.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id76">
-<h1>3.7.1 (2016-12-23)</h1>
-<ul class="simple">
-<li>No source changes, issued only to solve problems with the
-binary packages released for 3.7.0.</li>
-</ul>
-</div>
-<div class="section" id="id77">
-<h1>3.7.0 (2016-12-10)</h1>
-<div class="section" id="id78">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/217">GH#217</a>: <tt class="docutils literal">XMLSyntaxError</tt> now behaves more like its <tt class="docutils literal">SyntaxError</tt>
-baseclass.  Patch by Philipp A.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/216">GH#216</a>: <tt class="docutils literal">HTMLParser()</tt> now supports the same <tt class="docutils literal">collect_ids</tt> parameter
-as <tt class="docutils literal">XMLParser()</tt>.  Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/210">GH#210</a>: Allow specifying a serialisation method in <tt class="docutils literal">xmlfile.write()</tt>.
-Patch by Burak Arslan.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/203">GH#203</a>: New option <tt class="docutils literal">default_doctype</tt> in <tt class="docutils literal">HTMLParser</tt> that allows
-disabling the automatic doctype creation.  Patch by Shadab Zafar.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/201">GH#201</a>: Calling the method <tt class="docutils literal"><span class="pre">.set('attrname')</span></tt> without value argument
-(or <tt class="docutils literal">None</tt>) on HTML elements creates an attribute without value that
-serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&gt;&lt;/div&gt;</span></tt>.  Patch by Daniel Holth.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/197">GH#197</a>: Ignore form input fields in <tt class="docutils literal">form_values()</tt> when they are
-marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
-</ul>
-</div>
-<div class="section" id="id79">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/206">GH#206</a>: File name and line number were missing from XSLT error messages.
-Patch by Marcus Brinkmann.</li>
-</ul>
-</div>
-<div class="section" id="id80">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Log entries no longer allow anything but plain string objects as message text
-and file name.</li>
-<li><tt class="docutils literal">zlib</tt> is included in the list of statically built libraries.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id81">
-<h1>3.6.4 (2016-08-20)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/204">GH#204</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614693">LP#1614693</a>: build fix for MacOS-X.</li>
-</ul>
-</div>
-<div class="section" id="id82">
-<h1>3.6.3 (2016-08-18)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: change linker flags to build multi-linux wheels</li>
-</ul>
-</div>
-<div class="section" id="id83">
-<h1>3.6.2 (2016-08-18)</h1>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: release without source changes to provide cleanly built Linux wheels</li>
-</ul>
-</div>
-<div class="section" id="id85">
-<h1>3.6.1 (2016-07-24)</h1>
-<div class="section" id="id86">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/180">GH#180</a>: Separate option <tt class="docutils literal">inline_style</tt> for Cleaner that only removes <tt class="docutils literal">style</tt>
-attributes instead of all styles.  Patch by Christian Pedersen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/196">GH#196</a>: Windows build support for Python 3.5.  Contribution by Maximilian Hils.</li>
-</ul>
-</div>
-<div class="section" id="id87">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/199">GH#199</a>: Exclude <tt class="docutils literal">file</tt> fields from <tt class="docutils literal">FormElement.form_values</tt> (as browsers do).
-Patch by Tomas Divis.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/198">GH#198</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1568167">LP#1568167</a>: Try to provide base URL from <tt class="docutils literal">Resolver.resolve_string()</tt>.
-Patch by Michael van Tellingen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/191">GH#191</a>: More accurate float serialisation in <tt class="docutils literal">objectify.FloatElement</tt>.
-Patch by Holger Joukl.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Repair XSLT error logging. Patch by Marcus Brinkmann.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id89">
-<h1>3.6.0 (2016-03-17)</h1>
-<div class="section" id="id90">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/187">GH#187</a>: Now supports (only) version 5.x and later of PyPy.
-Patch by Armin Rigo.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/181">GH#181</a>: Direct support for <tt class="docutils literal">.rnc</tt> files in <cite>RelaxNG()</cite> if <tt class="docutils literal">rnc2rng</tt>
-is installed.  Patch by Dirkjan Ochtman.</li>
-</ul>
-</div>
-<div class="section" id="id91">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/189">GH#189</a>: Static builds honour FTP proxy configurations when downloading
-the external libs.  Patch by Youhei Sakurai.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/186">GH#186</a>: Soupparser failed to process entities in Python 3.x.
-Patch by Duncan Morris.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/185">GH#185</a>: Rare encoding related <tt class="docutils literal">TypeError</tt> on import was fixed.
-Patch by Petr Demin.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id92">
-<h1>3.5.0 (2015-11-13)</h1>
-<div class="section" id="id93">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Unicode string results failed XPath queries in PyPy.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1497051">LP#1497051</a>: HTML target parser failed to terminate on exceptions
-and continued parsing instead.</li>
-<li>Deprecated API usage in doctestcompare.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="b1-2015-09-18">
-<h1>3.5.0b1 (2015-09-18)</h1>
-<div class="section" id="id94">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">keep_ns_prefixes</tt>
-that does not remove definitions of the provided prefix-namespace
-mapping from the tree.</li>
-<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">top_nsmap</tt> that
-moves definitions of the provided prefix-namespace mapping to the
-top of the tree.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1490451">LP#1490451</a>: <tt class="docutils literal">Element</tt> objects gained a <tt class="docutils literal">cssselect()</tt> method as
-known from <tt class="docutils literal">lxml.html</tt>.  Patch by Simon Sapin.</li>
-<li>API functions and methods behave and look more like Python functions,
-which allows introspection on them etc.  One side effect to be aware of
-is that the functions now bind as methods when assigned to a class
-variable.  A quick fix is to wrap them in <tt class="docutils literal">staticmethod()</tt> (as for
-normal Python functions).</li>
-<li>ISO-Schematron support gained an option <tt class="docutils literal">error_finder</tt> that allows
-passing a filter function for picking validation errors from reports.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1243600">LP#1243600</a>: Elements in <tt class="docutils literal">lxml.html</tt> gained a <tt class="docutils literal">classes</tt> property
-that provides a set-like interface to the <tt class="docutils literal">class</tt> attribute.
-Original patch by masklinn.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1341964">LP#1341964</a>: The soupparser now handles DOCTYPE declarations, comments
-and processing instructions outside of the root element.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421512">LP#1421512</a>: The <tt class="docutils literal">docinfo</tt> of a tree was made editable to allow
-setting and removing the public ID and system ID of the DOCTYPE.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1442427">LP#1442427</a>: More work-arounds for quirks and bugs in pypy and pypy3.</li>
-<li><tt class="docutils literal">lxml.html.soupparser</tt> now uses BeautifulSoup version 4 instead
-of version 3 if available.</li>
-</ul>
-</div>
-<div class="section" id="id95">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory errors that occur during tree adaptations (e.g. moving subtrees
-to foreign documents) could leave the tree in a crash prone state.</li>
-<li>Calling <tt class="docutils literal">process_children()</tt> in an XSLT extension element without
-an <tt class="docutils literal">output_parent</tt> argument failed with a <tt class="docutils literal">TypeError</tt>.
-Fix by Jens Tröger.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/162">GH#162</a>: Image data in HTML <tt class="docutils literal">data</tt> URLs is considered safe and
-no longer removed by <tt class="docutils literal">lxml.html.clean</tt> JavaScript cleaner.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/166">GH#166</a>: Static build could link libraries in wrong order.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/172">GH#172</a>: Rely a bit more on libxml2 for encoding detection rather than
-rolling our own in some cases.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/159">GH#159</a>: Validity checks for names and string content were tightened
-to detect the use of illegal characters early.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421921">LP#1421921</a>: Comments/PIs before the DOCTYPE declaration were not
-serialised.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/659367">LP#659367</a>: Some HTML DOCTYPE declarations were not serialised.
-Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238503">LP#1238503</a>: lxml.doctestcompare is now consistent with stdlib's doctest
-in how it uses <tt class="docutils literal">+</tt> and <tt class="docutils literal">-</tt> to refer to unexpected and missing output.</li>
-<li>Empty prefixes are explicitly rejected when a namespace mapping is used
-with ElementPath to avoid hiding bugs in user code.</li>
-<li>Several problems with PyPy were fixed by switching to Cython 0.23.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id96">
-<h1>3.4.4 (2015-04-25)</h1>
-<div class="section" id="id97">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>An ElementTree compatibility test added in lxml 3.4.3 that failed in
-Python 3.4+ was removed again.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id98">
-<h1>3.4.3 (2015-04-15)</h1>
-<div class="section" id="id99">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1426868">LP#1426868</a>: Passing a default namespace and a prefixed namespace mapping
-as nsmap into <tt class="docutils literal">xmlfile.element()</tt> raised a <tt class="docutils literal">TypeError</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421927">LP#1421927</a>: DOCTYPE system URLs were incorrectly quoted when containing
-double quotes.  Patch by Olli Pottonen.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1419354">LP#1419354</a>: meta-redirect URLs were incorrectly processed by
-<tt class="docutils literal">iterlinks()</tt> if preceded by whitespace.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id100">
-<h1>3.4.2 (2015-02-07)</h1>
-<div class="section" id="id101">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415907">LP#1415907</a>: Crash when creating an XMLSchema from a non-root element
-of an XML document.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1369362">LP#1369362</a>: HTML cleaning failed when hitting processing instructions
-with pseudo-attributes.</li>
-<li><tt class="docutils literal">CDATA()</tt> wrapped content was rejected for tail text.</li>
-<li>CDATA sections were not serialised as tail text of the top-level element.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id102">
-<h1>3.4.1 (2014-11-20)</h1>
-<div class="section" id="id103">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New <tt class="docutils literal">htmlfile</tt> HTML generator to accompany the incremental <tt class="docutils literal">xmlfile</tt>
-serialisation API.  Patch by Burak Arslan.</li>
-</ul>
-</div>
-<div class="section" id="id104">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.sax.ElementTreeContentHandler</tt> did not initialise its superclass.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id105">
-<h1>3.4.0 (2014-09-10)</h1>
-<div class="section" id="id106">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">xmlfile(buffered=False)</tt> disables output buffering and flushes the
-content after each API operation (starting/ending element blocks or writes).
-A new method <tt class="docutils literal">xf.flush()</tt> can alternatively be used to explicitly flush
-the output.</li>
-<li><tt class="docutils literal">lxml.html.document_fromstring</tt> has a new option <tt class="docutils literal">ensure_head_body=True</tt>
-which will add an empty head and/or body element to the result document if
-missing.</li>
-<li><tt class="docutils literal">lxml.html.iterlinks</tt> now returns links inside meta refresh tags.</li>
-<li>New <tt class="docutils literal">XMLParser</tt> option <tt class="docutils literal">collect_ids=False</tt> to disable ID hash table
-creation.  This can substantially speed up parsing of documents with many
-different IDs that are not used.</li>
-<li>The parser uses per-document hash tables for XML IDs.  This reduces the
-load of the global parser dict and speeds up parsing for documents with
-many different IDs.</li>
-<li><tt class="docutils literal">ElementTree.getelementpath(element)</tt> returns a structural ElementPath
-expression for the given element, which can be used for lookups later.</li>
-<li><tt class="docutils literal">xmlfile()</tt> accepts a new argument <tt class="docutils literal">close=True</tt> to close file(-like)
-objects after writing to them.  Before, <tt class="docutils literal">xmlfile()</tt> only closed the file
-if it had opened it internally.</li>
-<li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
-</ul>
-</div>
-<div class="section" id="id107">
-<h2>Bugs fixed</h2>
-</div>
-<div class="section" id="id108">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/400588">LP#400588</a>: decoding errors have become hard errors even in recovery mode.
-Previously, they could lead to an internal tree representation in a mixed
-encoding state, which lead to very late errors or even silently incorrect
-behaviour during tree traversal or serialisation.</li>
-<li>Requires Python 2.6, 2.7, 3.2 or later. No longer supports
-Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.</li>
-<li>Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
-use lxml 3.3.x with older versions.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id109">
-<h1>3.3.6 (2014-08-28)</h1>
-<div class="section" id="id110">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Prevent tree cycle creation when adding Elements as siblings.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1361948">LP#1361948</a>: crash when deallocating Element siblings without parent.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1354652">LP#1354652</a>: crash when traversing internally loaded documents in XSLT
-extension functions.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id111">
-<h1>3.3.5 (2014-04-18)</h1>
-<div class="section" id="id112">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML cleaning could fail to strip javascript links that mix control
-characters into the link scheme.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id113">
-<h1>3.3.4 (2014-04-03)</h1>
-<div class="section" id="id114">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Source line numbers above 65535 are available on Elements when
-using libxml2 2.9 or later.</li>
-</ul>
-</div>
-<div class="section" id="id115">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.fragment_fromstring()</tt> failed for bytes input in Py3.</li>
-</ul>
-</div>
-<div class="section" id="id116">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id117">
-<h1>3.3.3 (2014-03-04)</h1>
-<div class="section" id="id118">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1287118">LP#1287118</a>: Crash when using Element subtypes with <tt class="docutils literal">__slots__</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id119">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The internal classes <tt class="docutils literal">_LogEntry</tt> and <tt class="docutils literal">_Attrib</tt> can no longer be
-subclassed from Python code.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id120">
-<h1>3.3.2 (2014-02-26)</h1>
-<div class="section" id="id121">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The properties <tt class="docutils literal">resolvers</tt> and <tt class="docutils literal">version</tt>, as well as the methods
-<tt class="docutils literal">set_element_class_lookup()</tt> and <tt class="docutils literal">makeelement()</tt>, were lost from
-<tt class="docutils literal">iterparse</tt> objects in 3.3.0.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1222132">LP#1222132</a>: instances of <tt class="docutils literal">XMLSchema</tt>, <tt class="docutils literal">Schematron</tt> and <tt class="docutils literal">RelaxNG</tt>
-did not clear their local <tt class="docutils literal">error_log</tt> before running a validation.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238500">LP#1238500</a>: lxml.doctestcompare mixed up &quot;expected&quot; and &quot;actual&quot; in
-attribute values.</li>
-<li>Some file I/O tests were failing in MS-Windows due to non-portable temp
-file usage.  Initial patch by Gabi Davar.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/910014">LP#910014</a>: duplicate IDs in a document were not reported by DTD validation.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185332">LP#1185332</a>: <tt class="docutils literal"><span class="pre">tostring(method=&quot;html&quot;)</span></tt> did not use HTML serialisation
-semantics for trailing tail text.  Initial patch by Sylvain Viollon.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1281139">LP#1281139</a>: <tt class="docutils literal">.attrib</tt> value of Comments lost its mutation methods
-in 3.3.0.  Even though it is empty and immutable, it should still
-provide the same interface as that returned for Elements.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id122">
-<h1>3.3.1 (2014-02-12)</h1>
-<div class="section" id="id123">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id124">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1014290">LP#1014290</a>: HTML documents parsed with <tt class="docutils literal">parser.feed()</tt> failed to find
-elements during tag iteration.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1273709">LP#1273709</a>: Building in PyPy failed due to missing support for
-<tt class="docutils literal">PyUnicode_Compare()</tt> and <tt class="docutils literal"><span class="pre">PyByteArray_*()</span></tt> in PyPy's C-API.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274413">LP#1274413</a>: Compilation in MSVC failed due to missing &quot;stdint.h&quot; standard
-header file.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274118">LP#1274118</a>: iterparse() failed to parse BOM prefixed files.</li>
-</ul>
-</div>
-<div class="section" id="id125">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id126">
-<h1>3.3.0 (2014-01-26)</h1>
-<div class="section" id="id127">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id128">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The heuristic that distinguishes file paths from URLs was tightened
-to produce less false negatives.</li>
-</ul>
-</div>
-<div class="section" id="id129">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta5-2014-01-18">
-<h1>3.3.0beta5 (2014-01-18)</h1>
-<div class="section" id="id130">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The PEP 393 unicode parsing support gained a fallback for wchar strings
-which might still be somewhat common on Windows systems.</li>
-</ul>
-</div>
-<div class="section" id="id131">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Several error handling problems were fixed throughout the code base that
-could previously lead to exceptions being silently swallowed or not
-properly reported.</li>
-<li>The C-API function <tt class="docutils literal">appendChild()</tt> is now deprecated as it does not
-propagate exceptions (its return type is <tt class="docutils literal">void</tt>).  The new function
-<tt class="docutils literal">appendChildToElement()</tt> was added as a safe replacement.</li>
-<li>Passing a string into <tt class="docutils literal">fromstringlist()</tt> raises an exception instead of
-parsing the string character by character.</li>
-</ul>
-</div>
-<div class="section" id="id132">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Document cleanup code was simplified using the new GC features in
-Cython 0.20.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta4-2014-01-12">
-<h1>3.3.0beta4 (2014-01-12)</h1>
-<div class="section" id="id133">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id134">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The (empty) value returned by the <tt class="docutils literal">attrib</tt> property of Entity and Comment
-objects was mutable.</li>
-<li>Element class lookup wasn't available for the new pull parsers or when using
-a custom parser target.</li>
-<li>Setting Element attributes on instantiation with both the <tt class="docutils literal">attrib</tt> argument
-and keyword arguments could modify the mapping passed as <tt class="docutils literal">attrib</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1266171">LP#1266171</a>: DTDs instantiated from internal/external subsets (i.e. through
-the docinfo property) lost their attribute declarations.</li>
-</ul>
-</div>
-<div class="section" id="id135">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
-Python 3.4.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2014-01-02">
-<h1>3.3.0beta3 (2014-01-02)</h1>
-<div class="section" id="id136">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Unicode string parsing was optimised for Python 3.3 (PEP 393).</li>
-</ul>
-</div>
-<div class="section" id="id137">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML parsing of Unicode strings could misdecode the input on some platforms.</li>
-<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
-</ul>
-</div>
-<div class="section" id="id138">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta2-2013-12-20">
-<h1>3.3.0beta2 (2013-12-20)</h1>
-<div class="section" id="id139">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">iterparse()</tt> supports the <tt class="docutils literal">recover</tt> option.</li>
-</ul>
-</div>
-<div class="section" id="id140">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in <tt class="docutils literal">iterparse()</tt> for HTML parsing.</li>
-<li>Crash in target parsing with attributes.</li>
-</ul>
-</div>
-<div class="section" id="id141">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The safety check in the read-only tree implementation (e.g. used by
-<tt class="docutils literal">PythonElementClassLookup</tt>) raises a more appropriate <tt class="docutils literal">ReferenceError</tt>
-for illegal access after tree disposal instead of an <tt class="docutils literal">AssertionError</tt>.
-This should only impact test code that specifically checks the original
-behaviour.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2013-12-12">
-<h1>3.3.0beta1 (2013-12-12)</h1>
-<div class="section" id="id142">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New option <tt class="docutils literal">handle_failures</tt> in <tt class="docutils literal">make_links_absolute()</tt> and
-<tt class="docutils literal">resolve_base_href()</tt> (lxml.html) that enables ignoring or
-discarding links that fail to parse as URLs.</li>
-<li>New parser classes <tt class="docutils literal">XMLPullParser</tt> and <tt class="docutils literal">HTMLPullParser</tt> for
-incremental parsing, as implemented for ElementTree in Python 3.4.</li>
-<li><tt class="docutils literal">iterparse()</tt> enables recovery mode by default for HTML parsing
-(<tt class="docutils literal">html=True</tt>).</li>
-</ul>
-</div>
-<div class="section" id="id143">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
-comment or PI).</li>
-<li>Error messages in the log and in exception messages that originated
-from libxml2 could accidentally be picked up from preceding warnings
-instead of the actual error.</li>
-<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify did not accept a dict as
-argument for adding attributes to the element it's building. This
-works as in lxml.builder now.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
-<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
-to one of its own descendants, instead of running into an infinite
-loop.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
-<li>Compressed plain-text serialisation to file-like objects was broken.</li>
-<li>lxml.html.formfill: Fix textarea form filling.
-The textarea used to be cleared before the new content was set,
-which removed the name attribute.</li>
-</ul>
-</div>
-<div class="section" id="id144">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Some basic API classes use freelists internally for faster
-instantiation.  This can speed up some <tt class="docutils literal">iterparse()</tt> scenarios,
-for example.</li>
-<li><tt class="docutils literal">iterparse()</tt> was rewritten to use the new <tt class="docutils literal">*PullParser</tt>
-classes internally instead of being a parser itself.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id145">
-<h1>3.2.5 (2014-01-02)</h1>
-<div class="section" id="id146">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id147">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
-<li>Crash in target parsing with attributes.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
-comment or PI).</li>
-</ul>
-</div>
-<div class="section" id="id149">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id150">
-<h1>3.2.4 (2013-11-07)</h1>
-<div class="section" id="id151">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id152">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak when creating an XPath evaluator in a thread.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
-<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
-to one of its own descendants.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
-<li>Compressed plain-text serialisation to file-like objects was broken.</li>
-</ul>
-</div>
-<div class="section" id="id155">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id156">
-<h1>3.2.3 (2013-07-28)</h1>
-<div class="section" id="id157">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix support for Python 2.4 which was lost in 3.2.2.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id158">
-<h1>3.2.2 (2013-07-28)</h1>
-<div class="section" id="id159">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id160">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185701">LP#1185701</a>: spurious XMLSyntaxError after finishing iterparse().</li>
-<li>Crash in lxml.objectify during xsi annotation.</li>
-</ul>
-</div>
-<div class="section" id="id161">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Return values of user provided element class lookup methods are now
-validated against the type of the XML node they represent to prevent
-API class mismatches.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id162">
-<h1>3.2.1 (2013-05-11)</h1>
-<div class="section" id="id163">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The methods <tt class="docutils literal">apply_templates()</tt> and <tt class="docutils literal">process_children()</tt> of XSLT
-extension elements have gained two new boolean options <tt class="docutils literal">elements_only</tt>
-and <tt class="docutils literal">remove_blank_text</tt> that discard either all strings or whitespace-only
-strings from the result list.</li>
-</ul>
-</div>
-<div class="section" id="id164">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When moving Elements to another tree, the namespace cleanup mechanism
-no longer drops namespace prefixes from attributes for which it finds
-a default namespace declaration, to prevent them from appearing as
-unnamespaced attributes after serialisation.</li>
-<li>Returning non-type objects from a custom class lookup method could lead
-to a crash.</li>
-<li>Instantiating and using subtypes of Comments and ProcessingInstructions
-crashed.</li>
-</ul>
-</div>
-<div class="section" id="id165">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id166">
-<h1>3.2.0 (2013-04-28)</h1>
-<div class="section" id="id167">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id168">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/690319">LP#690319</a>: Leading whitespace could change the behaviour of the string
-parsing functions in <tt class="docutils literal">lxml.html</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/599318">LP#599318</a>: The string parsing functions in <tt class="docutils literal">lxml.html</tt> are more robust
-in the face of uncommon HTML content like framesets or missing body tags.
-Patch by Stefan Seelmann.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/712941">LP#712941</a>: I/O errors while trying to access files with paths that contain
-non-ASCII characters could raise <tt class="docutils literal">UnicodeDecodeError</tt> instead of properly
-reporting the <tt class="docutils literal">IOError</tt>.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/673205">LP#673205</a>: Parsing from in-memory strings disabled network access in the
-default parser and made subsequent attempts to parse from a URL fail.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/971754">LP#971754</a>: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
-of overwriting the current value.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/715687">LP#715687</a>: lxml.html.clean no longer discards scripts that are explicitly
-allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
-</ul>
-</div>
-<div class="section" id="id169">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id170">
-<h1>3.1.2 (2013-04-12)</h1>
-<div class="section" id="id171">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id172">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1136509">LP#1136509</a>: Passing attributes through the namespace-unaware API of
-the sax bridge (i.e. the <tt class="docutils literal">handler.startElement()</tt> method) failed
-with a <tt class="docutils literal">TypeError</tt>.  Patch by Mike Bayer.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1123074">LP#1123074</a>: Fix serialisation error in XSLT output when converting
-the result tree to a Unicode string.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/105">GH#105</a>: Replace illegal usage of <tt class="docutils literal">xmlBufLength()</tt> in libxml2 2.9.0
-by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id173">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id174">
-<h1>3.1.1 (2013-03-29)</h1>
-<div class="section" id="id175">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id176">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1160386">LP#1160386</a>: Write access to <tt class="docutils literal">lxml.html.FormElement.fields</tt> raised
-an AttributeError in Py3.</li>
-<li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
-</ul>
-</div>
-<div class="section" id="id177">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The externally useless class <tt class="docutils literal">lxml.etree._BaseParser</tt> was removed
-from the module dict.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id178">
-<h1>3.1.0 (2013-02-10)</h1>
-<div class="section" id="id179">
-<h2>Features added</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/89">GH#89</a>: lxml.html.clean allows overriding the set of attributes that it
-considers 'safe'.  Patch by Francis Devereux.</li>
-</ul>
-</div>
-<div class="section" id="id180">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1104370">LP#1104370</a>: <tt class="docutils literal">copy.copy(el.attrib)</tt> raised an exception.  It now returns
-a copy of the attributes as a plain Python dict.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/95">GH#95</a>: When used with namespace prefixes, the  <tt class="docutils literal"><span class="pre">el.find*()</span></tt> methods
-always used the first namespace mapping that was provided for each
-path expression instead of using the one that was actually passed
-in for the current run.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1092521">LP#1092521</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/91">GH#91</a>: Fix undefined C symbol in Python runtimes compiled
-without threading support.  Patch by Ulrich Seidl.</li>
-</ul>
-</div>
-<div class="section" id="id181">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta1-2012-12-21">
-<h1>3.1beta1 (2012-12-21)</h1>
-<div class="section" id="id182">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New build-time option <tt class="docutils literal"><span class="pre">--with-unicode-strings</span></tt> for Python 2 that
-makes the API always return Unicode strings for names and text
-instead of byte strings for plain ASCII content.</li>
-<li>New incremental XML file writing API <tt class="docutils literal">etree.xmlfile()</tt>.</li>
-<li>E factory in lxml.objectify is callable to simplify the creation of
-tags with non-identifier names without having to resort to getattr().</li>
-</ul>
-</div>
-<div class="section" id="id183">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When starting from a non-namespaced element in lxml.objectify, searching
-for a child without explicitly specifying a namespace incorrectly found
-namespaced elements with the requested local name, instead of restricting
-the search to non-namespaced children.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/85">GH#85</a>: Deprecation warnings were fixed for Python 3.x.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/33">GH#33</a>: lxml.html.fromstring() failed to accept bytes input in Py3.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1080792">LP#1080792</a>: Static build of libxml2 2.9.0 failed due to missing file.</li>
-</ul>
-</div>
-<div class="section" id="id184">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
-removed from the module API of lxml.objectify.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1075622">LP#1075622</a>: lxml.builder is faster for adding text to elements with
-many children.  Patch by Anders Hammarquist.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id185">
-<h1>3.0.2 (2012-12-14)</h1>
-<div class="section" id="id186">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id187">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.</li>
-</ul>
-</div>
-<div class="section" id="id188">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id189">
-<h1>3.0.1 (2012-10-14)</h1>
-<div class="section" id="id190">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id191">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065924">LP#1065924</a>: Element proxies could disappear during garbage collection
-in PyPy without proper cleanup.</li>
-<li><a class="reference external" href="https://github.com/lxml/lxml/issues/71">GH#71</a>: Failure to work with libxml2 2.6.x.</li>
-<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065139">LP#1065139</a>: static MacOS-X build failed in Py3.</li>
-</ul>
-</div>
-<div class="section" id="id192">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id193">
-<h1>3.0 (2012-10-08)</h1>
-<div class="section" id="id194">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id195">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>End-of-file handling was incorrect in iterparse() when reading from
-a low-level C file stream and failed in libxml2 2.9.0 due to its
-improved consistency checks.</li>
-</ul>
-</div>
-<div class="section" id="id196">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The build no longer uses Cython by default unless the generated C files
-are missing.  To use Cython, pass the option &quot;--with-cython&quot;.  To ignore
-the fatal build error when Cython is required but not available (e.g. to
-run special setup.py commands that do not actually run a build), pass
-&quot;--without-cython&quot;.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2012-09-26">
-<h1>3.0beta1 (2012-09-26)</h1>
-<div class="section" id="id197">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Python level access to (optional) libxml2 memory debugging features
-to simplify debugging of memory leaks etc.</li>
-</ul>
-</div>
-<div class="section" id="id198">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fix a memory leak in XPath by switching to Cython 0.17.1.</li>
-<li>Some tests were adapted to work with PyPy.</li>
-</ul>
-</div>
-<div class="section" id="id199">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The code was adapted to work with the upcoming libxml2 2.9.0 release.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha2-2012-08-23">
-<h1>3.0alpha2 (2012-08-23)</h1>
-<div class="section" id="id200">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">.iter()</tt> method of elements now accepts <tt class="docutils literal">tag</tt> arguments like
-<tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt> to search for elements with a given local name in any
-namespace. With this addition, all combinations of wildcards now work
-as expected:
-<tt class="docutils literal">&quot;{ns}name&quot;</tt>, <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{ns}*&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>
-and <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.  Note that <tt class="docutils literal">&quot;name&quot;</tt> is equivalent to <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>,
-but <tt class="docutils literal">&quot;*&quot;</tt> is <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.
-The same change applies to the <tt class="docutils literal">.getiterator()</tt>, <tt class="docutils literal">.itersiblings()</tt>,
-<tt class="docutils literal">.iterancestors()</tt>, <tt class="docutils literal">.iterdescendants()</tt>, <tt class="docutils literal">.iterchildren()</tt>
-and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutils literal">strip_attributes()</tt>,
-<tt class="docutils literal">strip_elements()</tt> and <tt class="docutils literal">strip_tags()</tt> functions as well as the
-<tt class="docutils literal">iterparse()</tt> class.  Patch by Simon Sapin.</li>
-<li>C14N allows specifying the inclusive prefixes to be promoted
-to top-level during exclusive serialisation.</li>
-</ul>
-</div>
-<div class="section" id="id201">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
-failed to read the entire string.</li>
-</ul>
-</div>
-<div class="section" id="id202">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha1-2012-07-31">
-<h1>3.0alpha1 (2012-07-31)</h1>
-<div class="section" id="id203">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Initial support for building in PyPy (through cpyext).</li>
-<li>DTD objects gained an API that allows read access to their
-declarations.</li>
-<li><tt class="docutils literal">xpathgrep.py</tt> gained support for parsing line-by-line (e.g.
-from grep output) and for surrounding the output with a new root
-tag.</li>
-<li><tt class="docutils literal"><span class="pre">E-factory</span></tt> in <tt class="docutils literal">lxml.builder</tt> accepts subtypes of known data
-types (such as string subtypes) when building elements around them.</li>
-<li>Tree iteration and <tt class="docutils literal">iterparse()</tt> with a selective <tt class="docutils literal">tag</tt>
-argument supports passing a set of tags.  Tree nodes will be
-returned by the iterators if they match any of the tags.</li>
-</ul>
-</div>
-<div class="section" id="id204">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods in <tt class="docutils literal">lxml.objectify</tt> no longer use XPath
-internally, which makes them faster in many cases (especially when
-short circuiting after a single or couple of elements) and fixes
-some behavioural differences compared to <tt class="docutils literal">lxml.etree</tt>.  Note that
-this means that they no longer support arbitrary XPath expressions
-but only the subset that the <tt class="docutils literal">ElementPath</tt> language supports.
-The previous implementation was also redundant with the normal
-XPath support, which can be used as a replacement.</li>
-<li><tt class="docutils literal"><span class="pre">el.find('*')</span></tt> could accidentally return a comment or processing
-instruction that happened to be in the wrong spot.  (Same for the
-other <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods.)</li>
-<li>The error logging is less intrusive and avoids a global setup where
-possible.</li>
-<li>Fixed undefined names in html5lib parser.</li>
-<li><tt class="docutils literal">xpathgrep.py</tt> did not work in Python 3.</li>
-<li><tt class="docutils literal">Element.attrib.update()</tt> did not accept an <tt class="docutils literal">attrib</tt> of
-another Element as parameter.</li>
-<li>For subtypes of <tt class="docutils literal">ElementBase</tt> that make the <tt class="docutils literal">.text</tt> or <tt class="docutils literal">.tail</tt>
-properties immutable (as in objectify, for example), inserting text
-when creating Elements through the E-Factory feature of the class
-constructor would fail with an exception, stating that the text
-cannot be modified.</li>
-</ul>
-</div>
-<div class="section" id="id205">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The code base was overhauled to properly use 'const' where the API
-of libxml2 and libxslt requests it.  This also has an impact on the
-public C-API of lxml itself, as defined in <tt class="docutils literal">etreepublic.pxd</tt>, as
-well as the provided declarations in the <tt class="docutils literal">lxml/includes/</tt> directory.
-Code that uses these declarations may have to be adapted.  On the
-plus side, this fixes several C compiler warnings, also for user
-code, thus making it easier to spot real problems again.</li>
-<li>The functionality of &quot;lxml.cssselect&quot; was moved into a separate PyPI
-package called &quot;cssselect&quot;.  To continue using it, you must install
-that package separately.  The &quot;lxml.cssselect&quot; module is still
-available and provides the same interface, provided the &quot;cssselect&quot;
-package can be imported at runtime.</li>
-<li>Element attributes passed in as an <tt class="docutils literal">attrib</tt> dict or as keyword
-arguments are now sorted by (namespaced) name before being created
-to make their order predictable for serialisation and iteration.
-Note that adding or deleting attributes afterwards does not take
-that order into account, i.e. setting a new attribute appends it
-after the existing ones.</li>
-<li>Several classes that are for internal use only were removed
-from the <tt class="docutils literal">lxml.etree</tt> module dict:
-<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
-_ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
-__ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
-_ClassNamespaceRegistry, _FunctionNamespaceRegistry,
-_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
-_FileReaderContext, _ParserContext, _PythonSaxParserTarget,
-_TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
-_ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
-_OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
-_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
-_AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
-_ParserSchemaValidationContext, _XPathContext,
-_XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam</tt></li>
-<li>Several internal classes can no longer be inherited from:
-<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
-_IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
-_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
-_FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
-_ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
-_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
-_AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
-_XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
-_XSLTResultTree, _XSLTProcessingInstruction</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id206">
-<h1>2.3.6 (2012-09-28)</h1>
-<div class="section" id="id207">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id208">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
-failed to read the entire string.</li>
-</ul>
-</div>
-<div class="section" id="id209">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id210">
-<h1>2.3.5 (2012-07-31)</h1>
-<div class="section" id="id211">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id212">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
-<li>Crash in sax/target parser when reporting empty doctype.</li>
-</ul>
-</div>
-<div class="section" id="id213">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id214">
-<h1>2.3.4 (2012-03-26)</h1>
-<div class="section" id="id215">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id216">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when building an nsmap (Element property) with empty
-namespace URIs.</li>
-<li>Crash due to race condition when errors (or user messages) occur
-during threaded XSLT processing.</li>
-<li>XSLT stylesheet compilation could ignore compilation errors.</li>
-</ul>
-</div>
-<div class="section" id="id217">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id218">
-<h1>2.3.3 (2012-01-04)</h1>
-<div class="section" id="id219">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
-<tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id220">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
-requesting start events.</li>
-<li>Fixed parsing of more selectors in cssselect.  Whitespace before
-pseudo-elements and pseudo-classes is significant as it is a
-descendant combinator.
-&quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
-Patch by Simon Sapin.</li>
-<li>lxml.html.diff no longer raises an exception when hitting
-'img' tags without 'src' attribute.</li>
-</ul>
-</div>
-<div class="section" id="id221">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id222">
-<h1>2.3.2 (2011-11-11)</h1>
-<div class="section" id="id223">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
-<tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
-declarations (and generally clean up the namespace declarations)
-after removing the type annotations.</li>
-<li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
-copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
-of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
-</ul>
-</div>
-<div class="section" id="id224">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
-fix in lxml 2.3.1).  The previous change resulted in a serious
-performance regression for the XPath based evaluation of the
-translated expression.  Note that this breaks the usage of some of
-the generated XPath expressions as XSLT location paths that
-previously worked in 2.3.1.</li>
-<li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
-&quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously it was parsed as
-a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
-&quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
-</ul>
-</div>
-<div class="section" id="id225">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id226">
-<h1>2.3.1 (2011-09-25)</h1>
-<div class="section" id="id227">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
-tags and their content (i.e. their whole subtree).</li>
-<li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
-pseudo-attributes from the text content of processing instructions.</li>
-<li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
-used to compile external C code against lxml.etree.  This is
-specifically required for statically linked lxml builds when code
-needs to compile against the exact same header file versions as lxml
-itself.</li>
-<li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
-<tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
-closed after reading or not.  By default, the file will be closed,
-as the user is not expected to keep a reference to it.</li>
-</ul>
-</div>
-<div class="section" id="id228">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>HTML cleaning didn't remove 'data:' links.</li>
-<li>The html5lib parser integration now uses the 'official'
-implementation in html5lib itself, which makes it work with newer
-releases of the library.</li>
-<li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
-tag name when the corresponding start event inferred the same plain
-tag name to be in the default namespace.</li>
-<li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
-<tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
-reverts a change in lxml 2.3 where all files would be closed.  It is
-the users responsibility to properly close the file(-like) object,
-also in error cases.</li>
-<li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
-<li>In lxml.cssselect, use the xpath 'A//B' (short for
-'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
-the css descendant selector ('A B').  This makes a few edge cases
-like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
-WebKit and Firefox, and makes more css expressions valid location
-paths (for use in xsl:template match).</li>
-<li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
-collected form values.</li>
-<li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
-field properly selects them and unselects them.</li>
-</ul>
-</div>
-<div class="section" id="id229">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Static builds can specify the download directory with the
-<tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id230">
-<h1>2.3 (2011-02-06)</h1>
-<div class="section" id="id231">
-<h2>Features added</h2>
-<ul class="simple">
-<li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
-meaning an empty namespace, as opposed to the parent namespace.</li>
-</ul>
-</div>
-<div class="section" id="id232">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>When finished reading from a file-like object, the parser
-immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
-<li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
-file.</li>
-<li>Work-around for libxml2 bug that can leave the HTML parser in a
-non-functional state after parsing a severely broken document (fixed
-in libxml2 2.7.8).</li>
-<li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id233">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Some public functions in the Cython-level C-API have more explicit
-return types.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2010-09-06">
-<h1>2.3beta1 (2010-09-06)</h1>
-<div class="section" id="id234">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id235">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in newer libxml2 versions when moving elements between
-documents that had attributes on replaced XInclude nodes.</li>
-<li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
-<tt class="docutils literal">base_url</tt> parameters.</li>
-<li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
-<li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
-use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
-</ul>
-</div>
-<div class="section" id="id236">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha2-2010-07-24">
-<h1>2.3alpha2 (2010-07-24)</h1>
-<div class="section" id="id237">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id238">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XSLT when generating text-only result documents with a
-stylesheet created in a different thread.</li>
-</ul>
-</div>
-<div class="section" id="id239">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
-(following ElementTree 1.3).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha1-2010-06-19">
-<h1>2.3alpha1 (2010-06-19)</h1>
-<div class="section" id="id240">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
-to pass a prefix-to-namespace mapping for the selector.</li>
-<li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
-globally registers a namespace prefix for a namespace that newly
-created Elements in that namespace will use automatically.  Follows
-ElementTree 1.3.</li>
-<li>Support 'unicode' string name as encoding parameter in
-<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
-<li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
-<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
-<li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
-match the upcoming ElementTree 1.3 that will ship in the standard
-library of Python 3.2/2.7.  This includes extended support for
-predicates as well as namespace prefixes (as known from XPath).</li>
-<li>During regular XPath evaluation, various ESXLT functions are
-available within their namespace when using libxslt 1.1.26 or later.</li>
-<li>Support passing a readily configured logger instance into
-<tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
-<li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
-override the DOCTYPE (internal subset) of the document.</li>
-<li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
-to append the resulting content directly to an output element.</li>
-<li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
-XSLT extension element itself.</li>
-<li>ISO-Schematron support based on the de-facto Schematron reference
-'skeleton implementation'.</li>
-<li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
-parameters.</li>
-<li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
-overhead.</li>
-<li>Setting the value of a namespaced attribute always uses a prefixed
-namespace instead of the default namespace even if both declare the
-same namespace URI.  This avoids serialisation problems when an
-attribute from a default namespace is set on an element from a
-different namespace.</li>
-<li>XSLT extension elements: support for XSLT context nodes other than
-elements: document root, comments, processing instructions.</li>
-<li>Support for strings (in addition to Elements) in node-sets returned
-by extension functions.</li>
-<li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
-the document on submit.</li>
-<li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
-<li>Namespace URIs get validated against RFC 3986 at the API level
-(required by the XML namespace specification).</li>
-<li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
-(compatible with ElementTree).</li>
-</ul>
-</div>
-<div class="section" id="id241">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>API is hardened against invalid proxy instances to prevent crashes
-due to incorrectly instantiated Element instances.</li>
-<li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
-<li>Export ElementTree compatible XML parser class as
-<tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
-<li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
-now use the hash value of the underlying Python value (string,
-number, etc.) to which they compare equal.</li>
-<li>Parsing broken fragments in lxml.html could fail if the fragment
-contained an orphaned closing '&lt;/div&gt;' tag.</li>
-<li>Using XSLT extension elements around the root of the output document
-crashed.</li>
-<li><tt class="docutils literal">lxml.cssselect</tt> did not distinguish between <tt class="docutils literal"><span class="pre">x[attr=&quot;val&quot;]</span></tt> and
-<tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
-attribute independent of the element.</li>
-<li>Rewriting multiple links inside of HTML text content could end up
-replacing unrelated content as replacements could impact the
-reported position of subsequent matches.  Modifications are now
-simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
-return links in reversed order if they appear inside the same text
-node.  Thus, replacements and link-internal modifications no longer
-change the position of links reported afterwards.</li>
-<li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
-not represent the complete raw value (including child tags etc.). It
-now serialises the complete content on read and replaces the
-complete content by a string on write.</li>
-<li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
-parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
-called after parsing, regardless of the outcome.</li>
-</ul>
-</div>
-<div class="section" id="id242">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Official support for Python 3.1.2 and later.</li>
-<li>Static MS Windows builds can now download their dependencies
-themselves.</li>
-<li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
-Element object.  It therefore no longer requires the garbage
-collector to clean up.</li>
-<li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id243">
-<h1>2.2.8 (2010-09-02)</h1>
-<div class="section" id="id244">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in newer libxml2 versions when moving elements between
-documents that had attributes on replaced XInclude nodes.</li>
-<li>Import fix for urljoin in Python 3.1+.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id245">
-<h1>2.2.7 (2010-07-24)</h1>
-<div class="section" id="id246">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XSLT when generating text-only result documents with a
-stylesheet created in a different thread.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id247">
-<h1>2.2.6 (2010-03-02)</h1>
-<div class="section" id="id248">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id249">
-<h1>2.2.5 (2010-02-28)</h1>
-<div class="section" id="id250">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for running XSLT extension elements on the input root node
-(e.g. in a template matching on &quot;/&quot;).</li>
-</ul>
-</div>
-<div class="section" id="id251">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in XPath evaluation when reading smart strings from a document
-other than the original context document.</li>
-<li>Support recent versions of html5lib by not requiring its
-<tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
-<li>Manually instantiating the custom element classes in
-<tt class="docutils literal">lxml.objectify</tt> could crash.</li>
-<li>Invalid XML text characters were not rejected by the API when they
-appeared in unicode strings directly after non-ASCII characters.</li>
-<li>lxml.html.open_http_urllib() did not work in Python 3.</li>
-<li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
-<tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
-<li>Crash in XSLT extension elements when the XSLT context node is not
-an element.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id252">
-<h1>2.2.4 (2009-11-11)</h1>
-<div class="section" id="id253">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Static build of libxml2/libxslt was broken.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id254">
-<h1>2.2.3 (2009-10-30)</h1>
-<div class="section" id="id255">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id256">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
-parser.</li>
-<li>Looking up and deleting attributes without a namespace could hit a
-namespaced attribute of the same name instead.</li>
-<li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
-ones) could leave a partially initialised element in the tree.</li>
-<li>Modifying trees that contain parsed entity references could result
-in an infinite loop.</li>
-<li>ObjectifiedElement.__setattr__ created an empty-string child element when the
-attribute value was rejected as a non-unicode/non-ascii string</li>
-<li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
-messages.</li>
-<li>Invalid syntax in CSS expressions could lead to an infinite loop in
-the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>CSS special character escapes were not properly handled in
-<tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
-<li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
-attribute were not handled correctly.  The HTML standard dictates
-that their value is defined by their text content.  This is now
-supported by lxml.html.</li>
-<li>XPath raised a TypeError when finding CDATA sections.  This is now
-fully supported.</li>
-<li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
-<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
-namespaces when annotation is disabled.</li>
-<li>Feed parser failed to honour the 'recover' option on parse errors.</li>
-<li>Diverting the error logging to Python's logging system was broken.</li>
-</ul>
-</div>
-<div class="section" id="id257">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id258">
-<h1>2.2.2 (2009-06-21)</h1>
-<div class="section" id="id259">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
-<tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
-from a subtree.</li>
-</ul>
-</div>
-<div class="section" id="id260">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Namespace cleanup on subtree insertions could result in missing
-namespace declarations (and potentially crashes) if the element
-defining a namespace was deleted and the namespace was not used by
-the top element of the inserted subtree but only in deeper subtrees.</li>
-<li>Raising an exception from a parser target callback didn't always
-terminate the parser.</li>
-<li>Only {true, false, 1, 0} are accepted as the lexical representation for
-BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
-behaviour.</li>
-</ul>
-</div>
-<div class="section" id="id261">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id262">
-<h1>2.2.1 (2009-06-02)</h1>
-<div class="section" id="id263">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Injecting default attributes into a document during XML Schema
-validation (also at parse time).</li>
-<li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
-restrictions imposed by libxml2 2.7.</li>
-</ul>
-</div>
-<div class="section" id="id264">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The script for statically building libxml2 and libxslt didn't work
-in Py3.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
-for parsing (which could lead to a crash before release 2.6.24).</li>
-</ul>
-</div>
-<div class="section" id="id265">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id266">
-<h1>2.2 (2009-03-21)</h1>
-<div class="section" id="id267">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
-<tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
-on serialisation.</li>
-</ul>
-</div>
-<div class="section" id="id268">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing an XML Schema with external imports from a
-filename.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta4-2009-02-27">
-<h1>2.2beta4 (2009-02-27)</h1>
-<div class="section" id="id269">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support strings and instantiable Element classes as child arguments
-to the constructor of custom Element classes.</li>
-<li>GZip compression support for serialisation to files and file-like
-objects.</li>
-</ul>
-</div>
-<div class="section" id="id270">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Deep-copying an ElementTree copied neither its sibling PIs and
-comments nor its internal/external DTD subsets.</li>
-<li>Soupparser failed on broken attributes without values.</li>
-<li>Crash in XSLT when overwriting an already defined attribute using
-<tt class="docutils literal">xsl:attribute</tt>.</li>
-<li>Crash bug in exception handling code under Python 3.  This was due
-to a problem in Cython, not lxml itself.</li>
-<li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
-<li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
-was evaluated incorrectly.</li>
-</ul>
-</div>
-<div class="section" id="id271">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Official support for Python 3.0.1.</li>
-<li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
-for Elements without text content.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2009-02-17">
-<h1>2.2beta3 (2009-02-17)</h1>
-<div class="section" id="id272">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
-that require escaping.</li>
-</ul>
-</div>
-<div class="section" id="id273">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak in XPath evaluators.</li>
-<li>Crash when parsing indented XML in one thread and merging it with
-other documents parsed in another thread.</li>
-<li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
-string failed.</li>
-<li>Fixes following changes in Python 3.0.1.</li>
-<li>Minor fixes for Python 3.</li>
-</ul>
-</div>
-<div class="section" id="id274">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The global error log (which is copied into the exception log) is now
-local to a thread, which fixes some race conditions.</li>
-<li>More robust error handling on serialisation.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta2-2009-01-25">
-<h1>2.2beta2 (2009-01-25)</h1>
-<div class="section" id="id275">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Potential memory leak on exception handling.  This was due to a
-problem in Cython, not lxml itself.</li>
-<li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
-<tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url(&quot;link&quot;)</span></tt> incorrectly
-(treating the quotation marks as part of the link).</li>
-<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id276">
-<h1>2.1.5 (2009-01-06)</h1>
-<div class="section" id="id277">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Potential memory leak on exception handling.  This was due to a
-problem in Cython, not lxml itself.</li>
-<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta1-2008-12-12">
-<h1>2.2beta1 (2008-12-12)</h1>
-<div class="section" id="id278">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
-just HTML strings.</li>
-</ul>
-</div>
-<div class="section" id="id279">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-<li>Fixed missing whitespace before <tt class="docutils literal"><span class="pre">Link:...</span></tt> in <tt class="docutils literal">lxml.html.diff</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id280">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id281">
-<h1>2.1.4 (2008-12-12)</h1>
-<div class="section" id="id282">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id283">
-<h1>2.0.11 (2008-12-12)</h1>
-<div class="section" id="id284">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when using an XPath evaluator in multiple threads.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="alpha1-2008-11-23">
-<h1>2.2alpha1 (2008-11-23)</h1>
-<div class="section" id="id285">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for XSLT result tree fragments in XPath/XSLT extension
-functions.</li>
-<li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
-<li>New options for exclusive C14N and C14N without comments.</li>
-<li>Instantiating a custom Element classes creates a new Element.</li>
-</ul>
-</div>
-<div class="section" id="id286">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>XSLT didn't inherit the parse options of the input document.</li>
-<li>0-bytes could slip through the API when used inside of Unicode
-strings.</li>
-<li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
-that end in a parenthesis, will be linked in their entirety (typical
-with Wikipedia links).</li>
-</ul>
-</div>
-<div class="section" id="id287">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id288">
-<h1>2.1.3 (2008-11-17)</h1>
-<div class="section" id="id289">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id290">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Ref-count leaks when lxml enters a try-except statement while an
-outside exception lives in sys.exc_*(). This was due to a problem in
-Cython, not lxml itself.</li>
-<li>Parser Unicode decoding errors could get swallowed by other
-exceptions.</li>
-<li>Name/import errors in some Python modules.</li>
-<li>Internal DTD subsets that did not specify a system or public ID were
-not serialised and did not appear in the docinfo property of
-ElementTrees.</li>
-<li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
-<li>Test suite fixes for libxml2 2.7.</li>
-<li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
-<li>Resolver.resolve_file() was broken.</li>
-<li>Overriding the parser encoding didn't work for many encodings.</li>
-</ul>
-</div>
-<div class="section" id="id291">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id292">
-<h1>2.0.10 (2008-11-17)</h1>
-<div class="section" id="id293">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Ref-count leaks when lxml enters a try-except statement while an
-outside exception lives in sys.exc_*(). This was due to a problem in
-Cython, not lxml itself.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id294">
-<h1>2.1.2 (2008-09-05)</h1>
-<div class="section" id="id295">
-<h2>Features added</h2>
-<ul class="simple">
-<li>lxml.etree now tries to find the absolute path name of files when
-parsing from a file-like object.  This helps custom resolvers when
-resolving relative URLs, as lixbml2 can prepend them with the path
-of the source document.</li>
-</ul>
-</div>
-<div class="section" id="id296">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory problem when passing documents between threads.</li>
-<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
-exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
-</ul>
-</div>
-<div class="section" id="id297">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id298">
-<h1>2.0.9 (2008-09-05)</h1>
-<div class="section" id="id299">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory problem when passing documents between threads.</li>
-<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
-exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id300">
-<h1>2.1.1 (2008-07-24)</h1>
-<div class="section" id="id301">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id302">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing XSLT stylesheets in a thread and using them in
-another.</li>
-<li>Encoding problem when including text with ElementInclude under
-Python 3.</li>
-</ul>
-</div>
-<div class="section" id="id303">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id304">
-<h1>2.0.8 (2008-07-24)</h1>
-<div class="section" id="id305">
-<h2>Features added</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
-with whitespace in URL attributes.</li>
-</ul>
-</div>
-<div class="section" id="id306">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when parsing XSLT stylesheets in a thread and using them in
-another.</li>
-<li>CSS selector parser dropped remaining expression after a function
-with parameters.</li>
-</ul>
-</div>
-<div class="section" id="id307">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="id308">
-<h1>2.1 (2008-07-09)</h1>
-<div class="section" id="id309">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
-keyword option).</li>
-<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
-with whitespace in URL attributes.</li>
-</ul>
-</div>
-<div class="section" id="id310">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Custom resolvers were not used for XMLSchema includes/imports and
-XInclude processing.</li>
-<li>CSS selector parser dropped remaining expression after a function
-with parameters.</li>
-</ul>
-</div>
-<div class="section" id="id311">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
-<tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
-<li>Speed-up when running XSLTs on documents from other threads</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id312">
-<h1>2.0.7 (2008-06-20)</h1>
-<div class="section" id="id313">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
-</ul>
-</div>
-<div class="section" id="id314">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Descending dot-separated classes in CSS selectors were not resolved
-correctly.</li>
-<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
-<li>Potential threading problem in XInclude.</li>
-<li>Crash in Element class lookup classes when the __init__() method of
-the super class is not called from Python subclasses.</li>
-</ul>
-</div>
-<div class="section" id="id315">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Non-ASCII characters in attribute values are no longer escaped on
-serialisation.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta3-2008-06-19">
-<h1>2.1beta3 (2008-06-19)</h1>
-<div class="section" id="id316">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
-<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
-<li>Support for parsing from file-like objects that return unicode
-strings.</li>
-<li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
-namespace declarations from a (sub)tree (experimental).</li>
-<li>XSLT results support the buffer protocol in Python 3.</li>
-<li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
-a parsable string will return either a UTF-8 encoded byte string, a
-unicode string or a tree, based on the type of the input.
-Previously, the result was always a byte string or a tree.</li>
-<li>Support for Python 2.6 and 3.0 beta.</li>
-<li>File name handling now uses a heuristic to convert between byte
-strings (usually filenames) and unicode strings (usually URLs).</li>
-<li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
-<li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
-on reading under Python 2.x.</li>
-<li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
-lxml.html (experimental).</li>
-<li>Most features in lxml.html work for XHTML namespaced tag names
-(experimental).</li>
-</ul>
-</div>
-<div class="section" id="id317">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
-<li>Crash in Element class lookup classes when the __init__() method of
-the super class is not called from Python subclasses.</li>
-<li>A number of problems related to unicode/byte string conversion of
-filenames and error messages were fixed.</li>
-<li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
-compiler, which reportedly prevents build quirks and crashes on this
-platform.</li>
-<li>Windows build was broken.</li>
-<li>Rare crash when serialising to a file object with certain encodings.</li>
-</ul>
-</div>
-<div class="section" id="id318">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Non-ASCII characters in attribute values are no longer escaped on
-serialisation.</li>
-<li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
-namespaces, etc. will result in a ValueError instead of an
-AssertionError (just like the tag well-formedness check).</li>
-<li>Up to several times faster attribute access (i.e. tree traversal) in
-lxml.objectify.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id319">
-<h1>2.0.6 (2008-05-31)</h1>
-<div class="section" id="id320">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id321">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
-<li>Windows build was broken.</li>
-<li>Moving a subtree from a document created in one thread into a
-document of another thread could crash when the rest of the source
-document is deleted while the subtree is still in use.</li>
-<li>Rare crash when serialising to a file object with certain encodings.</li>
-</ul>
-</div>
-<div class="section" id="id322">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>lxml should now build without problems on MacOS-X.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="beta2-2008-05-02">
-<h1>2.1beta2 (2008-05-02)</h1>
-<div class="section" id="id323">
-<h2>Features added</h2>
-<ul class="simple">
-<li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
-<li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
-attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
-pre-configured for the lxml.html package.</li>
-</ul>
-</div>
-<div class="section" id="id324">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Moving a subtree from a document created in one thread into a
-document of another thread could crash when the rest of the source
-document is deleted while the subtree is still in use.</li>
-<li>Passing an nsmap when creating an Element will no longer strip
-redundantly defined namespace URIs.  This prevented the definition
-of more than one prefix for a namespace on the same Element.</li>
-</ul>
-</div>
-<div class="section" id="id325">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>If the default namespace is redundantly defined with a prefix on the
-same Element, the prefix will now be preferred for subelements and
-attributes.  This allows users to work around a problem in libxml2
-where attributes from the default namespace could serialise without
-a prefix even when they appear on an Element with a different
-namespace (i.e. they would end up in the wrong namespace).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id326">
-<h1>2.0.5 (2008-05-01)</h1>
-<div class="section" id="id327">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id328">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Resolving to a filename in custom resolvers didn't work.</li>
-<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
-let some XSLT errors pass silently.</li>
-<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
-</ul>
-</div>
-<div class="section" id="id329">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="beta1-2008-04-15">
-<h1>2.1beta1 (2008-04-15)</h1>
-<div class="section" id="id330">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
-<li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
-sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
-sections by their text content.</li>
-<li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
-</ul>
-</div>
-<div class="section" id="id331">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Resolving to a filename in custom resolvers didn't work.</li>
-<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
-let some XSLT errors pass silently.</li>
-<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
-<li>lxml.etree accepted non well-formed namespace prefix names.</li>
-</ul>
-</div>
-<div class="section" id="id332">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
-takes care of namespace cleanup when moving elements between
-different namespace contexts.</li>
-<li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
-parser or through lxml.html now end up in a new HTML document
-(doctype HTML 4.01 Transitional) instead of a generic XML document.
-This mostly impacts the serialisation and the availability of a DTD
-context.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id333">
-<h1>2.0.4 (2008-04-13)</h1>
-<div class="section" id="id334">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id335">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Hanging thread in conjunction with GTK threading.</li>
-<li>Crash bug in iterparse when moving elements into other documents.</li>
-<li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
-<li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
-</ul>
-</div>
-<div class="section" id="id336">
-<h2>Other changes</h2>
-</div>
-</div>
-<div class="section" id="alpha1-2008-03-27">
-<h1>2.1alpha1 (2008-03-27)</h1>
-<div class="section" id="id337">
-<h2>Features added</h2>
-<ul class="simple">
-<li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
-<li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
-returns a dict of access configuration options.</li>
-<li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
-<tt class="docutils literal">XSLTAccessControl</tt> class.</li>
-<li>Extension elements for XSLT (experimental!)</li>
-<li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
-an Element.</li>
-<li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
-</ul>
-</div>
-<div class="section" id="id338">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Default encoding for plain text serialisation was different from
-that of XML serialisation (UTF-8 instead of ASCII).</li>
-</ul>
-</div>
-<div class="section" id="id339">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Minor API speed-ups.</li>
-<li>The benchmark suite now uses tail text in the trees, which makes the
-absolute numbers incomparable to previous results.</li>
-<li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
-used to enable syntax highlighting for the doctest examples.</li>
-</ul>
-<p>Most long-time deprecated functions and methods were removed:</p>
-<ul>
-<li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
-<tt class="docutils literal">etree.use_global_python_log()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
-<tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
-<tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
-<p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
-yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
-instead.</p>
-</li>
-<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
-<tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
-<tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
-<tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
-</li>
-<li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
-<tt class="docutils literal">objectify.set_default_parser()</tt></p>
-</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id340">
-<h1>2.0.3 (2008-03-26)</h1>
-<div class="section" id="id341">
-<h2>Features added</h2>
-<ul class="simple">
-<li>soupparser.parse() allows passing keyword arguments on to
-BeautifulSoup.</li>
-<li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
-</ul>
-</div>
-<div class="section" id="id342">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
-<tt class="docutils literal">&lt;br&gt;</tt>).</li>
-<li>Handle entity replacements correctly in target parser.</li>
-<li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
-<li>The BeautifulSoup parser (soupparser.py) did not replace entities,
-which made them turn up in text content.</li>
-<li>Attribute assignment of custom PyTypes in objectify could fail to
-correctly serialise the value to a string.</li>
-</ul>
-</div>
-<div class="section" id="id343">
-<h2>Other changes</h2>
-<ul class="simple">
-<li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
-<tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
-remains for compatibility with ElementTree's own ElementSoup module.</li>
-<li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
-build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
-<tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
-<li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
-override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
-compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
-option.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id344">
-<h1>2.0.2 (2008-02-22)</h1>
-<div class="section" id="id345">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
-the filename of the file(-like) object.</li>
-</ul>
-</div>
-<div class="section" id="id346">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The prefix for objectify's pytype namespace was missing from the set
-of default prefixes.</li>
-<li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
-<li>Error type names in RelaxNG were reported incorrectly.</li>
-<li>Slice deletion bug fixed in objectify.</li>
-</ul>
-</div>
-<div class="section" id="id347">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
-<li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
-(<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
-<li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
-<tt class="docutils literal">base_url</tt> argument.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id348">
-<h1>2.0.1 (2008-02-13)</h1>
-<div class="section" id="id349">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
-<li>Loads of new docstrings reflect the signature of functions and
-methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
-</ul>
-</div>
-<div class="section" id="id350">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
-<tt class="docutils literal">lxml.htmlbuilder</tt></li>
-<li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
-was an unnamed input field.  Now unnamed input fields are completely
-ignored.</li>
-<li>Setting an element slice in objectify could insert slice-overlapping
-elements at the wrong position.</li>
-</ul>
-</div>
-<div class="section" id="id351">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The generated API documentation was cleaned up and disburdened from
-non-public classes etc.</li>
-<li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
-<tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
-you want to use it, feel free to copy it over to your own source
-base.</li>
-<li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
-override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
-compiler options.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id352">
-<h1>2.0 (2008-02-01)</h1>
-<div class="section" id="id353">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Passing the <tt class="docutils literal">unicode</tt> type as <tt class="docutils literal">encoding</tt> to <tt class="docutils literal">tostring()</tt> will
-serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
-deprecated.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
-<li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
-parser with the usual objectify setup.</li>
-<li>Plain ASCII XPath string results are no longer forced into unicode
-objects as in 2.0beta1, but are returned as plain strings as before.</li>
-<li>All XPath string results are 'smart' objects that have a
-<tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
-<li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
-<li>More accurate exception messages in validator creation.</li>
-<li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
-<li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
-selection make their Element container accessible through a
-<tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
-unicode objects (even ASCII strings).</li>
-<li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
-copy if they were not created in that thread.</li>
-<li>Invalid entity names and character references will be rejected by
-the <tt class="docutils literal">Entity()</tt> factory.</li>
-<li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
-e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
-<li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
-in ET 1.3)</li>
-<li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
-<li>ElementTree compatible TreeBuilder class.</li>
-<li>Use default prefixes for some common XML namespaces.</li>
-<li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
-two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
-more general <tt class="docutils literal">allow_element(el)</tt>.</li>
-<li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
-etree and in objectify</li>
-<li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
-resolving a document as string data.</li>
-<li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
-<tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
-the special checking for one test.</li>
-<li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
-The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
-<tt class="docutils literal">error_log</tt>.</li>
-<li>The normal parsers and the feed parser interface are now separated
-and can be used concurrently on the same parser instance.</li>
-<li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
-ElementTree 1.3</li>
-<li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
-parsing with the HTML parser (note that this interface may be
-subject to change)</li>
-<li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
-of the parsed documents.</li>
-<li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
-<li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
-types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
-<li><tt class="docutils literal">ET.write()</tt>, <tt class="docutils literal">tostring()</tt> and <tt class="docutils literal">tounicode()</tt> now accept a keyword
-argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
-serialise as XML, HTML or plain text content.</li>
-<li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
-<tt class="docutils literal">findall()</tt></li>
-<li><tt class="docutils literal">itertext()</tt> method on Elements</li>
-<li>Setting a QName object as value of the .text property or as an attribute
-will resolve its prefix in the respective context</li>
-<li>ElementTree-like parser target interface as described in
-<a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
-<li>ElementTree-like feed parser interface on XMLParser and HTMLParser
-(<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
-<li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
-integration with objectify.  Provides extended type support based on
-registered PyTypes.</li>
-<li>XSLT objects now support deep copying</li>
-<li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
-subelement straight with text, tail and attributes.</li>
-<li>XPath extension functions can now access the current context node
-(<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
-(<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
-parameter</li>
-<li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
-<li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
-doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
-<tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
-<li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
-selectors.</li>
-<li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
-treatment.</li>
-<li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
-instance and no longer global.</li>
-<li>Schematron validation (incomplete in libxml2)</li>
-<li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
-conversion function to strings to support setting text values from arbitrary
-types.</li>
-<li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
-parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
-False to keep entities in the document.</li>
-<li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
-<li>Error specific messages in XPath parsing and evaluation
-NOTE: for evaluation errors, you will now get an XPathEvalError instead of
-an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
-<li>The regular expression functions in XPath now support passing a node-set
-instead of a string</li>
-<li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
-<li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
-</ul>
-</div>
-<div class="section" id="id354">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
-<li>Some Python 2.4-isms prevented lxml from building/running under
-Python 2.3.</li>
-<li>XPath on ElementTrees could crash when selecting the virtual root
-node of the ElementTree.</li>
-<li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
-<li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
-<li>Minor bugs in XSLT error message formatting.</li>
-<li>Result document memory leak in target parser.</li>
-<li>Target parser failed to report comments.</li>
-<li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal">&lt;object&gt;</tt>
-tags weren't recognized.  (Note: plugin-specific link parameters
-still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
-standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
-<li>Using custom resolvers on XSLT stylesheets parsed from a string
-could request ill-formed URLs.</li>
-<li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal">&lt;tag <span class="pre">xmlns=&quot;...&quot;&gt;</span></tt> in your
-output, it will then be namespace-neutral (before the ellipsis was
-treated as a real namespace).</li>
-<li>AttributeError in feed parser on parse errors</li>
-<li>XML feed parser setup problem</li>
-<li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
-<li>lxml failed to serialise namespace declarations of elements other than the
-root node of a tree</li>
-<li>Race condition in XSLT where the resolver context leaked between concurrent
-XSLT calls</li>
-<li>lxml.etree did not check tag/attribute names</li>
-<li>The XML parser did not report undefined entities as error</li>
-<li>The text in exceptions raised by XML parsers, validators and XPath
-evaluators now reports the first error that occurred instead of the last</li>
-<li>Passing '' as XPath namespace prefix did not raise an error</li>
-<li>Thread safety in XPath evaluators</li>
-</ul>
-</div>
-<div class="section" id="id355">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>Exceptions carry only the part of the error log that is related to
-the operation that caused the error.</li>
-<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
-file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
-<li>The test suite now skips most doctests under Python 2.3.</li>
-<li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
-realclean</tt> instead)</li>
-<li>Minor performance tweaks for Element instantiation and subelement
-creation</li>
-<li>Various places in the XPath, XSLT and iteration APIs now require
-keyword-only arguments.</li>
-<li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
-match the order used in all other iteration methods.  The second
-argument ('preceding') is now a keyword-only argument.</li>
-<li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
-reverted to return an iterator as it did in lxml 1.x.  The ET API
-specification allows it to return either a sequence or an iterator,
-and it traditionally returned a sequence in ET and an iterator in
-lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
-method, which should be used in new code wherever possible.</li>
-<li>The 'pretty printed' serialisation of ElementTree objects now
-inserts newlines at the root level between processing instructions,
-comments and the root tag.</li>
-<li>A 'pretty printed' serialisation is now terminated with a newline.</li>
-<li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
-required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
-<li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
-<li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
-&quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
-Pyrex commonly handles package imports.  The main effect is that
-classes now know about their fully qualified class name, including
-the package name of their module.</li>
-<li>Keyword-only arguments in some API functions, especially in the
-parsers and serialisers.</li>
-<li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
-between HTML tags and XML tags based on the parser that was used to
-parse or create them.  HTML tags no longer reject any non-ASCII
-characters in tag names but only spaces and the special characters
-<tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
-<li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
-(which can crash on certain XPath errors)</li>
-<li>Type annotation in objectify now preserves the already annotated type by
-default to prevent losing type information that is already there.</li>
-<li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
-an iterator (ElementTree 1.3 compatible behaviour)</li>
-<li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
-<li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
-original name is still available as alias</li>
-<li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
-generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
-<li>Major refactoring in XPath/XSLT extension function code</li>
-<li>Network access in parsers disabled by default</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id356">
-<h1>1.3.6 (2007-10-29)</h1>
-<div class="section" id="id357">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Backported decref crash fix from 2.0</li>
-<li>Well hidden free-while-in-use crash bug in ObjectPath</li>
-</ul>
-</div>
-<div class="section" id="id358">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
-methods.  While this makes them take a lot longer to run, it also
-makes it easier to link a specific test to garbage collection
-problems that would otherwise appear in later tests.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id359">
-<h1>1.3.5 (2007-10-22)</h1>
-<div class="section" id="id360">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id361">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>lxml.etree could crash when adding more than 10000 namespaces to a
-document</li>
-<li>lxml failed to serialise namespace declarations of elements other
-than the root node of a tree</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id362">
-<h1>1.3.4 (2007-08-30)</h1>
-<div class="section" id="id363">
-<h2>Features added</h2>
-<ul class="simple">
-<li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
-<tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
-creates.</li>
-<li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
-and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
-subset of the document respectively.</li>
-<li>Serialising an ElementTree now includes any internal DTD subsets that are
-part of the document, as well as comments and PIs that are siblings of the
-root node.</li>
-</ul>
-</div>
-<div class="section" id="id364">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
-</ul>
-</div>
-<div class="section" id="id365">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>lxml now raises a TagNameWarning about tag names containing ':' instead of
-an Error as 1.3.3 did.  The reason is that a number of projects currently
-misuse the previous lack of tag name validation to generate namespace
-prefixes without declaring namespaces.  Apart from the danger of generating
-broken XML this way, it also breaks most of the namespace-aware tools in
-XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
-support this bug with a Warning, while lxml 2.0 will be strict about
-well-formed tag names (not only regarding ':').</li>
-<li>Serialising an Element no longer includes its comment and PI siblings (only
-ElementTree serialisation includes them).</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id366">
-<h1>1.3.3 (2007-07-26)</h1>
-<div class="section" id="id367">
-<h2>Features added</h2>
-<ul class="simple">
-<li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
-instructions and comments while parsing XML</li>
-<li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
-<li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
-the parser you pass.</li>
-<li>Support <tt class="docutils literal">base_url</tt> keyword argument in <tt class="docutils literal">HTML()</tt> and <tt class="docutils literal">XML()</tt></li>
-</ul>
-</div>
-<div class="section" id="id368">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parsing from Python Unicode strings failed on some platforms</li>
-<li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
-<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
-<tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id369">
-<h1>1.3.2 (2007-07-03)</h1>
-<div class="section" id="id370">
-<h2>Features added</h2>
-</div>
-<div class="section" id="id371">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>&quot;deallocating None&quot; crash bug</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id372">
-<h1>1.3.1 (2007-07-02)</h1>
-<div class="section" id="id373">
-<h2>Features added</h2>
-<ul class="simple">
-<li>objectify.DataElement now supports setting values from existing data
-elements (not just plain Python types) and reuses defined namespaces etc.</li>
-<li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
-</ul>
-</div>
-<div class="section" id="id374">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Better way to prevent crashes in Element proxy cleanup code</li>
-<li>objectify.DataElement didn't set up None value correctly</li>
-<li>objectify.DataElement didn't check the value against the provided type hints</li>
-<li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id375">
-<h1>1.3 (2007-06-24)</h1>
-<div class="section" id="id376">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
-scheme that can access the entire tree in read-only mode to help determining
-a suitable Element class</li>
-<li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
-<li><tt class="docutils literal">parse()</tt> function in <tt class="docutils literal">objectify</tt>, corresponding to <tt class="docutils literal">XML()</tt> etc.</li>
-<li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
-adding processing instructions and comments around the root node</li>
-<li><tt class="docutils literal">Element.attrib</tt> was missing <tt class="docutils literal">clear()</tt> and <tt class="docutils literal">pop()</tt> methods</li>
-<li>Extended type annotation in objectify: cleaner annotation namespace setup
-plus new <tt class="docutils literal">deannotate()</tt> function</li>
-<li>Support for custom Element class instantiation in lxml.sax: passing a
-<tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
-lookup context of that function</li>
-<li>'.' represents empty ObjectPath (identity)</li>
-<li><tt class="docutils literal">Element.values()</tt> to accompany the existing <tt class="docutils literal">.keys()</tt> and <tt class="docutils literal">.items()</tt></li>
-<li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
-keys/values/items for a libxml2 node</li>
-<li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
-<li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
-<li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
-<li>Support for pickling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
-<li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
-<li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
-a better handling of namespaces when moving elements between documents.</li>
-</ul>
-</div>
-<div class="section" id="id377">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Removing Elements from a tree could make them lose their namespace
-declarations</li>
-<li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
-<li>Replacing the children slice of an Element would cut off the tails of the
-original children</li>
-<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
-<tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
-<li>API functions now check incoming strings for XML conformity.  Zero bytes or
-low ASCII characters are no longer accepted (AssertionError).</li>
-<li>XSLT parsing failed to pass resolver context on to imported documents</li>
-<li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
-<li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
-<li>More ET compatible behaviour when writing out XML declarations or not</li>
-<li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
-<li>Documents lost their top-level PIs and comments on serialisation</li>
-<li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
-PIs are copied.</li>
-<li>Possible memory leaks in namespace handling when moving elements between
-documents</li>
-</ul>
-</div>
-<div class="section" id="id378">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>major restructuring in the documentation</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id379">
-<h1>1.2.1 (2007-02-27)</h1>
-<div class="section" id="id380">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Build fixes for MS compiler</li>
-<li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
-<li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
-to access</li>
-<li>The pattern for attribute names in ObjectPath was too restrictive</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id381">
-<h1>1.2 (2007-02-20)</h1>
-<div class="section" id="id382">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Rich comparison of QName objects</li>
-<li>Support for regular expressions in benchmark selection</li>
-<li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
-<li>ElementInclude Python module for ElementTree compatible XInclude processing
-that honours custom resolvers registered with the source document</li>
-<li>ElementTree.parser property holds the parser used to parse the document</li>
-<li>setup.py has been refactored for greater readability and flexibility</li>
-<li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
-runtime search paths has been renamed to --auto-rpath. This makes it
-possible to pass an --rpath directly to distutils; previously this was being
-shadowed.</li>
-</ul>
-</div>
-<div class="section" id="id383">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Element instantiation now uses locks to prevent race conditions with threads</li>
-<li>ElementTree.write() did not raise an exception when the file was not writable</li>
-<li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
-support in these environments</li>
-<li>Element.find*() did not accept QName objects as path</li>
-</ul>
-</div>
-<div class="section" id="id384">
-<h2>Other changes</h2>
-<ul class="simple">
-<li>code cleanup: redundant _NodeBase super class merged into _Element class
-Note: although the impact should be zero in most cases, this change breaks
-the compatibility of the public C-API</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id385">
-<h1>1.1.2 (2006-10-30)</h1>
-<div class="section" id="id386">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Data elements in objectify support repr(), which is now used by dump()</li>
-<li>Source distribution now ships with a patched Pyrex</li>
-<li>New C-API function makeElement() to create new elements with text,
-tail, attributes and namespaces</li>
-<li>Reuse original parser flags for XInclude</li>
-<li>Simplified support for handling XSLT processing instructions</li>
-</ul>
-</div>
-<div class="section" id="id387">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Parser resources were not freed before the next parser run</li>
-<li>Open files and XML strings returned by Python resolvers were not
-closed/freed</li>
-<li>Crash in the IDDict returned by XMLDTDID</li>
-<li>Copying Comments and ProcessingInstructions failed</li>
-<li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
-<li>Memory leak when garbage collecting tailed root elements</li>
-<li>HTML script/style content was not propagated to .text</li>
-<li>Show text xincluded between text nodes correctly in .text and .tail</li>
-<li>'integer * objectify.StringElement' operation was not supported</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id388">
-<h1>1.1.1 (2006-09-21)</h1>
-<div class="section" id="id389">
-<h2>Features added</h2>
-<ul class="simple">
-<li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
-<li>countchildren() method on objectify.ObjectifiedElement</li>
-<li>Support custom elements for tree nodes in lxml.objectify</li>
-</ul>
-</div>
-<div class="section" id="id390">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
-<li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
-<li>Factories objectify.Element() and objectify.DataElement() were missing
-<tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
-<li>Changing the default parser in lxml.objectify did not update the factories
-Element() and DataElement()</li>
-<li>Let lxml.objectify.Element() always generate tree elements (not data
-elements)</li>
-<li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id391">
-<h1>1.1 (2006-09-13)</h1>
-<div class="section" id="id392">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
-'&lt;?pi-target content?&gt;' for repr()</li>
-<li>Parsers are now the preferred (and default) place where element class lookup
-schemes should be registered.  Namespace lookup is no longer supported by
-default.</li>
-<li>Support for Python 2.5 beta</li>
-<li>Unlock the GIL for deep copying documents and for XPath()</li>
-<li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
-<li>Support for parser options in iterparse()</li>
-<li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
-tuples</li>
-<li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
-exception</li>
-<li>XML-Object API on top of lxml (lxml.objectify)</li>
-<li>Customizable Element class lookup:<ul>
-<li>different pre-implemented lookup mechanisms</li>
-<li>support for externally provided lookup functions</li>
-</ul>
-</li>
-<li>Support for processing instructions (ET-like, not compatible)</li>
-<li>Public C-level API for independent extension modules</li>
-<li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
-<li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
-documentation for differences)</li>
-<li>Element.nsmap property returns a mapping of all namespace prefixes known at
-the Element to their namespace URI</li>
-<li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
-<li>Threading support in parsers and serializers:<ul>
-<li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
-<li>File operations (on file names) free the GIL</li>
-<li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
-<li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
-</ul>
-</li>
-<li>Element iteration over XPath axes:<ul>
-<li>Element.iterdescendants() iterates over the descendants of an element</li>
-<li>Element.iterancestors() iterates over the ancestors of an element (from
-parent to parent)</li>
-<li>Element.itersiblings() iterates over either the following or preceding
-siblings of an element</li>
-<li>Element.iterchildren() iterates over the children of an element in either
-direction</li>
-<li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
-generated elements</li>
-</ul>
-</li>
-<li>Element.getnext() and Element.getprevious() return the direct siblings of an
-element</li>
-</ul>
-</div>
-<div class="section" id="id393">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>filenames with local 8-bit encoding were not supported</li>
-<li>1.1beta did not compile under Python 2.3</li>
-<li>ignore unknown 'pyval' attribute values in objectify</li>
-<li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
-<li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
-<li>XPathSyntaxError now inherits from XPathError</li>
-<li>Threading race conditions in RelaxNG and XMLSchema</li>
-<li>Crash when mixing elements from XSLT results into other trees, concurrent
-XSLT is only allowed when the stylesheet was parsed in the main thread</li>
-<li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
-differences in the regular expression syntax)</li>
-<li>Setting element.text to '' returned None on request, not the empty string</li>
-<li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
-<li>Creating documents no longer copies the parser for later URL resolving.  For
-performance reasons, only a reference is kept.  Resolver updates on the
-parser will now be reflected by documents that were parsed before the
-change.  Although this should rarely become visible, it is a behavioral
-change from 1.0.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id394">
-<h1>1.0.4 (2006-09-09)</h1>
-<div class="section" id="id395">
-<h2>Features added</h2>
-<ul class="simple">
-<li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
-</ul>
-</div>
-<div class="section" id="id396">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
-</ul>
-</div>
-</div>
-<div class="section" id="id397">
-<h1>1.0.3 (2006-08-08)</h1>
-<div class="section" id="id398">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Element.replace(old, new) method to replace a subelement by another one</li>
-</ul>
-</div>
-<div class="section" id="id399">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Crash when mixing elements from XSLT results into other trees</li>
-<li>Copying/deepcopying did not work for ElementTree objects</li>
-<li>Setting an attribute to a non-string value did not raise an exception</li>
-<li>Element.remove() deleted the tail text from the removed Element</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id400">
-<h1>1.0.2 (2006-06-27)</h1>
-<div class="section" id="id401">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for setting a custom default Element class as opposed to namespace
-specific classes (which still override the default class)</li>
-</ul>
-</div>
-<div class="section" id="id402">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Rare exceptions in Python list functions were not handled</li>
-<li>Parsing accepted unicode strings with XML encoding declaration in certain
-cases</li>
-<li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
-<li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
-<li>XSLT and parser exception messages include the error line number</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id403">
-<h1>1.0.1 (2006-06-09)</h1>
-<div class="section" id="id404">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Repeated calls to Element.attrib now efficiently return the same instance</li>
-</ul>
-</div>
-<div class="section" id="id405">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Document deallocation could crash in certain garbage collection scenarios</li>
-<li>Extension function calls in XSLT variable declarations could break the
-stylesheet and crash on repeated calls</li>
-<li>Deep copying Elements could lose namespaces declared in parents</li>
-<li>Deep copying Elements did not copy tail</li>
-<li>Parsing file(-like) objects failed to load external entities</li>
-<li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
-<li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
-<li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
-<li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id406">
-<h1>1.0 (2006-06-01)</h1>
-<div class="section" id="id407">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Element.getiterator() and the findall() methods support finding arbitrary
-elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
-<li>Another speedup in tree iteration code</li>
-<li>General speedup of Python Element object creation and deallocation</li>
-<li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
-<li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
-<li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
-document that contains the element.</li>
-<li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
-find the element in the tree structure</li>
-<li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
-<li>Comment texts can be changed through the API</li>
-<li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
-<li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
-<li>ElementTree.write() no longer serializes in memory (reduced memory
-footprint)</li>
-<li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
-<li>Support for writing the XML representation of Elements and ElementTrees to
-Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
-<li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
-<li>Parsing a unicode string no longer copies the string (reduced memory
-footprint)</li>
-<li>Parsing file-like objects reads chunks rather than the whole file (reduced
-memory footprint)</li>
-<li>Parsing StringIO objects from the start avoids copying the string (reduced
-memory footprint)</li>
-<li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
-information, original encoding and XML version as seen by the parser</li>
-<li>etree module can be compiled without libxslt by commenting out the line
-<tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
-<li>Better error messages in parser exceptions</li>
-<li>Error reporting also works in XSLT</li>
-<li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
-resolvers are registered at parser level</li>
-<li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
-enabled by default, can be switched off with 'regexp=False' keyword argument</li>
-<li>Support for exslt extensions (libexslt) and libxslt extra functions
-(node-set, document, write, output)</li>
-<li>Substantial speedup in XPath.evaluate()</li>
-<li>HTMLParser for parsing (broken) HTML</li>
-<li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
-implementation of libxml2 (as opposed to ET compatible XMLID)</li>
-</ul>
-</div>
-<div class="section" id="id408">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory leak in Element.__setitem__</li>
-<li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
-<li>Memory leak in XPath extension functions</li>
-<li>Memory leak in unicode related setup code</li>
-<li>Element now raises ValueError on empty tag names</li>
-<li>Namespace fixing after moving elements between documents could fail if the
-source document was freed too early</li>
-<li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
-didn't reset the namespace</li>
-<li>Unknown constants from newer libxml2 versions could raise exceptions in the
-error handlers</li>
-<li>lxml.etree compiles much faster</li>
-<li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
-in certain cases</li>
-<li>Document reference in ElementTree objects was not updated when the root
-element was moved to a different document</li>
-<li>Running absolute XPath expressions on an Element now evaluates against the
-root tree</li>
-<li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
-<li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
-objects</li>
-<li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
-<tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
-<li>Memory leak when using iconv encoders in tostring/write</li>
-<li>Deep copying Elements and ElementTrees maintains the document information</li>
-<li>Serialization functions raise LookupError for unknown encodings</li>
-<li>Memory deallocation crash resulting from deep copying elements</li>
-<li>Some ElementTree methods could crash if the root node was not initialized
-(neither file nor element passed to the constructor)</li>
-<li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
-dictionary</li>
-<li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
-<li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
-<li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
-ElementTree root node as reference point</li>
-<li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id409">
-<h1>0.9.2 (2006-05-10)</h1>
-<div class="section" id="id410">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Speedup for Element.makeelement(): the new element reuses the original
-libxml2 document instead of creating a new empty one</li>
-<li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
-<li>ElementTree compatible QName class</li>
-<li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
-</ul>
-</div>
-<div class="section" id="id411">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
-<li>Memory leak if write_c14n fails to write the file after conversion</li>
-<li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
-<li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id412">
-<h1>0.9.1 (2006-03-30)</h1>
-<div class="section" id="id413">
-<h2>Features added</h2>
-<ul class="simple">
-<li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
-SaxError on mismatch</li>
-<li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
-(startElement, endElement) and defaults to empty attributes (keyword
-argument)</li>
-<li>Speedup for repeatedly accessing element tag names</li>
-<li>Minor API performance improvements</li>
-</ul>
-</div>
-<div class="section" id="id414">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
-<li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
-<li>lxml.tests package will no longer be installed (is still in source tar)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id415">
-<h1>0.9 (2006-03-20)</h1>
-<div class="section" id="id416">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Error logging API for libxml2 error messages</li>
-<li>Various performance improvements</li>
-<li>Benchmark script for lxml, ElementTree and cElementTree</li>
-<li>Support for registering extension functions through new FunctionNamespace
-class (see doc/extensions.txt)</li>
-<li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
-<li>Support for variables in XPath expressions (also in XPath class)</li>
-<li>XPath class for compiled XPath expressions</li>
-<li>XMLID module level function (ElementTree compatible)</li>
-<li>XMLParser API for customized libxml2 parser configuration</li>
-<li>Support for custom Element classes through new Namespace API (see
-doc/namespace_extensions.txt)</li>
-<li>Common exception base class LxmlError for module exceptions</li>
-<li>real iterator support in iter(Element), Element.getiterator()</li>
-<li>XSLT objects are callable, result trees support str()</li>
-<li>Added MANIFEST.in for easier creation of RPM files.</li>
-<li>'getparent' method on elements allows navigation to an element's
-parent element.</li>
-<li>Python core compatible SAX tree builder and SAX event generator. See
-doc/sax.txt for more information.</li>
-</ul>
-</div>
-<div class="section" id="id417">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Segfaults and memory leaks in various API functions of Element</li>
-<li>Segfault in XSLT.tostring()</li>
-<li>ElementTree objects no longer interfere, Elements can be root of different
-ElementTrees at the same time</li>
-<li>document('') works in XSLT documents read from files (in-memory documents
-cannot support this due to libxslt deficiencies)</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id418">
-<h1>0.8 (2005-11-03)</h1>
-<div class="section" id="id419">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Support for copy.deepcopy() on elements. copy.copy() works also, but
-does the same thing, and does <em>not</em> create a shallow copy, as that
-makes no sense in the context of libxml2 trees. This means a
-potential incompatibility with ElementTree, but there's more chance
-that it works than if copy.copy() isn't supported at all.</li>
-<li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
-supported and parsing of gzipped XML files works.</li>
-<li>implemented index() on elements, allowing one to find the index of a
-SubElement.</li>
-</ul>
-</div>
-<div class="section" id="id420">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Use xslt-config instead of xml2-config to find out libxml2
-directories to take into account a case where libxslt is installed
-in a different directory than libxslt.</li>
-<li>Eliminate crash condition in iteration when text nodes are changed.</li>
-<li>Passing 'None' to tostring() does not result in a segfault anymore,
-but an AssertionError.</li>
-<li>Some test fixes for Windows.</li>
-<li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
-syntax errors. This should be less confusing.</li>
-<li>Fixed error with uncaught exception in Pyrex code.</li>
-<li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
-segfault.</li>
-<li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
-<li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
-libxml2 version, as it should.</li>
-<li>Passing a UTF-8 encoded string to the XML() function would fail;
-fixed.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id421">
-<h1>0.7 (2005-06-15)</h1>
-<div class="section" id="id422">
-<h2>Features added</h2>
-<ul class="simple">
-<li>parameters (XPath expressions) can be passed to XSLT using keyword
-parameters.</li>
-<li>Simple XInclude support. Calling the xinclude() method on a tree
-will process any XInclude statements in the document.</li>
-<li>XMLSchema support. Use the XMLSchema class or the convenience
-xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
-<li>Added convenience xslt() method on tree. This is less efficient
-than the XSLT object, but makes it easier to write quick code.</li>
-<li>Added convenience relaxng() method on tree. This is less efficient
-than the RelaxNG object, but makes it easier to write quick code.</li>
-<li>Make it possible to use XPathEvaluator with elements as well. The
-XPathEvaluator in this case will retain the element so multiple
-XPath queries can be made against one element efficiently. This
-replaces the second argument to the .evaluate() method that existed
-previously.</li>
-<li>Allow registerNamespace() to be called on an XPathEvaluator, after
-creation, to add additional namespaces. Also allow registerNamespaces(),
-which does the same for a namespace dictionary.</li>
-<li>Add 'prefix' attribute to element to be able to read prefix information.
-This is entirely read-only.</li>
-<li>It is possible to supply an extra nsmap keyword parameter to
-the Element() and SubElement() constructors, which supplies a
-prefix to namespace URI mapping. This will create namespace
-prefix declarations on these elements and these prefixes will show up
-in XML serialization.</li>
-</ul>
-</div>
-<div class="section" id="id423">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Killed yet another memory management related bug: trees created
-using newDoc would not get a libxml2-level dictionary, which caused
-problems when deallocating these documents later if they contained a
-node that came from a document with a dictionary.</li>
-<li>Moving namespaced elements between documents was problematic as
-references to the original document would remain. This has been fixed
-by applying xmlReconciliateNs() after each move operation.</li>
-<li>Can pass None to 'dump()' without segfaults.</li>
-<li>tostring() works properly for non-root elements as well.</li>
-<li>Cleaned out the tostring() method so it should handle encoding
-correctly.</li>
-<li>Cleaned out the ElementTree.write() method so it should handle encoding
-correctly. Writing directly to a file should also be faster, as there is no
-need to go through a Python string in that case. Made sure the test cases
-test both serializing to StringIO as well as serializing to a real file.</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id424">
-<h1>0.6 (2005-05-14)</h1>
-<div class="section" id="id425">
-<h2>Features added</h2>
-<ul class="simple">
-<li>Changed setup.py so that library_dirs is also guessed. This should
-help with compilation on the Mac OS X platform, where otherwise the
-wrong library (shipping with the OS) could be picked up.</li>
-<li>Tweaked setup.py so that it picks up the version from version.txt.</li>
-</ul>
-</div>
-<div class="section" id="id426">
-<h2>Bugs fixed</h2>
-<ul class="simple">
-<li>Do the right thing when handling namespaced attributes.</li>
-<li>fix bug where tostring() moved nodes into new documents. tostring()
-had very nasty side-effects before this fix, sorry!</li>
-</ul>
-</div>
-</div>
-<div class="section" id="id427">
-<h1>0.5.1 (2005-04-09)</h1>
-<ul class="simple">
-<li>Python 2.2 compatibility fixes.</li>
-<li>unicode fixes in Element() and Comment() as well as XML(); unicode
-input wasn't properly being UTF-8 encoded.</li>
-</ul>
-</div>
-<div class="section" id="id428">
-<h1>0.5 (2005-04-08)</h1>
-<p>Initial public release.</p>
-</div>
-</div>
-<div class="footer">
-<hr class="footer" />
-Generated on: 2020-10-18.
-
-</div>
-</body>
-</html>
diff --git a/doc/html/changes-4.6.2.html b/doc/html/changes-4.6.2.html
new file mode 100644 (file)
index 0000000..2b7171b
--- /dev/null
@@ -0,0 +1,3701 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Docutils 0.16: http://docutils.sourceforge.net/" />
+<title>lxml changelog</title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+</head>
+<body>
+<div class="document" id="lxml-changelog">
+<h1 class="title">lxml changelog</h1>
+
+<div class="section" id="id1">
+<h1>4.6.2 (2020-11-26)</h1>
+<div class="section" id="bugs-fixed">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>A vulnerability (CVE-2020-27783) was discovered in the HTML Cleaner by Yaniv Nizry,
+which allowed JavaScript to pass through.  The cleaner now removes more sneaky
+&quot;style&quot; content.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id2">
+<h1>4.6.1 (2020-10-18)</h1>
+<div class="section" id="id3">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>A vulnerability was discovered in the HTML Cleaner by Yaniv Nizry, which allowed
+JavaScript to pass through.  The cleaner now removes more sneaky &quot;style&quot; content.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id4">
+<h1>4.6.0 (2020-10-17)</h1>
+<div class="section" id="features-added">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/310">GH#310</a>: <tt class="docutils literal">lxml.html.InputGetter</tt> supports <tt class="docutils literal">__len__()</tt> to count the number of input fields.
+Patch by Aidan Woolley.</li>
+<li><tt class="docutils literal">lxml.html.InputGetter</tt> has a new <tt class="docutils literal">.items()</tt> method to ease processing all input fields.</li>
+<li><tt class="docutils literal">lxml.html.InputGetter.keys()</tt> now returns the field names in document order.</li>
+<li>GH-309: The API documentation is now generated using <tt class="docutils literal"><span class="pre">sphinx-apidoc</span></tt>.
+Patch by Chris Mayo.</li>
+</ul>
+</div>
+<div class="section" id="id5">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1869455">LP#1869455</a>: C14N 2.0 serialisation failed for unprefixed attributes
+when a default namespace was defined.</li>
+<li><tt class="docutils literal">TreeBuilder.close()</tt> raised <tt class="docutils literal">AssertionError</tt> in some error cases where it
+should have raised <tt class="docutils literal">XMLSyntaxError</tt>.  It now raises a combined exception to
+keep up backwards compatibility, while switching to <tt class="docutils literal">XMLSyntaxError</tt> as an
+interface.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id6">
+<h1>4.5.2 (2020-07-09)</h1>
+<div class="section" id="id7">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">Cleaner()</tt> now validates that only known configuration options can be set.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1882606">LP#1882606</a>: <tt class="docutils literal">Cleaner.clean_html()</tt> discarded comments and PIs regardless of the
+corresponding configuration option, if <tt class="docutils literal">remove_unknown_tags</tt> was set.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1880251">LP#1880251</a>: Instead of globally overwriting the document loader in libxml2, lxml now
+sets it per parser run, which improves the interoperability with other users of libxml2
+such as libxmlsec.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1881960">LP#1881960</a>: Fix build in CPython 3.10 by using Cython 0.29.21.</li>
+<li>The setup options &quot;--with-xml2-config&quot; and &quot;--with-xslt-config&quot; were accidentally renamed
+to &quot;--xml2-config&quot; and &quot;--xslt-config&quot; in 4.5.1 and are now available again.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id8">
+<h1>4.5.1 (2020-05-19)</h1>
+<div class="section" id="id9">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1570388">LP#1570388</a>: Fix failures when serialising documents larger than 2GB in some cases.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1865141">LP#1865141</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/298">GH#298</a>: <tt class="docutils literal">QName</tt> values were not accepted by the <tt class="docutils literal">el.iter()</tt> method.
+Patch by xmo-odoo.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1863413">LP#1863413</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/297">GH#297</a>: The build failed to detect libraries on Linux that are only
+configured via pkg-config.
+Patch by Hugh McMaster.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id10">
+<h1>4.5.0 (2020-01-29)</h1>
+<div class="section" id="id11">
+<h2>Features added</h2>
+<ul class="simple">
+<li>A new function <tt class="docutils literal">indent()</tt> was added to insert tail whitespace for pretty-printing
+an XML tree.</li>
+</ul>
+</div>
+<div class="section" id="id12">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1857794">LP#1857794</a>: Tail text of nodes that get removed from a document using item
+deletion disappeared silently instead of sticking with the node that was removed.</li>
+</ul>
+</div>
+<div class="section" id="other-changes">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>MacOS builds are 64-bit-only by default.
+Set CFLAGS and LDFLAGS explicitly to override it.</li>
+<li>Linux/MacOS Binary wheels now use libxml2 2.9.10 and libxslt 1.1.34.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1840234">LP#1840234</a>: The package version number is now available as <tt class="docutils literal">lxml.__version__</tt>.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id13">
+<h1>4.4.3 (2020-01-28)</h1>
+<div class="section" id="id14">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1844674">LP#1844674</a>: <tt class="docutils literal">itertext()</tt> was missing tail text of comments and PIs since 4.4.0.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id15">
+<h1>4.4.2 (2019-11-25)</h1>
+<div class="section" id="id16">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1835708">LP#1835708</a>: <tt class="docutils literal">ElementInclude</tt> incorrectly rejected repeated non-recursive
+includes as recursive.
+Patch by Rainer Hausdorf.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id17">
+<h1>4.4.1 (2019-08-11)</h1>
+<div class="section" id="id18">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1838252">LP#1838252</a>: The order of an OrderedDict was lost in 4.4.0 when passing it as
+attrib mapping during element creation.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1838521">LP#1838521</a>: The package metadata now lists the supported Python versions.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id19">
+<h1>4.4.0 (2019-07-27)</h1>
+<div class="section" id="id20">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">Element.clear()</tt> accepts a new keyword argument <tt class="docutils literal">keep_tail=True</tt> to clear
+everything but the tail text.  This is helpful in some document-style use cases
+and for clearing the current element in <tt class="docutils literal">iterparse()</tt> and pull parsing.</li>
+<li>When creating attributes or namespaces from a dict in Python 3.6+, lxml now
+preserves the original insertion order of that dict, instead of always sorting
+the items by name.  A similar change was made for ElementTree in CPython 3.8.
+See <a class="reference external" href="https://bugs.python.org/issue34160">https://bugs.python.org/issue34160</a></li>
+<li>Integer elements in <tt class="docutils literal">lxml.objectify</tt> implement the <tt class="docutils literal">__index__()</tt> special method.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/269">GH#269</a>: Read-only elements in XSLT were missing the <tt class="docutils literal">nsmap</tt> property.
+Original patch by Jan Pazdziora.</li>
+<li>ElementInclude can now restrict the maximum inclusion depth via a <tt class="docutils literal">max_depth</tt>
+argument to prevent content explosion.  It is limited to 6 by default.</li>
+<li>The <tt class="docutils literal">target</tt> object of the XMLParser can have <tt class="docutils literal">start_ns()</tt> and <tt class="docutils literal">end_ns()</tt>
+callback methods to listen to namespace declarations.</li>
+<li>The <tt class="docutils literal">TreeBuilder</tt> has new arguments <tt class="docutils literal">comment_factory</tt> and <tt class="docutils literal">pi_factory</tt> to
+pass factories for creating comments and processing instructions, as well as
+flag arguments <tt class="docutils literal">insert_comments</tt> and <tt class="docutils literal">insert_pis</tt> to discard them from the
+tree when set to false.</li>
+<li>A <a class="reference external" href="https://www.w3.org/TR/xml-c14n2/">C14N 2.0</a> implementation was added as
+<tt class="docutils literal">etree.canonicalize()</tt>, a corresponding <tt class="docutils literal">C14NWriterTarget</tt> class, and
+a <tt class="docutils literal">c14n2</tt> serialisation method.</li>
+</ul>
+</div>
+<div class="section" id="id21">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When writing to file paths that contain the URL escape character '%', the file
+path could wrongly be mangled by URL unescaping and thus write to a different
+file or directory.  Code that writes to file paths that are provided by untrusted
+sources, but that must work with previous versions of lxml, should best either
+reject paths that contain '%' characters, or otherwise make sure that the path
+does not contain maliciously injected '%XX' URL hex escapes for paths like '../'.</li>
+<li>Assigning to Element child slices with negative step could insert the slice at
+the wrong position, starting too far on the left.</li>
+<li>Assigning to Element child slices with overly large step size could take very
+long, regardless of the length of the actual slice.</li>
+<li>Assigning to Element child slices of the wrong size could sometimes fail to
+raise a ValueError (like a list assignment would) and instead assign outside
+of the original slice bounds or leave parts of it unreplaced.</li>
+<li>The <tt class="docutils literal">comment</tt> and <tt class="docutils literal">pi</tt> events in <tt class="docutils literal">iterwalk()</tt> were never triggered, and
+instead, comments and processing instructions in the tree were reported as
+<tt class="docutils literal">start</tt> elements.  Also, when walking an ElementTree (as opposed to its root
+element), comments and PIs outside of the root element are now reported.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1827833">LP#1827833</a>: The RelaxNG compact syntax support was broken with recent versions
+of <tt class="docutils literal">rnc2rng</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1758553">LP#1758553</a>: The HTML elements <tt class="docutils literal">source</tt> and <tt class="docutils literal">track</tt> were added to the list
+of empty tags in <tt class="docutils literal">lxml.html.defs</tt>.</li>
+<li>Registering a prefix other than &quot;xml&quot; for the XML namespace is now rejected.</li>
+<li>Failing to write XSLT output to a file could raise a misleading exception.
+It now raises <tt class="docutils literal">IOError</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id22">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Support for Python 3.4 was removed.</li>
+<li>When using <tt class="docutils literal"><span class="pre">Element.find*()</span></tt> with prefix-namespace mappings, the empty string
+is now accepted to define a default namespace, in addition to the previously
+supported <tt class="docutils literal">None</tt> prefix.  Empty strings are more convenient since they keep
+all prefix keys in a namespace dict strings, which simplifies sorting etc.</li>
+<li>The <tt class="docutils literal">ElementTree.write_c14n()</tt> method has been deprecated in favour of the
+long preferred <tt class="docutils literal">ElementTree.write(f, <span class="pre">method=&quot;c14n&quot;)</span></tt>.  It will be removed
+in a future release.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id23">
+<h1>4.3.5 (2019-07-27)</h1>
+<ul class="simple">
+<li>Rebuilt with Cython 0.29.13 to support Python 3.8.</li>
+</ul>
+</div>
+<div class="section" id="id24">
+<h1>4.3.4 (2019-06-10)</h1>
+<ul class="simple">
+<li>Rebuilt with Cython 0.29.10 to support Python 3.8.</li>
+</ul>
+</div>
+<div class="section" id="id25">
+<h1>4.3.3 (2019-03-26)</h1>
+<div class="section" id="id26">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix leak of output buffer and unclosed files in <tt class="docutils literal">_XSLTResultTree.write_output()</tt>.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id27">
+<h1>4.3.2 (2019-02-29)</h1>
+<div class="section" id="id28">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in 4.3.1 when appending a child subtree with certain text nodes.</li>
+</ul>
+</div>
+<div class="section" id="id29">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Built with Cython 0.29.6.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id30">
+<h1>4.3.1 (2019-02-08)</h1>
+<div class="section" id="id31">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1814522">LP#1814522</a>: Crash when appending a child subtree that contains unsubstituted
+entity references.</li>
+</ul>
+</div>
+<div class="section" id="id32">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Built with Cython 0.29.5.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id33">
+<h1>4.3.0 (2019-01-04)</h1>
+<div class="section" id="id34">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The module <tt class="docutils literal">lxml.sax</tt> is compiled using Cython in order to speed it up.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/267">GH#267</a>: <tt class="docutils literal">lxml.sax.ElementTreeProducer</tt> now preserves the namespace prefixes.
+If two prefixes point to the same URI, the first prefix in alphabetical order
+is used.  Patch by Lennart Regebro.</li>
+<li>Updated ISO-Schematron implementation to 2013 version (now MIT licensed)
+and the corresponding schema to the 2016 version (with optional &quot;properties&quot;).</li>
+</ul>
+</div>
+<div class="section" id="id35">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/270">GH#270</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/271">GH#271</a>: Support for Python 2.6 and 3.3 was removed.
+Patch by hugovk.</li>
+<li>The minimum dependency versions were raised to libxml2 2.9.2 and libxslt 1.1.27,
+which were released in 2014 and 2012 respectively.</li>
+<li>Built with Cython 0.29.2.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id36">
+<h1>4.2.6 (2019-01-02)</h1>
+<div class="section" id="id37">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1799755">LP#1799755</a>: Fix a DeprecationWarning in Py3.7+.</li>
+<li>Import warnings in Python 3.6+ were resolved.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id38">
+<h1>4.2.5 (2018-09-09)</h1>
+<div class="section" id="id39">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Javascript URLs that used URL escaping were not removed by the HTML cleaner.
+Security problem found by Omar Eissa.  (CVE-2018-19787)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id40">
+<h1>4.2.4 (2018-08-03)</h1>
+<div class="section" id="id41">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/259">GH#259</a>: Allow using <tt class="docutils literal"><span class="pre">pkg-config</span></tt> for build configuration.
+Patch by Patrick Griffis.</li>
+</ul>
+</div>
+<div class="section" id="id42">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1773749">LP#1773749</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/268">GH#268</a>: Crash when moving an element to another document with
+<tt class="docutils literal">Element.insert()</tt>.
+Patch by Alexander Weggerle.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id43">
+<h1>4.2.3 (2018-06-27)</h1>
+<div class="section" id="id44">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Reverted <a class="reference external" href="https://github.com/lxml/lxml/issues/265">GH#265</a>: lxml links against zlib as a shared library again.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id45">
+<h1>4.2.2 (2018-06-22)</h1>
+<div class="section" id="id46">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/266">GH#266</a>: Fix sporadic crash during GC when parse-time schema validation is used
+and the parser participates in a reference cycle.
+Original patch by Julien Greard.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/265">GH#265</a>: lxml no longer links against zlib as a shared library, only on static builds.
+Patch by Nehal J Wani.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id48">
+<h1>4.2.1 (2018-03-21)</h1>
+<div class="section" id="id49">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1755825">LP#1755825</a>: <tt class="docutils literal">iterwalk()</tt> failed to return the 'start' event for the initial
+element if a tag selector is used.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1756314">LP#1756314</a>: Failure to import 4.2.0 into PyPy due to a missing library symbol.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1727864">LP#1727864</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/258">GH#258</a>: Add &quot;-isysroot&quot; linker option on MacOS as needed by XCode 9.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id50">
+<h1>4.2.0 (2018-03-13)</h1>
+<div class="section" id="id51">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/255">GH#255</a>: <tt class="docutils literal">SelectElement.value</tt> returns more standard-compliant and
+browser-like defaults for non-multi-selects.  If no option is selected, the
+value of the first option is returned (instead of None).  If multiple options
+are selected, the value of the last one is returned (instead of that of the
+first one).  If no options are present (not standard-compliant)
+<tt class="docutils literal">SelectElement.value</tt> still returns <tt class="docutils literal">None</tt>.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/261">GH#261</a>: The <tt class="docutils literal">HTMLParser()</tt> now supports the <tt class="docutils literal">huge_tree</tt> option.
+Patch by stranac.</li>
+</ul>
+</div>
+<div class="section" id="id52">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Some XSLT messages were not captured by the transform error log.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1737825">LP#1737825</a>: Crash at shutdown after an interrupted iterparse run with XMLSchema
+validation.</li>
+</ul>
+</div>
+<div class="section" id="id53">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id54">
+<h1>4.1.1 (2017-11-04)</h1>
+<ul class="simple">
+<li>Rebuild with Cython 0.27.3 to improve support for Py3.7.</li>
+</ul>
+</div>
+<div class="section" id="id55">
+<h1>4.1.0 (2017-10-13)</h1>
+<div class="section" id="id56">
+<h2>Features added</h2>
+<ul class="simple">
+<li>ElementPath supports text predicates for current node, like &quot;[.='text']&quot;.</li>
+<li>ElementPath allows spaces in predicates.</li>
+<li>Custom Element classes and XPath functions can now be registered with a
+decorator rather than explicit dict assignments.</li>
+<li>Static Linux wheels are now built with link time optimisation (LTO) enabled.
+This should have a beneficial impact on the overall performance by providing
+a tighter compiler integration between lxml and libxml2/libxslt.</li>
+</ul>
+</div>
+<div class="section" id="id57">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1722776">LP#1722776</a>: Requesting non-Element objects like comments from a document with
+<tt class="docutils literal">PythonElementClassLookup</tt> could fail with a TypeError.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id58">
+<h1>4.0.0 (2017-09-17)</h1>
+<div class="section" id="id59">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The ElementPath implementation is now compiled using Cython,
+which speeds up the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods quite significantly.</li>
+<li>The modules <tt class="docutils literal">lxml.builder</tt>, <tt class="docutils literal">lxml.html.diff</tt> and <tt class="docutils literal">lxml.html.clean</tt>
+are also compiled using Cython in order to speed them up.</li>
+<li><tt class="docutils literal">xmlfile()</tt> supports async coroutines using <tt class="docutils literal">async with</tt> and <tt class="docutils literal">await</tt>.</li>
+<li><tt class="docutils literal">iterwalk()</tt> has a new method <tt class="docutils literal">skip_subtree()</tt> that prevents walking into
+the descendants of the current element.</li>
+<li><tt class="docutils literal">RelaxNG.from_rnc_string()</tt> accepts a <tt class="docutils literal">base_url</tt> argument to
+allow relative resource lookups.</li>
+<li>The XSLT result object has a new method <tt class="docutils literal">.write_output(file)</tt> that serialises
+output data into a file according to the <tt class="docutils literal">&lt;xsl:output&gt;</tt> configuration.</li>
+</ul>
+</div>
+<div class="section" id="id60">
+<h2>Bugs fixed</h2>
+<ul>
+<li><p class="first"><a class="reference external" href="https://github.com/lxml/lxml/issues/251">GH#251</a>: HTML comments were handled incorrectly by the soupparser.
+Patch by mozbugbox.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1654544">LP#1654544</a>: The html5parser no longer passes the <tt class="docutils literal">useChardet</tt> option
+if the input is a Unicode string, unless explicitly requested.  When parsing
+files, the default is to enable it when a URL or file path is passed (because
+the file is then opened in binary mode), and to disable it when reading from
+a file(-like) object.</p>
+<p>Note: This is a backwards incompatible change of the default configuration.
+If your code parses byte strings/streams and depends on character detection,
+please pass the option <tt class="docutils literal">guess_charset=True</tt> explicitly, which already worked
+in older lxml versions.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1703810">LP#1703810</a>: <tt class="docutils literal">etree.fromstring()</tt> failed to parse UTF-32 data with BOM.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1526522">LP#1526522</a>: Some RelaxNG errors were not reported in the error log.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1567526">LP#1567526</a>: Empty and plain text input raised a TypeError in soupparser.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1710429">LP#1710429</a>: Uninitialised variable usage in HTML diff.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415643">LP#1415643</a>: The closing tags context manager in <tt class="docutils literal">xmlfile()</tt> could continue
+to output end tags even after writing failed with an exception.</p>
+</li>
+<li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1465357">LP#1465357</a>: <tt class="docutils literal">xmlfile.write()</tt> now accepts and ignores None as input argument.</p>
+</li>
+<li><p class="first">Compilation under Py3.7-pre failed due to a modified function signature.</p>
+</li>
+</ul>
+</div>
+<div class="section" id="id61">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The main module source files were renamed from <tt class="docutils literal"><span class="pre">lxml.*.pyx</span></tt> to plain
+<tt class="docutils literal">*.pyx</tt> (e.g. <tt class="docutils literal">etree.pyx</tt>) to simplify their handling in the build
+process.  Care was taken to keep the old header files as fallbacks for
+code that compiles against the public C-API of lxml, but it might still
+be worth validating that third-party code does not notice this change.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id62">
+<h1>3.8.0 (2017-06-03)</h1>
+<div class="section" id="id63">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">ElementTree.write()</tt> has a new option <tt class="docutils literal">doctype</tt> that writes out a
+doctype string before the serialisation, in the same way as <tt class="docutils literal">tostring()</tt>.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1595781">LP#1595781</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/240">GH#240</a>: added a PyCapsule Python API and C-level API for
+passing externally generated libxml2 documents into lxml.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/244">GH#244</a>: error log entries have a new property <tt class="docutils literal">path</tt> with an XPath
+expression (if known, None otherwise) that points to the tree element
+responsible for the error. Patch by Bob Kline.</li>
+<li>The namespace prefix mapping that can be used in ElementPath now injects
+a default namespace when passing a None prefix.</li>
+</ul>
+</div>
+<div class="section" id="id64">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/238">GH#238</a>: Character escapes were not hex-encoded in the <tt class="docutils literal">xmlfile</tt> serialiser.
+Patch by matejcik.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/229">GH#229</a>: fix for externally created XML documents.  Patch by Theodore Dubois.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1665241">LP#1665241</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/228">GH#228</a>: Form data handling in lxml.html no longer strips the
+option values specified in form attributes but only the text values.
+Patch by Ashish Kulkarni.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
+multi-threaded XSLT processing.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
+</ul>
+</div>
+<div class="section" id="id66">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The previously undocumented <tt class="docutils literal">docstring</tt> option in <tt class="docutils literal">ElementTree.write()</tt>
+produces a deprecation warning and will eventually be removed.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id67">
+<h1>3.7.4 (2017-??-??)</h1>
+<div class="section" id="id68">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: revert previous fix for XSLT error logging as it breaks
+multi-threaded XSLT processing.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1673355">LP#1673355</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/233">GH#233</a>: <tt class="docutils literal">fromstring()</tt> html5parser failed to parse byte strings.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id72">
+<h1>3.7.3 (2017-02-18)</h1>
+<div class="section" id="id73">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a> was ineffective in Python 3.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/222">GH#222</a>: <tt class="docutils literal">lxml.html.submit_form()</tt> failed in Python 3.
+Patch by Jakub Wilk.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id74">
+<h1>3.7.2 (2017-01-08)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/220">GH#220</a>: <tt class="docutils literal">xmlfile</tt> allows switching output methods at an element level.
+Patch by Burak Arslan.</li>
+</ul>
+<div class="section" id="id76">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Work around installation problems in recent Python 2.7 versions
+due to FTP download failures.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/219">GH#219</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly quoting attribute values.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly escaping text content of
+script/style tags.  Patch by Burak Arslan.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id78">
+<h1>3.7.1 (2016-12-23)</h1>
+<ul class="simple">
+<li>No source changes, issued only to solve problems with the
+binary packages released for 3.7.0.</li>
+</ul>
+</div>
+<div class="section" id="id79">
+<h1>3.7.0 (2016-12-10)</h1>
+<div class="section" id="id80">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/217">GH#217</a>: <tt class="docutils literal">XMLSyntaxError</tt> now behaves more like its <tt class="docutils literal">SyntaxError</tt>
+baseclass.  Patch by Philipp A.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/216">GH#216</a>: <tt class="docutils literal">HTMLParser()</tt> now supports the same <tt class="docutils literal">collect_ids</tt> parameter
+as <tt class="docutils literal">XMLParser()</tt>.  Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/210">GH#210</a>: Allow specifying a serialisation method in <tt class="docutils literal">xmlfile.write()</tt>.
+Patch by Burak Arslan.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/203">GH#203</a>: New option <tt class="docutils literal">default_doctype</tt> in <tt class="docutils literal">HTMLParser</tt> that allows
+disabling the automatic doctype creation.  Patch by Shadab Zafar.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/201">GH#201</a>: Calling the method <tt class="docutils literal"><span class="pre">.set('attrname')</span></tt> without value argument
+(or <tt class="docutils literal">None</tt>) on HTML elements creates an attribute without value that
+serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&gt;&lt;/div&gt;</span></tt>.  Patch by Daniel Holth.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/197">GH#197</a>: Ignore form input fields in <tt class="docutils literal">form_values()</tt> when they are
+marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
+</ul>
+</div>
+<div class="section" id="id81">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/206">GH#206</a>: File name and line number were missing from XSLT error messages.
+Patch by Marcus Brinkmann.</li>
+</ul>
+</div>
+<div class="section" id="id82">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Log entries no longer allow anything but plain string objects as message text
+and file name.</li>
+<li><tt class="docutils literal">zlib</tt> is included in the list of statically built libraries.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id83">
+<h1>3.6.4 (2016-08-20)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/204">GH#204</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614693">LP#1614693</a>: build fix for MacOS-X.</li>
+</ul>
+</div>
+<div class="section" id="id84">
+<h1>3.6.3 (2016-08-18)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: change linker flags to build multi-linux wheels</li>
+</ul>
+</div>
+<div class="section" id="id85">
+<h1>3.6.2 (2016-08-18)</h1>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1614603">LP#1614603</a>: release without source changes to provide cleanly built Linux wheels</li>
+</ul>
+</div>
+<div class="section" id="id87">
+<h1>3.6.1 (2016-07-24)</h1>
+<div class="section" id="id88">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/180">GH#180</a>: Separate option <tt class="docutils literal">inline_style</tt> for Cleaner that only removes <tt class="docutils literal">style</tt>
+attributes instead of all styles.  Patch by Christian Pedersen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/196">GH#196</a>: Windows build support for Python 3.5.  Contribution by Maximilian Hils.</li>
+</ul>
+</div>
+<div class="section" id="id89">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/199">GH#199</a>: Exclude <tt class="docutils literal">file</tt> fields from <tt class="docutils literal">FormElement.form_values</tt> (as browsers do).
+Patch by Tomas Divis.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/198">GH#198</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1568167">LP#1568167</a>: Try to provide base URL from <tt class="docutils literal">Resolver.resolve_string()</tt>.
+Patch by Michael van Tellingen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/191">GH#191</a>: More accurate float serialisation in <tt class="docutils literal">objectify.FloatElement</tt>.
+Patch by Holger Joukl.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Repair XSLT error logging. Patch by Marcus Brinkmann.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id91">
+<h1>3.6.0 (2016-03-17)</h1>
+<div class="section" id="id92">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/187">GH#187</a>: Now supports (only) version 5.x and later of PyPy.
+Patch by Armin Rigo.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/181">GH#181</a>: Direct support for <tt class="docutils literal">.rnc</tt> files in <cite>RelaxNG()</cite> if <tt class="docutils literal">rnc2rng</tt>
+is installed.  Patch by Dirkjan Ochtman.</li>
+</ul>
+</div>
+<div class="section" id="id93">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/189">GH#189</a>: Static builds honour FTP proxy configurations when downloading
+the external libs.  Patch by Youhei Sakurai.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/186">GH#186</a>: Soupparser failed to process entities in Python 3.x.
+Patch by Duncan Morris.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/185">GH#185</a>: Rare encoding related <tt class="docutils literal">TypeError</tt> on import was fixed.
+Patch by Petr Demin.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id94">
+<h1>3.5.0 (2015-11-13)</h1>
+<div class="section" id="id95">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Unicode string results failed XPath queries in PyPy.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1497051">LP#1497051</a>: HTML target parser failed to terminate on exceptions
+and continued parsing instead.</li>
+<li>Deprecated API usage in doctestcompare.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="b1-2015-09-18">
+<h1>3.5.0b1 (2015-09-18)</h1>
+<div class="section" id="id96">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">keep_ns_prefixes</tt>
+that does not remove definitions of the provided prefix-namespace
+mapping from the tree.</li>
+<li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">top_nsmap</tt> that
+moves definitions of the provided prefix-namespace mapping to the
+top of the tree.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1490451">LP#1490451</a>: <tt class="docutils literal">Element</tt> objects gained a <tt class="docutils literal">cssselect()</tt> method as
+known from <tt class="docutils literal">lxml.html</tt>.  Patch by Simon Sapin.</li>
+<li>API functions and methods behave and look more like Python functions,
+which allows introspection on them etc.  One side effect to be aware of
+is that the functions now bind as methods when assigned to a class
+variable.  A quick fix is to wrap them in <tt class="docutils literal">staticmethod()</tt> (as for
+normal Python functions).</li>
+<li>ISO-Schematron support gained an option <tt class="docutils literal">error_finder</tt> that allows
+passing a filter function for picking validation errors from reports.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1243600">LP#1243600</a>: Elements in <tt class="docutils literal">lxml.html</tt> gained a <tt class="docutils literal">classes</tt> property
+that provides a set-like interface to the <tt class="docutils literal">class</tt> attribute.
+Original patch by masklinn.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1341964">LP#1341964</a>: The soupparser now handles DOCTYPE declarations, comments
+and processing instructions outside of the root element.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421512">LP#1421512</a>: The <tt class="docutils literal">docinfo</tt> of a tree was made editable to allow
+setting and removing the public ID and system ID of the DOCTYPE.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1442427">LP#1442427</a>: More work-arounds for quirks and bugs in pypy and pypy3.</li>
+<li><tt class="docutils literal">lxml.html.soupparser</tt> now uses BeautifulSoup version 4 instead
+of version 3 if available.</li>
+</ul>
+</div>
+<div class="section" id="id97">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory errors that occur during tree adaptations (e.g. moving subtrees
+to foreign documents) could leave the tree in a crash prone state.</li>
+<li>Calling <tt class="docutils literal">process_children()</tt> in an XSLT extension element without
+an <tt class="docutils literal">output_parent</tt> argument failed with a <tt class="docutils literal">TypeError</tt>.
+Fix by Jens Tröger.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/162">GH#162</a>: Image data in HTML <tt class="docutils literal">data</tt> URLs is considered safe and
+no longer removed by <tt class="docutils literal">lxml.html.clean</tt> JavaScript cleaner.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/166">GH#166</a>: Static build could link libraries in wrong order.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/172">GH#172</a>: Rely a bit more on libxml2 for encoding detection rather than
+rolling our own in some cases.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/159">GH#159</a>: Validity checks for names and string content were tightened
+to detect the use of illegal characters early.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421921">LP#1421921</a>: Comments/PIs before the DOCTYPE declaration were not
+serialised.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/659367">LP#659367</a>: Some HTML DOCTYPE declarations were not serialised.
+Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238503">LP#1238503</a>: lxml.doctestcompare is now consistent with stdlib's doctest
+in how it uses <tt class="docutils literal">+</tt> and <tt class="docutils literal">-</tt> to refer to unexpected and missing output.</li>
+<li>Empty prefixes are explicitly rejected when a namespace mapping is used
+with ElementPath to avoid hiding bugs in user code.</li>
+<li>Several problems with PyPy were fixed by switching to Cython 0.23.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id98">
+<h1>3.4.4 (2015-04-25)</h1>
+<div class="section" id="id99">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>An ElementTree compatibility test added in lxml 3.4.3 that failed in
+Python 3.4+ was removed again.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id100">
+<h1>3.4.3 (2015-04-15)</h1>
+<div class="section" id="id101">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1426868">LP#1426868</a>: Passing a default namespace and a prefixed namespace mapping
+as nsmap into <tt class="docutils literal">xmlfile.element()</tt> raised a <tt class="docutils literal">TypeError</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421927">LP#1421927</a>: DOCTYPE system URLs were incorrectly quoted when containing
+double quotes.  Patch by Olli Pottonen.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1419354">LP#1419354</a>: meta-redirect URLs were incorrectly processed by
+<tt class="docutils literal">iterlinks()</tt> if preceded by whitespace.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id102">
+<h1>3.4.2 (2015-02-07)</h1>
+<div class="section" id="id103">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415907">LP#1415907</a>: Crash when creating an XMLSchema from a non-root element
+of an XML document.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1369362">LP#1369362</a>: HTML cleaning failed when hitting processing instructions
+with pseudo-attributes.</li>
+<li><tt class="docutils literal">CDATA()</tt> wrapped content was rejected for tail text.</li>
+<li>CDATA sections were not serialised as tail text of the top-level element.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id104">
+<h1>3.4.1 (2014-11-20)</h1>
+<div class="section" id="id105">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New <tt class="docutils literal">htmlfile</tt> HTML generator to accompany the incremental <tt class="docutils literal">xmlfile</tt>
+serialisation API.  Patch by Burak Arslan.</li>
+</ul>
+</div>
+<div class="section" id="id106">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.sax.ElementTreeContentHandler</tt> did not initialise its superclass.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id107">
+<h1>3.4.0 (2014-09-10)</h1>
+<div class="section" id="id108">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">xmlfile(buffered=False)</tt> disables output buffering and flushes the
+content after each API operation (starting/ending element blocks or writes).
+A new method <tt class="docutils literal">xf.flush()</tt> can alternatively be used to explicitly flush
+the output.</li>
+<li><tt class="docutils literal">lxml.html.document_fromstring</tt> has a new option <tt class="docutils literal">ensure_head_body=True</tt>
+which will add an empty head and/or body element to the result document if
+missing.</li>
+<li><tt class="docutils literal">lxml.html.iterlinks</tt> now returns links inside meta refresh tags.</li>
+<li>New <tt class="docutils literal">XMLParser</tt> option <tt class="docutils literal">collect_ids=False</tt> to disable ID hash table
+creation.  This can substantially speed up parsing of documents with many
+different IDs that are not used.</li>
+<li>The parser uses per-document hash tables for XML IDs.  This reduces the
+load of the global parser dict and speeds up parsing for documents with
+many different IDs.</li>
+<li><tt class="docutils literal">ElementTree.getelementpath(element)</tt> returns a structural ElementPath
+expression for the given element, which can be used for lookups later.</li>
+<li><tt class="docutils literal">xmlfile()</tt> accepts a new argument <tt class="docutils literal">close=True</tt> to close file(-like)
+objects after writing to them.  Before, <tt class="docutils literal">xmlfile()</tt> only closed the file
+if it had opened it internally.</li>
+<li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
+</ul>
+</div>
+<div class="section" id="id109">
+<h2>Bugs fixed</h2>
+</div>
+<div class="section" id="id110">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/400588">LP#400588</a>: decoding errors have become hard errors even in recovery mode.
+Previously, they could lead to an internal tree representation in a mixed
+encoding state, which lead to very late errors or even silently incorrect
+behaviour during tree traversal or serialisation.</li>
+<li>Requires Python 2.6, 2.7, 3.2 or later. No longer supports
+Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.</li>
+<li>Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
+use lxml 3.3.x with older versions.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id111">
+<h1>3.3.6 (2014-08-28)</h1>
+<div class="section" id="id112">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Prevent tree cycle creation when adding Elements as siblings.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1361948">LP#1361948</a>: crash when deallocating Element siblings without parent.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1354652">LP#1354652</a>: crash when traversing internally loaded documents in XSLT
+extension functions.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id113">
+<h1>3.3.5 (2014-04-18)</h1>
+<div class="section" id="id114">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML cleaning could fail to strip javascript links that mix control
+characters into the link scheme.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id115">
+<h1>3.3.4 (2014-04-03)</h1>
+<div class="section" id="id116">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Source line numbers above 65535 are available on Elements when
+using libxml2 2.9 or later.</li>
+</ul>
+</div>
+<div class="section" id="id117">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.fragment_fromstring()</tt> failed for bytes input in Py3.</li>
+</ul>
+</div>
+<div class="section" id="id118">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id119">
+<h1>3.3.3 (2014-03-04)</h1>
+<div class="section" id="id120">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1287118">LP#1287118</a>: Crash when using Element subtypes with <tt class="docutils literal">__slots__</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id121">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The internal classes <tt class="docutils literal">_LogEntry</tt> and <tt class="docutils literal">_Attrib</tt> can no longer be
+subclassed from Python code.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id122">
+<h1>3.3.2 (2014-02-26)</h1>
+<div class="section" id="id123">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The properties <tt class="docutils literal">resolvers</tt> and <tt class="docutils literal">version</tt>, as well as the methods
+<tt class="docutils literal">set_element_class_lookup()</tt> and <tt class="docutils literal">makeelement()</tt>, were lost from
+<tt class="docutils literal">iterparse</tt> objects in 3.3.0.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1222132">LP#1222132</a>: instances of <tt class="docutils literal">XMLSchema</tt>, <tt class="docutils literal">Schematron</tt> and <tt class="docutils literal">RelaxNG</tt>
+did not clear their local <tt class="docutils literal">error_log</tt> before running a validation.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238500">LP#1238500</a>: lxml.doctestcompare mixed up &quot;expected&quot; and &quot;actual&quot; in
+attribute values.</li>
+<li>Some file I/O tests were failing in MS-Windows due to non-portable temp
+file usage.  Initial patch by Gabi Davar.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/910014">LP#910014</a>: duplicate IDs in a document were not reported by DTD validation.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185332">LP#1185332</a>: <tt class="docutils literal"><span class="pre">tostring(method=&quot;html&quot;)</span></tt> did not use HTML serialisation
+semantics for trailing tail text.  Initial patch by Sylvain Viollon.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1281139">LP#1281139</a>: <tt class="docutils literal">.attrib</tt> value of Comments lost its mutation methods
+in 3.3.0.  Even though it is empty and immutable, it should still
+provide the same interface as that returned for Elements.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id124">
+<h1>3.3.1 (2014-02-12)</h1>
+<div class="section" id="id125">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id126">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1014290">LP#1014290</a>: HTML documents parsed with <tt class="docutils literal">parser.feed()</tt> failed to find
+elements during tag iteration.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1273709">LP#1273709</a>: Building in PyPy failed due to missing support for
+<tt class="docutils literal">PyUnicode_Compare()</tt> and <tt class="docutils literal"><span class="pre">PyByteArray_*()</span></tt> in PyPy's C-API.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274413">LP#1274413</a>: Compilation in MSVC failed due to missing &quot;stdint.h&quot; standard
+header file.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274118">LP#1274118</a>: iterparse() failed to parse BOM prefixed files.</li>
+</ul>
+</div>
+<div class="section" id="id127">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id128">
+<h1>3.3.0 (2014-01-26)</h1>
+<div class="section" id="id129">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id130">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The heuristic that distinguishes file paths from URLs was tightened
+to produce less false negatives.</li>
+</ul>
+</div>
+<div class="section" id="id131">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta5-2014-01-18">
+<h1>3.3.0beta5 (2014-01-18)</h1>
+<div class="section" id="id132">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The PEP 393 unicode parsing support gained a fallback for wchar strings
+which might still be somewhat common on Windows systems.</li>
+</ul>
+</div>
+<div class="section" id="id133">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Several error handling problems were fixed throughout the code base that
+could previously lead to exceptions being silently swallowed or not
+properly reported.</li>
+<li>The C-API function <tt class="docutils literal">appendChild()</tt> is now deprecated as it does not
+propagate exceptions (its return type is <tt class="docutils literal">void</tt>).  The new function
+<tt class="docutils literal">appendChildToElement()</tt> was added as a safe replacement.</li>
+<li>Passing a string into <tt class="docutils literal">fromstringlist()</tt> raises an exception instead of
+parsing the string character by character.</li>
+</ul>
+</div>
+<div class="section" id="id134">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Document cleanup code was simplified using the new GC features in
+Cython 0.20.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta4-2014-01-12">
+<h1>3.3.0beta4 (2014-01-12)</h1>
+<div class="section" id="id135">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id136">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The (empty) value returned by the <tt class="docutils literal">attrib</tt> property of Entity and Comment
+objects was mutable.</li>
+<li>Element class lookup wasn't available for the new pull parsers or when using
+a custom parser target.</li>
+<li>Setting Element attributes on instantiation with both the <tt class="docutils literal">attrib</tt> argument
+and keyword arguments could modify the mapping passed as <tt class="docutils literal">attrib</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1266171">LP#1266171</a>: DTDs instantiated from internal/external subsets (i.e. through
+the docinfo property) lost their attribute declarations.</li>
+</ul>
+</div>
+<div class="section" id="id137">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
+Python 3.4.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2014-01-02">
+<h1>3.3.0beta3 (2014-01-02)</h1>
+<div class="section" id="id138">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Unicode string parsing was optimised for Python 3.3 (PEP 393).</li>
+</ul>
+</div>
+<div class="section" id="id139">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML parsing of Unicode strings could misdecode the input on some platforms.</li>
+<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
+</ul>
+</div>
+<div class="section" id="id140">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta2-2013-12-20">
+<h1>3.3.0beta2 (2013-12-20)</h1>
+<div class="section" id="id141">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">iterparse()</tt> supports the <tt class="docutils literal">recover</tt> option.</li>
+</ul>
+</div>
+<div class="section" id="id142">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in <tt class="docutils literal">iterparse()</tt> for HTML parsing.</li>
+<li>Crash in target parsing with attributes.</li>
+</ul>
+</div>
+<div class="section" id="id143">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The safety check in the read-only tree implementation (e.g. used by
+<tt class="docutils literal">PythonElementClassLookup</tt>) raises a more appropriate <tt class="docutils literal">ReferenceError</tt>
+for illegal access after tree disposal instead of an <tt class="docutils literal">AssertionError</tt>.
+This should only impact test code that specifically checks the original
+behaviour.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2013-12-12">
+<h1>3.3.0beta1 (2013-12-12)</h1>
+<div class="section" id="id144">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New option <tt class="docutils literal">handle_failures</tt> in <tt class="docutils literal">make_links_absolute()</tt> and
+<tt class="docutils literal">resolve_base_href()</tt> (lxml.html) that enables ignoring or
+discarding links that fail to parse as URLs.</li>
+<li>New parser classes <tt class="docutils literal">XMLPullParser</tt> and <tt class="docutils literal">HTMLPullParser</tt> for
+incremental parsing, as implemented for ElementTree in Python 3.4.</li>
+<li><tt class="docutils literal">iterparse()</tt> enables recovery mode by default for HTML parsing
+(<tt class="docutils literal">html=True</tt>).</li>
+</ul>
+</div>
+<div class="section" id="id145">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
+comment or PI).</li>
+<li>Error messages in the log and in exception messages that originated
+from libxml2 could accidentally be picked up from preceding warnings
+instead of the actual error.</li>
+<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify did not accept a dict as
+argument for adding attributes to the element it's building. This
+works as in lxml.builder now.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
+<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
+to one of its own descendants, instead of running into an infinite
+loop.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
+<li>Compressed plain-text serialisation to file-like objects was broken.</li>
+<li>lxml.html.formfill: Fix textarea form filling.
+The textarea used to be cleared before the new content was set,
+which removed the name attribute.</li>
+</ul>
+</div>
+<div class="section" id="id146">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Some basic API classes use freelists internally for faster
+instantiation.  This can speed up some <tt class="docutils literal">iterparse()</tt> scenarios,
+for example.</li>
+<li><tt class="docutils literal">iterparse()</tt> was rewritten to use the new <tt class="docutils literal">*PullParser</tt>
+classes internally instead of being a parser itself.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id147">
+<h1>3.2.5 (2014-01-02)</h1>
+<div class="section" id="id148">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id149">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
+<li>Crash in target parsing with attributes.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1255132">LP#1255132</a>: crash when trying to run validation over non-Element (e.g.
+comment or PI).</li>
+</ul>
+</div>
+<div class="section" id="id151">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id152">
+<h1>3.2.4 (2013-11-07)</h1>
+<div class="section" id="id153">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id154">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak when creating an XPath evaluator in a thread.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
+<li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
+to one of its own descendants.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
+<li>Compressed plain-text serialisation to file-like objects was broken.</li>
+</ul>
+</div>
+<div class="section" id="id157">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id158">
+<h1>3.2.3 (2013-07-28)</h1>
+<div class="section" id="id159">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix support for Python 2.4 which was lost in 3.2.2.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id160">
+<h1>3.2.2 (2013-07-28)</h1>
+<div class="section" id="id161">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id162">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185701">LP#1185701</a>: spurious XMLSyntaxError after finishing iterparse().</li>
+<li>Crash in lxml.objectify during xsi annotation.</li>
+</ul>
+</div>
+<div class="section" id="id163">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Return values of user provided element class lookup methods are now
+validated against the type of the XML node they represent to prevent
+API class mismatches.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id164">
+<h1>3.2.1 (2013-05-11)</h1>
+<div class="section" id="id165">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The methods <tt class="docutils literal">apply_templates()</tt> and <tt class="docutils literal">process_children()</tt> of XSLT
+extension elements have gained two new boolean options <tt class="docutils literal">elements_only</tt>
+and <tt class="docutils literal">remove_blank_text</tt> that discard either all strings or whitespace-only
+strings from the result list.</li>
+</ul>
+</div>
+<div class="section" id="id166">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When moving Elements to another tree, the namespace cleanup mechanism
+no longer drops namespace prefixes from attributes for which it finds
+a default namespace declaration, to prevent them from appearing as
+unnamespaced attributes after serialisation.</li>
+<li>Returning non-type objects from a custom class lookup method could lead
+to a crash.</li>
+<li>Instantiating and using subtypes of Comments and ProcessingInstructions
+crashed.</li>
+</ul>
+</div>
+<div class="section" id="id167">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id168">
+<h1>3.2.0 (2013-04-28)</h1>
+<div class="section" id="id169">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id170">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/690319">LP#690319</a>: Leading whitespace could change the behaviour of the string
+parsing functions in <tt class="docutils literal">lxml.html</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/599318">LP#599318</a>: The string parsing functions in <tt class="docutils literal">lxml.html</tt> are more robust
+in the face of uncommon HTML content like framesets or missing body tags.
+Patch by Stefan Seelmann.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/712941">LP#712941</a>: I/O errors while trying to access files with paths that contain
+non-ASCII characters could raise <tt class="docutils literal">UnicodeDecodeError</tt> instead of properly
+reporting the <tt class="docutils literal">IOError</tt>.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/673205">LP#673205</a>: Parsing from in-memory strings disabled network access in the
+default parser and made subsequent attempts to parse from a URL fail.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/971754">LP#971754</a>: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
+of overwriting the current value.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/715687">LP#715687</a>: lxml.html.clean no longer discards scripts that are explicitly
+allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
+</ul>
+</div>
+<div class="section" id="id171">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id172">
+<h1>3.1.2 (2013-04-12)</h1>
+<div class="section" id="id173">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id174">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1136509">LP#1136509</a>: Passing attributes through the namespace-unaware API of
+the sax bridge (i.e. the <tt class="docutils literal">handler.startElement()</tt> method) failed
+with a <tt class="docutils literal">TypeError</tt>.  Patch by Mike Bayer.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1123074">LP#1123074</a>: Fix serialisation error in XSLT output when converting
+the result tree to a Unicode string.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/105">GH#105</a>: Replace illegal usage of <tt class="docutils literal">xmlBufLength()</tt> in libxml2 2.9.0
+by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id175">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id176">
+<h1>3.1.1 (2013-03-29)</h1>
+<div class="section" id="id177">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id178">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1160386">LP#1160386</a>: Write access to <tt class="docutils literal">lxml.html.FormElement.fields</tt> raised
+an AttributeError in Py3.</li>
+<li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
+</ul>
+</div>
+<div class="section" id="id179">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The externally useless class <tt class="docutils literal">lxml.etree._BaseParser</tt> was removed
+from the module dict.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id180">
+<h1>3.1.0 (2013-02-10)</h1>
+<div class="section" id="id181">
+<h2>Features added</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/89">GH#89</a>: lxml.html.clean allows overriding the set of attributes that it
+considers 'safe'.  Patch by Francis Devereux.</li>
+</ul>
+</div>
+<div class="section" id="id182">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1104370">LP#1104370</a>: <tt class="docutils literal">copy.copy(el.attrib)</tt> raised an exception.  It now returns
+a copy of the attributes as a plain Python dict.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/95">GH#95</a>: When used with namespace prefixes, the  <tt class="docutils literal"><span class="pre">el.find*()</span></tt> methods
+always used the first namespace mapping that was provided for each
+path expression instead of using the one that was actually passed
+in for the current run.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1092521">LP#1092521</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/91">GH#91</a>: Fix undefined C symbol in Python runtimes compiled
+without threading support.  Patch by Ulrich Seidl.</li>
+</ul>
+</div>
+<div class="section" id="id183">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta1-2012-12-21">
+<h1>3.1beta1 (2012-12-21)</h1>
+<div class="section" id="id184">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New build-time option <tt class="docutils literal"><span class="pre">--with-unicode-strings</span></tt> for Python 2 that
+makes the API always return Unicode strings for names and text
+instead of byte strings for plain ASCII content.</li>
+<li>New incremental XML file writing API <tt class="docutils literal">etree.xmlfile()</tt>.</li>
+<li>E factory in lxml.objectify is callable to simplify the creation of
+tags with non-identifier names without having to resort to getattr().</li>
+</ul>
+</div>
+<div class="section" id="id185">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When starting from a non-namespaced element in lxml.objectify, searching
+for a child without explicitly specifying a namespace incorrectly found
+namespaced elements with the requested local name, instead of restricting
+the search to non-namespaced children.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/85">GH#85</a>: Deprecation warnings were fixed for Python 3.x.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/33">GH#33</a>: lxml.html.fromstring() failed to accept bytes input in Py3.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1080792">LP#1080792</a>: Static build of libxml2 2.9.0 failed due to missing file.</li>
+</ul>
+</div>
+<div class="section" id="id186">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
+removed from the module API of lxml.objectify.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1075622">LP#1075622</a>: lxml.builder is faster for adding text to elements with
+many children.  Patch by Anders Hammarquist.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id187">
+<h1>3.0.2 (2012-12-14)</h1>
+<div class="section" id="id188">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id189">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.</li>
+</ul>
+</div>
+<div class="section" id="id190">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id191">
+<h1>3.0.1 (2012-10-14)</h1>
+<div class="section" id="id192">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id193">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065924">LP#1065924</a>: Element proxies could disappear during garbage collection
+in PyPy without proper cleanup.</li>
+<li><a class="reference external" href="https://github.com/lxml/lxml/issues/71">GH#71</a>: Failure to work with libxml2 2.6.x.</li>
+<li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065139">LP#1065139</a>: static MacOS-X build failed in Py3.</li>
+</ul>
+</div>
+<div class="section" id="id194">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id195">
+<h1>3.0 (2012-10-08)</h1>
+<div class="section" id="id196">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id197">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>End-of-file handling was incorrect in iterparse() when reading from
+a low-level C file stream and failed in libxml2 2.9.0 due to its
+improved consistency checks.</li>
+</ul>
+</div>
+<div class="section" id="id198">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The build no longer uses Cython by default unless the generated C files
+are missing.  To use Cython, pass the option &quot;--with-cython&quot;.  To ignore
+the fatal build error when Cython is required but not available (e.g. to
+run special setup.py commands that do not actually run a build), pass
+&quot;--without-cython&quot;.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2012-09-26">
+<h1>3.0beta1 (2012-09-26)</h1>
+<div class="section" id="id199">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Python level access to (optional) libxml2 memory debugging features
+to simplify debugging of memory leaks etc.</li>
+</ul>
+</div>
+<div class="section" id="id200">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fix a memory leak in XPath by switching to Cython 0.17.1.</li>
+<li>Some tests were adapted to work with PyPy.</li>
+</ul>
+</div>
+<div class="section" id="id201">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The code was adapted to work with the upcoming libxml2 2.9.0 release.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha2-2012-08-23">
+<h1>3.0alpha2 (2012-08-23)</h1>
+<div class="section" id="id202">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">.iter()</tt> method of elements now accepts <tt class="docutils literal">tag</tt> arguments like
+<tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt> to search for elements with a given local name in any
+namespace. With this addition, all combinations of wildcards now work
+as expected:
+<tt class="docutils literal">&quot;{ns}name&quot;</tt>, <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{ns}*&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>
+and <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.  Note that <tt class="docutils literal">&quot;name&quot;</tt> is equivalent to <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>,
+but <tt class="docutils literal">&quot;*&quot;</tt> is <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.
+The same change applies to the <tt class="docutils literal">.getiterator()</tt>, <tt class="docutils literal">.itersiblings()</tt>,
+<tt class="docutils literal">.iterancestors()</tt>, <tt class="docutils literal">.iterdescendants()</tt>, <tt class="docutils literal">.iterchildren()</tt>
+and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutils literal">strip_attributes()</tt>,
+<tt class="docutils literal">strip_elements()</tt> and <tt class="docutils literal">strip_tags()</tt> functions as well as the
+<tt class="docutils literal">iterparse()</tt> class.  Patch by Simon Sapin.</li>
+<li>C14N allows specifying the inclusive prefixes to be promoted
+to top-level during exclusive serialisation.</li>
+</ul>
+</div>
+<div class="section" id="id203">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
+failed to read the entire string.</li>
+</ul>
+</div>
+<div class="section" id="id204">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha1-2012-07-31">
+<h1>3.0alpha1 (2012-07-31)</h1>
+<div class="section" id="id205">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Initial support for building in PyPy (through cpyext).</li>
+<li>DTD objects gained an API that allows read access to their
+declarations.</li>
+<li><tt class="docutils literal">xpathgrep.py</tt> gained support for parsing line-by-line (e.g.
+from grep output) and for surrounding the output with a new root
+tag.</li>
+<li><tt class="docutils literal"><span class="pre">E-factory</span></tt> in <tt class="docutils literal">lxml.builder</tt> accepts subtypes of known data
+types (such as string subtypes) when building elements around them.</li>
+<li>Tree iteration and <tt class="docutils literal">iterparse()</tt> with a selective <tt class="docutils literal">tag</tt>
+argument supports passing a set of tags.  Tree nodes will be
+returned by the iterators if they match any of the tags.</li>
+</ul>
+</div>
+<div class="section" id="id206">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods in <tt class="docutils literal">lxml.objectify</tt> no longer use XPath
+internally, which makes them faster in many cases (especially when
+short circuiting after a single or couple of elements) and fixes
+some behavioural differences compared to <tt class="docutils literal">lxml.etree</tt>.  Note that
+this means that they no longer support arbitrary XPath expressions
+but only the subset that the <tt class="docutils literal">ElementPath</tt> language supports.
+The previous implementation was also redundant with the normal
+XPath support, which can be used as a replacement.</li>
+<li><tt class="docutils literal"><span class="pre">el.find('*')</span></tt> could accidentally return a comment or processing
+instruction that happened to be in the wrong spot.  (Same for the
+other <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods.)</li>
+<li>The error logging is less intrusive and avoids a global setup where
+possible.</li>
+<li>Fixed undefined names in html5lib parser.</li>
+<li><tt class="docutils literal">xpathgrep.py</tt> did not work in Python 3.</li>
+<li><tt class="docutils literal">Element.attrib.update()</tt> did not accept an <tt class="docutils literal">attrib</tt> of
+another Element as parameter.</li>
+<li>For subtypes of <tt class="docutils literal">ElementBase</tt> that make the <tt class="docutils literal">.text</tt> or <tt class="docutils literal">.tail</tt>
+properties immutable (as in objectify, for example), inserting text
+when creating Elements through the E-Factory feature of the class
+constructor would fail with an exception, stating that the text
+cannot be modified.</li>
+</ul>
+</div>
+<div class="section" id="id207">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The code base was overhauled to properly use 'const' where the API
+of libxml2 and libxslt requests it.  This also has an impact on the
+public C-API of lxml itself, as defined in <tt class="docutils literal">etreepublic.pxd</tt>, as
+well as the provided declarations in the <tt class="docutils literal">lxml/includes/</tt> directory.
+Code that uses these declarations may have to be adapted.  On the
+plus side, this fixes several C compiler warnings, also for user
+code, thus making it easier to spot real problems again.</li>
+<li>The functionality of &quot;lxml.cssselect&quot; was moved into a separate PyPI
+package called &quot;cssselect&quot;.  To continue using it, you must install
+that package separately.  The &quot;lxml.cssselect&quot; module is still
+available and provides the same interface, provided the &quot;cssselect&quot;
+package can be imported at runtime.</li>
+<li>Element attributes passed in as an <tt class="docutils literal">attrib</tt> dict or as keyword
+arguments are now sorted by (namespaced) name before being created
+to make their order predictable for serialisation and iteration.
+Note that adding or deleting attributes afterwards does not take
+that order into account, i.e. setting a new attribute appends it
+after the existing ones.</li>
+<li>Several classes that are for internal use only were removed
+from the <tt class="docutils literal">lxml.etree</tt> module dict:
+<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
+_ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
+__ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
+_ClassNamespaceRegistry, _FunctionNamespaceRegistry,
+_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
+_FileReaderContext, _ParserContext, _PythonSaxParserTarget,
+_TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
+_ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
+_OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
+_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
+_AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
+_ParserSchemaValidationContext, _XPathContext,
+_XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam</tt></li>
+<li>Several internal classes can no longer be inherited from:
+<tt class="docutils literal">_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
+_IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
+_XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
+_FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
+_ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
+_ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
+_AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
+_XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
+_XSLTResultTree, _XSLTProcessingInstruction</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id208">
+<h1>2.3.6 (2012-09-28)</h1>
+<div class="section" id="id209">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id210">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
+failed to read the entire string.</li>
+</ul>
+</div>
+<div class="section" id="id211">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id212">
+<h1>2.3.5 (2012-07-31)</h1>
+<div class="section" id="id213">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id214">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
+<li>Crash in sax/target parser when reporting empty doctype.</li>
+</ul>
+</div>
+<div class="section" id="id215">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id216">
+<h1>2.3.4 (2012-03-26)</h1>
+<div class="section" id="id217">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id218">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when building an nsmap (Element property) with empty
+namespace URIs.</li>
+<li>Crash due to race condition when errors (or user messages) occur
+during threaded XSLT processing.</li>
+<li>XSLT stylesheet compilation could ignore compilation errors.</li>
+</ul>
+</div>
+<div class="section" id="id219">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id220">
+<h1>2.3.3 (2012-01-04)</h1>
+<div class="section" id="id221">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
+<tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id222">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
+requesting start events.</li>
+<li>Fixed parsing of more selectors in cssselect.  Whitespace before
+pseudo-elements and pseudo-classes is significant as it is a
+descendant combinator.
+&quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
+Patch by Simon Sapin.</li>
+<li>lxml.html.diff no longer raises an exception when hitting
+'img' tags without 'src' attribute.</li>
+</ul>
+</div>
+<div class="section" id="id223">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id224">
+<h1>2.3.2 (2011-11-11)</h1>
+<div class="section" id="id225">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
+<tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
+declarations (and generally clean up the namespace declarations)
+after removing the type annotations.</li>
+<li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
+copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
+of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
+</ul>
+</div>
+<div class="section" id="id226">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
+fix in lxml 2.3.1).  The previous change resulted in a serious
+performance regression for the XPath based evaluation of the
+translated expression.  Note that this breaks the usage of some of
+the generated XPath expressions as XSLT location paths that
+previously worked in 2.3.1.</li>
+<li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
+&quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously it was parsed as
+a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
+&quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
+</ul>
+</div>
+<div class="section" id="id227">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id228">
+<h1>2.3.1 (2011-09-25)</h1>
+<div class="section" id="id229">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
+tags and their content (i.e. their whole subtree).</li>
+<li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
+pseudo-attributes from the text content of processing instructions.</li>
+<li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
+used to compile external C code against lxml.etree.  This is
+specifically required for statically linked lxml builds when code
+needs to compile against the exact same header file versions as lxml
+itself.</li>
+<li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
+<tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
+closed after reading or not.  By default, the file will be closed,
+as the user is not expected to keep a reference to it.</li>
+</ul>
+</div>
+<div class="section" id="id230">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>HTML cleaning didn't remove 'data:' links.</li>
+<li>The html5lib parser integration now uses the 'official'
+implementation in html5lib itself, which makes it work with newer
+releases of the library.</li>
+<li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
+tag name when the corresponding start event inferred the same plain
+tag name to be in the default namespace.</li>
+<li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
+<tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
+reverts a change in lxml 2.3 where all files would be closed.  It is
+the users responsibility to properly close the file(-like) object,
+also in error cases.</li>
+<li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
+<li>In lxml.cssselect, use the xpath 'A//B' (short for
+'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
+the css descendant selector ('A B').  This makes a few edge cases
+like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
+WebKit and Firefox, and makes more css expressions valid location
+paths (for use in xsl:template match).</li>
+<li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
+collected form values.</li>
+<li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
+field properly selects them and unselects them.</li>
+</ul>
+</div>
+<div class="section" id="id231">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Static builds can specify the download directory with the
+<tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id232">
+<h1>2.3 (2011-02-06)</h1>
+<div class="section" id="id233">
+<h2>Features added</h2>
+<ul class="simple">
+<li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
+meaning an empty namespace, as opposed to the parent namespace.</li>
+</ul>
+</div>
+<div class="section" id="id234">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>When finished reading from a file-like object, the parser
+immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
+<li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
+file.</li>
+<li>Work-around for libxml2 bug that can leave the HTML parser in a
+non-functional state after parsing a severely broken document (fixed
+in libxml2 2.7.8).</li>
+<li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id235">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Some public functions in the Cython-level C-API have more explicit
+return types.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2010-09-06">
+<h1>2.3beta1 (2010-09-06)</h1>
+<div class="section" id="id236">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id237">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in newer libxml2 versions when moving elements between
+documents that had attributes on replaced XInclude nodes.</li>
+<li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
+<tt class="docutils literal">base_url</tt> parameters.</li>
+<li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
+<li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
+use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
+</ul>
+</div>
+<div class="section" id="id238">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha2-2010-07-24">
+<h1>2.3alpha2 (2010-07-24)</h1>
+<div class="section" id="id239">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id240">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XSLT when generating text-only result documents with a
+stylesheet created in a different thread.</li>
+</ul>
+</div>
+<div class="section" id="id241">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
+(following ElementTree 1.3).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha1-2010-06-19">
+<h1>2.3alpha1 (2010-06-19)</h1>
+<div class="section" id="id242">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
+to pass a prefix-to-namespace mapping for the selector.</li>
+<li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
+globally registers a namespace prefix for a namespace that newly
+created Elements in that namespace will use automatically.  Follows
+ElementTree 1.3.</li>
+<li>Support 'unicode' string name as encoding parameter in
+<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
+<li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
+<tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
+<li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
+match the upcoming ElementTree 1.3 that will ship in the standard
+library of Python 3.2/2.7.  This includes extended support for
+predicates as well as namespace prefixes (as known from XPath).</li>
+<li>During regular XPath evaluation, various ESXLT functions are
+available within their namespace when using libxslt 1.1.26 or later.</li>
+<li>Support passing a readily configured logger instance into
+<tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
+<li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
+override the DOCTYPE (internal subset) of the document.</li>
+<li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
+to append the resulting content directly to an output element.</li>
+<li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
+XSLT extension element itself.</li>
+<li>ISO-Schematron support based on the de-facto Schematron reference
+'skeleton implementation'.</li>
+<li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
+parameters.</li>
+<li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
+overhead.</li>
+<li>Setting the value of a namespaced attribute always uses a prefixed
+namespace instead of the default namespace even if both declare the
+same namespace URI.  This avoids serialisation problems when an
+attribute from a default namespace is set on an element from a
+different namespace.</li>
+<li>XSLT extension elements: support for XSLT context nodes other than
+elements: document root, comments, processing instructions.</li>
+<li>Support for strings (in addition to Elements) in node-sets returned
+by extension functions.</li>
+<li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
+the document on submit.</li>
+<li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
+<li>Namespace URIs get validated against RFC 3986 at the API level
+(required by the XML namespace specification).</li>
+<li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
+(compatible with ElementTree).</li>
+</ul>
+</div>
+<div class="section" id="id243">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>API is hardened against invalid proxy instances to prevent crashes
+due to incorrectly instantiated Element instances.</li>
+<li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
+<li>Export ElementTree compatible XML parser class as
+<tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
+<li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
+now use the hash value of the underlying Python value (string,
+number, etc.) to which they compare equal.</li>
+<li>Parsing broken fragments in lxml.html could fail if the fragment
+contained an orphaned closing '&lt;/div&gt;' tag.</li>
+<li>Using XSLT extension elements around the root of the output document
+crashed.</li>
+<li><tt class="docutils literal">lxml.cssselect</tt> did not distinguish between <tt class="docutils literal"><span class="pre">x[attr=&quot;val&quot;]</span></tt> and
+<tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
+attribute independent of the element.</li>
+<li>Rewriting multiple links inside of HTML text content could end up
+replacing unrelated content as replacements could impact the
+reported position of subsequent matches.  Modifications are now
+simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
+return links in reversed order if they appear inside the same text
+node.  Thus, replacements and link-internal modifications no longer
+change the position of links reported afterwards.</li>
+<li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
+not represent the complete raw value (including child tags etc.). It
+now serialises the complete content on read and replaces the
+complete content by a string on write.</li>
+<li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
+parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
+called after parsing, regardless of the outcome.</li>
+</ul>
+</div>
+<div class="section" id="id244">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Official support for Python 3.1.2 and later.</li>
+<li>Static MS Windows builds can now download their dependencies
+themselves.</li>
+<li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
+Element object.  It therefore no longer requires the garbage
+collector to clean up.</li>
+<li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id245">
+<h1>2.2.8 (2010-09-02)</h1>
+<div class="section" id="id246">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in newer libxml2 versions when moving elements between
+documents that had attributes on replaced XInclude nodes.</li>
+<li>Import fix for urljoin in Python 3.1+.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id247">
+<h1>2.2.7 (2010-07-24)</h1>
+<div class="section" id="id248">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XSLT when generating text-only result documents with a
+stylesheet created in a different thread.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id249">
+<h1>2.2.6 (2010-03-02)</h1>
+<div class="section" id="id250">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id251">
+<h1>2.2.5 (2010-02-28)</h1>
+<div class="section" id="id252">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for running XSLT extension elements on the input root node
+(e.g. in a template matching on &quot;/&quot;).</li>
+</ul>
+</div>
+<div class="section" id="id253">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in XPath evaluation when reading smart strings from a document
+other than the original context document.</li>
+<li>Support recent versions of html5lib by not requiring its
+<tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
+<li>Manually instantiating the custom element classes in
+<tt class="docutils literal">lxml.objectify</tt> could crash.</li>
+<li>Invalid XML text characters were not rejected by the API when they
+appeared in unicode strings directly after non-ASCII characters.</li>
+<li>lxml.html.open_http_urllib() did not work in Python 3.</li>
+<li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
+<tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
+<li>Crash in XSLT extension elements when the XSLT context node is not
+an element.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id254">
+<h1>2.2.4 (2009-11-11)</h1>
+<div class="section" id="id255">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Static build of libxml2/libxslt was broken.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id256">
+<h1>2.2.3 (2009-10-30)</h1>
+<div class="section" id="id257">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id258">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
+parser.</li>
+<li>Looking up and deleting attributes without a namespace could hit a
+namespaced attribute of the same name instead.</li>
+<li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
+ones) could leave a partially initialised element in the tree.</li>
+<li>Modifying trees that contain parsed entity references could result
+in an infinite loop.</li>
+<li>ObjectifiedElement.__setattr__ created an empty-string child element when the
+attribute value was rejected as a non-unicode/non-ascii string</li>
+<li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
+messages.</li>
+<li>Invalid syntax in CSS expressions could lead to an infinite loop in
+the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>CSS special character escapes were not properly handled in
+<tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
+<li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
+attribute were not handled correctly.  The HTML standard dictates
+that their value is defined by their text content.  This is now
+supported by lxml.html.</li>
+<li>XPath raised a TypeError when finding CDATA sections.  This is now
+fully supported.</li>
+<li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
+<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
+namespaces when annotation is disabled.</li>
+<li>Feed parser failed to honour the 'recover' option on parse errors.</li>
+<li>Diverting the error logging to Python's logging system was broken.</li>
+</ul>
+</div>
+<div class="section" id="id259">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id260">
+<h1>2.2.2 (2009-06-21)</h1>
+<div class="section" id="id261">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
+<tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
+from a subtree.</li>
+</ul>
+</div>
+<div class="section" id="id262">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Namespace cleanup on subtree insertions could result in missing
+namespace declarations (and potentially crashes) if the element
+defining a namespace was deleted and the namespace was not used by
+the top element of the inserted subtree but only in deeper subtrees.</li>
+<li>Raising an exception from a parser target callback didn't always
+terminate the parser.</li>
+<li>Only {true, false, 1, 0} are accepted as the lexical representation for
+BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
+behaviour.</li>
+</ul>
+</div>
+<div class="section" id="id263">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id264">
+<h1>2.2.1 (2009-06-02)</h1>
+<div class="section" id="id265">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Injecting default attributes into a document during XML Schema
+validation (also at parse time).</li>
+<li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
+restrictions imposed by libxml2 2.7.</li>
+</ul>
+</div>
+<div class="section" id="id266">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The script for statically building libxml2 and libxslt didn't work
+in Py3.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
+for parsing (which could lead to a crash before release 2.6.24).</li>
+</ul>
+</div>
+<div class="section" id="id267">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id268">
+<h1>2.2 (2009-03-21)</h1>
+<div class="section" id="id269">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
+<tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
+on serialisation.</li>
+</ul>
+</div>
+<div class="section" id="id270">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing an XML Schema with external imports from a
+filename.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta4-2009-02-27">
+<h1>2.2beta4 (2009-02-27)</h1>
+<div class="section" id="id271">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support strings and instantiable Element classes as child arguments
+to the constructor of custom Element classes.</li>
+<li>GZip compression support for serialisation to files and file-like
+objects.</li>
+</ul>
+</div>
+<div class="section" id="id272">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Deep-copying an ElementTree copied neither its sibling PIs and
+comments nor its internal/external DTD subsets.</li>
+<li>Soupparser failed on broken attributes without values.</li>
+<li>Crash in XSLT when overwriting an already defined attribute using
+<tt class="docutils literal">xsl:attribute</tt>.</li>
+<li>Crash bug in exception handling code under Python 3.  This was due
+to a problem in Cython, not lxml itself.</li>
+<li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
+<li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
+was evaluated incorrectly.</li>
+</ul>
+</div>
+<div class="section" id="id273">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Official support for Python 3.0.1.</li>
+<li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
+for Elements without text content.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2009-02-17">
+<h1>2.2beta3 (2009-02-17)</h1>
+<div class="section" id="id274">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
+that require escaping.</li>
+</ul>
+</div>
+<div class="section" id="id275">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak in XPath evaluators.</li>
+<li>Crash when parsing indented XML in one thread and merging it with
+other documents parsed in another thread.</li>
+<li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
+string failed.</li>
+<li>Fixes following changes in Python 3.0.1.</li>
+<li>Minor fixes for Python 3.</li>
+</ul>
+</div>
+<div class="section" id="id276">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The global error log (which is copied into the exception log) is now
+local to a thread, which fixes some race conditions.</li>
+<li>More robust error handling on serialisation.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta2-2009-01-25">
+<h1>2.2beta2 (2009-01-25)</h1>
+<div class="section" id="id277">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Potential memory leak on exception handling.  This was due to a
+problem in Cython, not lxml itself.</li>
+<li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
+<tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url(&quot;link&quot;)</span></tt> incorrectly
+(treating the quotation marks as part of the link).</li>
+<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id278">
+<h1>2.1.5 (2009-01-06)</h1>
+<div class="section" id="id279">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Potential memory leak on exception handling.  This was due to a
+problem in Cython, not lxml itself.</li>
+<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta1-2008-12-12">
+<h1>2.2beta1 (2008-12-12)</h1>
+<div class="section" id="id280">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
+just HTML strings.</li>
+</ul>
+</div>
+<div class="section" id="id281">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+<li>Fixed missing whitespace before <tt class="docutils literal"><span class="pre">Link:...</span></tt> in <tt class="docutils literal">lxml.html.diff</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id282">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id283">
+<h1>2.1.4 (2008-12-12)</h1>
+<div class="section" id="id284">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id285">
+<h1>2.0.11 (2008-12-12)</h1>
+<div class="section" id="id286">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when using an XPath evaluator in multiple threads.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="alpha1-2008-11-23">
+<h1>2.2alpha1 (2008-11-23)</h1>
+<div class="section" id="id287">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for XSLT result tree fragments in XPath/XSLT extension
+functions.</li>
+<li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
+<li>New options for exclusive C14N and C14N without comments.</li>
+<li>Instantiating a custom Element classes creates a new Element.</li>
+</ul>
+</div>
+<div class="section" id="id288">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>XSLT didn't inherit the parse options of the input document.</li>
+<li>0-bytes could slip through the API when used inside of Unicode
+strings.</li>
+<li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
+that end in a parenthesis, will be linked in their entirety (typical
+with Wikipedia links).</li>
+</ul>
+</div>
+<div class="section" id="id289">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id290">
+<h1>2.1.3 (2008-11-17)</h1>
+<div class="section" id="id291">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id292">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Ref-count leaks when lxml enters a try-except statement while an
+outside exception lives in sys.exc_*(). This was due to a problem in
+Cython, not lxml itself.</li>
+<li>Parser Unicode decoding errors could get swallowed by other
+exceptions.</li>
+<li>Name/import errors in some Python modules.</li>
+<li>Internal DTD subsets that did not specify a system or public ID were
+not serialised and did not appear in the docinfo property of
+ElementTrees.</li>
+<li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
+<li>Test suite fixes for libxml2 2.7.</li>
+<li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
+<li>Resolver.resolve_file() was broken.</li>
+<li>Overriding the parser encoding didn't work for many encodings.</li>
+</ul>
+</div>
+<div class="section" id="id293">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id294">
+<h1>2.0.10 (2008-11-17)</h1>
+<div class="section" id="id295">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Ref-count leaks when lxml enters a try-except statement while an
+outside exception lives in sys.exc_*(). This was due to a problem in
+Cython, not lxml itself.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id296">
+<h1>2.1.2 (2008-09-05)</h1>
+<div class="section" id="id297">
+<h2>Features added</h2>
+<ul class="simple">
+<li>lxml.etree now tries to find the absolute path name of files when
+parsing from a file-like object.  This helps custom resolvers when
+resolving relative URLs, as lixbml2 can prepend them with the path
+of the source document.</li>
+</ul>
+</div>
+<div class="section" id="id298">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory problem when passing documents between threads.</li>
+<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
+exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
+</ul>
+</div>
+<div class="section" id="id299">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id300">
+<h1>2.0.9 (2008-09-05)</h1>
+<div class="section" id="id301">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory problem when passing documents between threads.</li>
+<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
+exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id302">
+<h1>2.1.1 (2008-07-24)</h1>
+<div class="section" id="id303">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id304">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing XSLT stylesheets in a thread and using them in
+another.</li>
+<li>Encoding problem when including text with ElementInclude under
+Python 3.</li>
+</ul>
+</div>
+<div class="section" id="id305">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id306">
+<h1>2.0.8 (2008-07-24)</h1>
+<div class="section" id="id307">
+<h2>Features added</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
+with whitespace in URL attributes.</li>
+</ul>
+</div>
+<div class="section" id="id308">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when parsing XSLT stylesheets in a thread and using them in
+another.</li>
+<li>CSS selector parser dropped remaining expression after a function
+with parameters.</li>
+</ul>
+</div>
+<div class="section" id="id309">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="id310">
+<h1>2.1 (2008-07-09)</h1>
+<div class="section" id="id311">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
+keyword option).</li>
+<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
+with whitespace in URL attributes.</li>
+</ul>
+</div>
+<div class="section" id="id312">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Custom resolvers were not used for XMLSchema includes/imports and
+XInclude processing.</li>
+<li>CSS selector parser dropped remaining expression after a function
+with parameters.</li>
+</ul>
+</div>
+<div class="section" id="id313">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
+<tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
+<li>Speed-up when running XSLTs on documents from other threads</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id314">
+<h1>2.0.7 (2008-06-20)</h1>
+<div class="section" id="id315">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
+</ul>
+</div>
+<div class="section" id="id316">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Descending dot-separated classes in CSS selectors were not resolved
+correctly.</li>
+<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
+<li>Potential threading problem in XInclude.</li>
+<li>Crash in Element class lookup classes when the __init__() method of
+the super class is not called from Python subclasses.</li>
+</ul>
+</div>
+<div class="section" id="id317">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Non-ASCII characters in attribute values are no longer escaped on
+serialisation.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta3-2008-06-19">
+<h1>2.1beta3 (2008-06-19)</h1>
+<div class="section" id="id318">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
+<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
+<li>Support for parsing from file-like objects that return unicode
+strings.</li>
+<li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
+namespace declarations from a (sub)tree (experimental).</li>
+<li>XSLT results support the buffer protocol in Python 3.</li>
+<li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
+a parsable string will return either a UTF-8 encoded byte string, a
+unicode string or a tree, based on the type of the input.
+Previously, the result was always a byte string or a tree.</li>
+<li>Support for Python 2.6 and 3.0 beta.</li>
+<li>File name handling now uses a heuristic to convert between byte
+strings (usually filenames) and unicode strings (usually URLs).</li>
+<li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
+<li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
+on reading under Python 2.x.</li>
+<li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
+lxml.html (experimental).</li>
+<li>Most features in lxml.html work for XHTML namespaced tag names
+(experimental).</li>
+</ul>
+</div>
+<div class="section" id="id319">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
+<li>Crash in Element class lookup classes when the __init__() method of
+the super class is not called from Python subclasses.</li>
+<li>A number of problems related to unicode/byte string conversion of
+filenames and error messages were fixed.</li>
+<li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
+compiler, which reportedly prevents build quirks and crashes on this
+platform.</li>
+<li>Windows build was broken.</li>
+<li>Rare crash when serialising to a file object with certain encodings.</li>
+</ul>
+</div>
+<div class="section" id="id320">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Non-ASCII characters in attribute values are no longer escaped on
+serialisation.</li>
+<li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
+namespaces, etc. will result in a ValueError instead of an
+AssertionError (just like the tag well-formedness check).</li>
+<li>Up to several times faster attribute access (i.e. tree traversal) in
+lxml.objectify.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id321">
+<h1>2.0.6 (2008-05-31)</h1>
+<div class="section" id="id322">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id323">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
+<li>Windows build was broken.</li>
+<li>Moving a subtree from a document created in one thread into a
+document of another thread could crash when the rest of the source
+document is deleted while the subtree is still in use.</li>
+<li>Rare crash when serialising to a file object with certain encodings.</li>
+</ul>
+</div>
+<div class="section" id="id324">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>lxml should now build without problems on MacOS-X.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="beta2-2008-05-02">
+<h1>2.1beta2 (2008-05-02)</h1>
+<div class="section" id="id325">
+<h2>Features added</h2>
+<ul class="simple">
+<li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
+<li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
+attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
+pre-configured for the lxml.html package.</li>
+</ul>
+</div>
+<div class="section" id="id326">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Moving a subtree from a document created in one thread into a
+document of another thread could crash when the rest of the source
+document is deleted while the subtree is still in use.</li>
+<li>Passing an nsmap when creating an Element will no longer strip
+redundantly defined namespace URIs.  This prevented the definition
+of more than one prefix for a namespace on the same Element.</li>
+</ul>
+</div>
+<div class="section" id="id327">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>If the default namespace is redundantly defined with a prefix on the
+same Element, the prefix will now be preferred for subelements and
+attributes.  This allows users to work around a problem in libxml2
+where attributes from the default namespace could serialise without
+a prefix even when they appear on an Element with a different
+namespace (i.e. they would end up in the wrong namespace).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id328">
+<h1>2.0.5 (2008-05-01)</h1>
+<div class="section" id="id329">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id330">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Resolving to a filename in custom resolvers didn't work.</li>
+<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
+let some XSLT errors pass silently.</li>
+<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
+</ul>
+</div>
+<div class="section" id="id331">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="beta1-2008-04-15">
+<h1>2.1beta1 (2008-04-15)</h1>
+<div class="section" id="id332">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
+<li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
+sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
+sections by their text content.</li>
+<li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
+</ul>
+</div>
+<div class="section" id="id333">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Resolving to a filename in custom resolvers didn't work.</li>
+<li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
+let some XSLT errors pass silently.</li>
+<li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
+<li>lxml.etree accepted non well-formed namespace prefix names.</li>
+</ul>
+</div>
+<div class="section" id="id334">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
+takes care of namespace cleanup when moving elements between
+different namespace contexts.</li>
+<li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
+parser or through lxml.html now end up in a new HTML document
+(doctype HTML 4.01 Transitional) instead of a generic XML document.
+This mostly impacts the serialisation and the availability of a DTD
+context.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id335">
+<h1>2.0.4 (2008-04-13)</h1>
+<div class="section" id="id336">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id337">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Hanging thread in conjunction with GTK threading.</li>
+<li>Crash bug in iterparse when moving elements into other documents.</li>
+<li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
+<li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
+</ul>
+</div>
+<div class="section" id="id338">
+<h2>Other changes</h2>
+</div>
+</div>
+<div class="section" id="alpha1-2008-03-27">
+<h1>2.1alpha1 (2008-03-27)</h1>
+<div class="section" id="id339">
+<h2>Features added</h2>
+<ul class="simple">
+<li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
+<li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
+returns a dict of access configuration options.</li>
+<li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
+<tt class="docutils literal">XSLTAccessControl</tt> class.</li>
+<li>Extension elements for XSLT (experimental!)</li>
+<li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
+an Element.</li>
+<li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
+</ul>
+</div>
+<div class="section" id="id340">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Default encoding for plain text serialisation was different from
+that of XML serialisation (UTF-8 instead of ASCII).</li>
+</ul>
+</div>
+<div class="section" id="id341">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Minor API speed-ups.</li>
+<li>The benchmark suite now uses tail text in the trees, which makes the
+absolute numbers incomparable to previous results.</li>
+<li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
+used to enable syntax highlighting for the doctest examples.</li>
+</ul>
+<p>Most long-time deprecated functions and methods were removed:</p>
+<ul>
+<li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
+<tt class="docutils literal">etree.use_global_python_log()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
+<tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
+<tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
+<p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
+yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
+instead.</p>
+</li>
+<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
+<tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
+<tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
+<tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
+</li>
+<li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
+<tt class="docutils literal">objectify.set_default_parser()</tt></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id342">
+<h1>2.0.3 (2008-03-26)</h1>
+<div class="section" id="id343">
+<h2>Features added</h2>
+<ul class="simple">
+<li>soupparser.parse() allows passing keyword arguments on to
+BeautifulSoup.</li>
+<li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
+</ul>
+</div>
+<div class="section" id="id344">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
+<tt class="docutils literal">&lt;br&gt;</tt>).</li>
+<li>Handle entity replacements correctly in target parser.</li>
+<li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
+<li>The BeautifulSoup parser (soupparser.py) did not replace entities,
+which made them turn up in text content.</li>
+<li>Attribute assignment of custom PyTypes in objectify could fail to
+correctly serialise the value to a string.</li>
+</ul>
+</div>
+<div class="section" id="id345">
+<h2>Other changes</h2>
+<ul class="simple">
+<li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
+<tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
+remains for compatibility with ElementTree's own ElementSoup module.</li>
+<li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
+build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
+<tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
+<li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
+override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
+compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
+option.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id346">
+<h1>2.0.2 (2008-02-22)</h1>
+<div class="section" id="id347">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
+the filename of the file(-like) object.</li>
+</ul>
+</div>
+<div class="section" id="id348">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The prefix for objectify's pytype namespace was missing from the set
+of default prefixes.</li>
+<li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
+<li>Error type names in RelaxNG were reported incorrectly.</li>
+<li>Slice deletion bug fixed in objectify.</li>
+</ul>
+</div>
+<div class="section" id="id349">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
+<li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
+(<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
+<li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
+<tt class="docutils literal">base_url</tt> argument.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id350">
+<h1>2.0.1 (2008-02-13)</h1>
+<div class="section" id="id351">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
+<li>Loads of new docstrings reflect the signature of functions and
+methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
+</ul>
+</div>
+<div class="section" id="id352">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
+<tt class="docutils literal">lxml.htmlbuilder</tt></li>
+<li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
+was an unnamed input field.  Now unnamed input fields are completely
+ignored.</li>
+<li>Setting an element slice in objectify could insert slice-overlapping
+elements at the wrong position.</li>
+</ul>
+</div>
+<div class="section" id="id353">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The generated API documentation was cleaned up and disburdened from
+non-public classes etc.</li>
+<li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
+<tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
+you want to use it, feel free to copy it over to your own source
+base.</li>
+<li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
+override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
+compiler options.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id354">
+<h1>2.0 (2008-02-01)</h1>
+<div class="section" id="id355">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Passing the <tt class="docutils literal">unicode</tt> type as <tt class="docutils literal">encoding</tt> to <tt class="docutils literal">tostring()</tt> will
+serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
+deprecated.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
+<li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
+parser with the usual objectify setup.</li>
+<li>Plain ASCII XPath string results are no longer forced into unicode
+objects as in 2.0beta1, but are returned as plain strings as before.</li>
+<li>All XPath string results are 'smart' objects that have a
+<tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
+<li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
+<li>More accurate exception messages in validator creation.</li>
+<li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
+<li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
+selection make their Element container accessible through a
+<tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
+unicode objects (even ASCII strings).</li>
+<li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
+copy if they were not created in that thread.</li>
+<li>Invalid entity names and character references will be rejected by
+the <tt class="docutils literal">Entity()</tt> factory.</li>
+<li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
+e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
+<li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
+in ET 1.3)</li>
+<li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
+<li>ElementTree compatible TreeBuilder class.</li>
+<li>Use default prefixes for some common XML namespaces.</li>
+<li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
+two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
+more general <tt class="docutils literal">allow_element(el)</tt>.</li>
+<li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
+etree and in objectify</li>
+<li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
+resolving a document as string data.</li>
+<li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
+<tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
+the special checking for one test.</li>
+<li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
+The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
+<tt class="docutils literal">error_log</tt>.</li>
+<li>The normal parsers and the feed parser interface are now separated
+and can be used concurrently on the same parser instance.</li>
+<li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
+ElementTree 1.3</li>
+<li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
+parsing with the HTML parser (note that this interface may be
+subject to change)</li>
+<li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
+of the parsed documents.</li>
+<li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
+<li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
+types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
+<li><tt class="docutils literal">ET.write()</tt>, <tt class="docutils literal">tostring()</tt> and <tt class="docutils literal">tounicode()</tt> now accept a keyword
+argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
+serialise as XML, HTML or plain text content.</li>
+<li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
+<tt class="docutils literal">findall()</tt></li>
+<li><tt class="docutils literal">itertext()</tt> method on Elements</li>
+<li>Setting a QName object as value of the .text property or as an attribute
+will resolve its prefix in the respective context</li>
+<li>ElementTree-like parser target interface as described in
+<a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
+<li>ElementTree-like feed parser interface on XMLParser and HTMLParser
+(<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
+<li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
+integration with objectify.  Provides extended type support based on
+registered PyTypes.</li>
+<li>XSLT objects now support deep copying</li>
+<li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
+subelement straight with text, tail and attributes.</li>
+<li>XPath extension functions can now access the current context node
+(<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
+(<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
+parameter</li>
+<li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
+<li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
+doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
+<tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
+<li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
+selectors.</li>
+<li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
+treatment.</li>
+<li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
+instance and no longer global.</li>
+<li>Schematron validation (incomplete in libxml2)</li>
+<li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
+conversion function to strings to support setting text values from arbitrary
+types.</li>
+<li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
+parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
+False to keep entities in the document.</li>
+<li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
+<li>Error specific messages in XPath parsing and evaluation
+NOTE: for evaluation errors, you will now get an XPathEvalError instead of
+an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
+<li>The regular expression functions in XPath now support passing a node-set
+instead of a string</li>
+<li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
+<li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
+</ul>
+</div>
+<div class="section" id="id356">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
+<li>Some Python 2.4-isms prevented lxml from building/running under
+Python 2.3.</li>
+<li>XPath on ElementTrees could crash when selecting the virtual root
+node of the ElementTree.</li>
+<li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
+<li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
+<li>Minor bugs in XSLT error message formatting.</li>
+<li>Result document memory leak in target parser.</li>
+<li>Target parser failed to report comments.</li>
+<li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal">&lt;object&gt;</tt>
+tags weren't recognized.  (Note: plugin-specific link parameters
+still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
+standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
+<li>Using custom resolvers on XSLT stylesheets parsed from a string
+could request ill-formed URLs.</li>
+<li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal">&lt;tag <span class="pre">xmlns=&quot;...&quot;&gt;</span></tt> in your
+output, it will then be namespace-neutral (before the ellipsis was
+treated as a real namespace).</li>
+<li>AttributeError in feed parser on parse errors</li>
+<li>XML feed parser setup problem</li>
+<li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
+<li>lxml failed to serialise namespace declarations of elements other than the
+root node of a tree</li>
+<li>Race condition in XSLT where the resolver context leaked between concurrent
+XSLT calls</li>
+<li>lxml.etree did not check tag/attribute names</li>
+<li>The XML parser did not report undefined entities as error</li>
+<li>The text in exceptions raised by XML parsers, validators and XPath
+evaluators now reports the first error that occurred instead of the last</li>
+<li>Passing '' as XPath namespace prefix did not raise an error</li>
+<li>Thread safety in XPath evaluators</li>
+</ul>
+</div>
+<div class="section" id="id357">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>Exceptions carry only the part of the error log that is related to
+the operation that caused the error.</li>
+<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
+file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
+<li>The test suite now skips most doctests under Python 2.3.</li>
+<li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
+realclean</tt> instead)</li>
+<li>Minor performance tweaks for Element instantiation and subelement
+creation</li>
+<li>Various places in the XPath, XSLT and iteration APIs now require
+keyword-only arguments.</li>
+<li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
+match the order used in all other iteration methods.  The second
+argument ('preceding') is now a keyword-only argument.</li>
+<li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
+reverted to return an iterator as it did in lxml 1.x.  The ET API
+specification allows it to return either a sequence or an iterator,
+and it traditionally returned a sequence in ET and an iterator in
+lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
+method, which should be used in new code wherever possible.</li>
+<li>The 'pretty printed' serialisation of ElementTree objects now
+inserts newlines at the root level between processing instructions,
+comments and the root tag.</li>
+<li>A 'pretty printed' serialisation is now terminated with a newline.</li>
+<li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
+required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
+<li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
+<li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
+&quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
+Pyrex commonly handles package imports.  The main effect is that
+classes now know about their fully qualified class name, including
+the package name of their module.</li>
+<li>Keyword-only arguments in some API functions, especially in the
+parsers and serialisers.</li>
+<li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
+between HTML tags and XML tags based on the parser that was used to
+parse or create them.  HTML tags no longer reject any non-ASCII
+characters in tag names but only spaces and the special characters
+<tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
+<li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
+(which can crash on certain XPath errors)</li>
+<li>Type annotation in objectify now preserves the already annotated type by
+default to prevent losing type information that is already there.</li>
+<li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
+an iterator (ElementTree 1.3 compatible behaviour)</li>
+<li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
+<li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
+original name is still available as alias</li>
+<li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
+generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
+<li>Major refactoring in XPath/XSLT extension function code</li>
+<li>Network access in parsers disabled by default</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id358">
+<h1>1.3.6 (2007-10-29)</h1>
+<div class="section" id="id359">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Backported decref crash fix from 2.0</li>
+<li>Well hidden free-while-in-use crash bug in ObjectPath</li>
+</ul>
+</div>
+<div class="section" id="id360">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
+methods.  While this makes them take a lot longer to run, it also
+makes it easier to link a specific test to garbage collection
+problems that would otherwise appear in later tests.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id361">
+<h1>1.3.5 (2007-10-22)</h1>
+<div class="section" id="id362">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id363">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>lxml.etree could crash when adding more than 10000 namespaces to a
+document</li>
+<li>lxml failed to serialise namespace declarations of elements other
+than the root node of a tree</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id364">
+<h1>1.3.4 (2007-08-30)</h1>
+<div class="section" id="id365">
+<h2>Features added</h2>
+<ul class="simple">
+<li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
+<tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
+creates.</li>
+<li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
+and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
+subset of the document respectively.</li>
+<li>Serialising an ElementTree now includes any internal DTD subsets that are
+part of the document, as well as comments and PIs that are siblings of the
+root node.</li>
+</ul>
+</div>
+<div class="section" id="id366">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
+</ul>
+</div>
+<div class="section" id="id367">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>lxml now raises a TagNameWarning about tag names containing ':' instead of
+an Error as 1.3.3 did.  The reason is that a number of projects currently
+misuse the previous lack of tag name validation to generate namespace
+prefixes without declaring namespaces.  Apart from the danger of generating
+broken XML this way, it also breaks most of the namespace-aware tools in
+XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
+support this bug with a Warning, while lxml 2.0 will be strict about
+well-formed tag names (not only regarding ':').</li>
+<li>Serialising an Element no longer includes its comment and PI siblings (only
+ElementTree serialisation includes them).</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id368">
+<h1>1.3.3 (2007-07-26)</h1>
+<div class="section" id="id369">
+<h2>Features added</h2>
+<ul class="simple">
+<li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
+instructions and comments while parsing XML</li>
+<li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
+<li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
+the parser you pass.</li>
+<li>Support <tt class="docutils literal">base_url</tt> keyword argument in <tt class="docutils literal">HTML()</tt> and <tt class="docutils literal">XML()</tt></li>
+</ul>
+</div>
+<div class="section" id="id370">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parsing from Python Unicode strings failed on some platforms</li>
+<li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
+<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
+<tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id371">
+<h1>1.3.2 (2007-07-03)</h1>
+<div class="section" id="id372">
+<h2>Features added</h2>
+</div>
+<div class="section" id="id373">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>&quot;deallocating None&quot; crash bug</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id374">
+<h1>1.3.1 (2007-07-02)</h1>
+<div class="section" id="id375">
+<h2>Features added</h2>
+<ul class="simple">
+<li>objectify.DataElement now supports setting values from existing data
+elements (not just plain Python types) and reuses defined namespaces etc.</li>
+<li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
+</ul>
+</div>
+<div class="section" id="id376">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Better way to prevent crashes in Element proxy cleanup code</li>
+<li>objectify.DataElement didn't set up None value correctly</li>
+<li>objectify.DataElement didn't check the value against the provided type hints</li>
+<li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id377">
+<h1>1.3 (2007-06-24)</h1>
+<div class="section" id="id378">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
+scheme that can access the entire tree in read-only mode to help determining
+a suitable Element class</li>
+<li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
+<li><tt class="docutils literal">parse()</tt> function in <tt class="docutils literal">objectify</tt>, corresponding to <tt class="docutils literal">XML()</tt> etc.</li>
+<li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
+adding processing instructions and comments around the root node</li>
+<li><tt class="docutils literal">Element.attrib</tt> was missing <tt class="docutils literal">clear()</tt> and <tt class="docutils literal">pop()</tt> methods</li>
+<li>Extended type annotation in objectify: cleaner annotation namespace setup
+plus new <tt class="docutils literal">deannotate()</tt> function</li>
+<li>Support for custom Element class instantiation in lxml.sax: passing a
+<tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
+lookup context of that function</li>
+<li>'.' represents empty ObjectPath (identity)</li>
+<li><tt class="docutils literal">Element.values()</tt> to accompany the existing <tt class="docutils literal">.keys()</tt> and <tt class="docutils literal">.items()</tt></li>
+<li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
+keys/values/items for a libxml2 node</li>
+<li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
+<li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
+<li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
+<li>Support for pickling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
+<li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
+<li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
+a better handling of namespaces when moving elements between documents.</li>
+</ul>
+</div>
+<div class="section" id="id379">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Removing Elements from a tree could make them lose their namespace
+declarations</li>
+<li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
+<li>Replacing the children slice of an Element would cut off the tails of the
+original children</li>
+<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
+<tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
+<li>API functions now check incoming strings for XML conformity.  Zero bytes or
+low ASCII characters are no longer accepted (AssertionError).</li>
+<li>XSLT parsing failed to pass resolver context on to imported documents</li>
+<li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
+<li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
+<li>More ET compatible behaviour when writing out XML declarations or not</li>
+<li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
+<li>Documents lost their top-level PIs and comments on serialisation</li>
+<li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
+PIs are copied.</li>
+<li>Possible memory leaks in namespace handling when moving elements between
+documents</li>
+</ul>
+</div>
+<div class="section" id="id380">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>major restructuring in the documentation</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id381">
+<h1>1.2.1 (2007-02-27)</h1>
+<div class="section" id="id382">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Build fixes for MS compiler</li>
+<li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
+<li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
+to access</li>
+<li>The pattern for attribute names in ObjectPath was too restrictive</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id383">
+<h1>1.2 (2007-02-20)</h1>
+<div class="section" id="id384">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Rich comparison of QName objects</li>
+<li>Support for regular expressions in benchmark selection</li>
+<li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
+<li>ElementInclude Python module for ElementTree compatible XInclude processing
+that honours custom resolvers registered with the source document</li>
+<li>ElementTree.parser property holds the parser used to parse the document</li>
+<li>setup.py has been refactored for greater readability and flexibility</li>
+<li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
+runtime search paths has been renamed to --auto-rpath. This makes it
+possible to pass an --rpath directly to distutils; previously this was being
+shadowed.</li>
+</ul>
+</div>
+<div class="section" id="id385">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Element instantiation now uses locks to prevent race conditions with threads</li>
+<li>ElementTree.write() did not raise an exception when the file was not writable</li>
+<li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
+support in these environments</li>
+<li>Element.find*() did not accept QName objects as path</li>
+</ul>
+</div>
+<div class="section" id="id386">
+<h2>Other changes</h2>
+<ul class="simple">
+<li>code cleanup: redundant _NodeBase super class merged into _Element class
+Note: although the impact should be zero in most cases, this change breaks
+the compatibility of the public C-API</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id387">
+<h1>1.1.2 (2006-10-30)</h1>
+<div class="section" id="id388">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Data elements in objectify support repr(), which is now used by dump()</li>
+<li>Source distribution now ships with a patched Pyrex</li>
+<li>New C-API function makeElement() to create new elements with text,
+tail, attributes and namespaces</li>
+<li>Reuse original parser flags for XInclude</li>
+<li>Simplified support for handling XSLT processing instructions</li>
+</ul>
+</div>
+<div class="section" id="id389">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Parser resources were not freed before the next parser run</li>
+<li>Open files and XML strings returned by Python resolvers were not
+closed/freed</li>
+<li>Crash in the IDDict returned by XMLDTDID</li>
+<li>Copying Comments and ProcessingInstructions failed</li>
+<li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
+<li>Memory leak when garbage collecting tailed root elements</li>
+<li>HTML script/style content was not propagated to .text</li>
+<li>Show text xincluded between text nodes correctly in .text and .tail</li>
+<li>'integer * objectify.StringElement' operation was not supported</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id390">
+<h1>1.1.1 (2006-09-21)</h1>
+<div class="section" id="id391">
+<h2>Features added</h2>
+<ul class="simple">
+<li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
+<li>countchildren() method on objectify.ObjectifiedElement</li>
+<li>Support custom elements for tree nodes in lxml.objectify</li>
+</ul>
+</div>
+<div class="section" id="id392">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
+<li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
+<li>Factories objectify.Element() and objectify.DataElement() were missing
+<tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
+<li>Changing the default parser in lxml.objectify did not update the factories
+Element() and DataElement()</li>
+<li>Let lxml.objectify.Element() always generate tree elements (not data
+elements)</li>
+<li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id393">
+<h1>1.1 (2006-09-13)</h1>
+<div class="section" id="id394">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
+'&lt;?pi-target content?&gt;' for repr()</li>
+<li>Parsers are now the preferred (and default) place where element class lookup
+schemes should be registered.  Namespace lookup is no longer supported by
+default.</li>
+<li>Support for Python 2.5 beta</li>
+<li>Unlock the GIL for deep copying documents and for XPath()</li>
+<li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
+<li>Support for parser options in iterparse()</li>
+<li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
+tuples</li>
+<li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
+exception</li>
+<li>XML-Object API on top of lxml (lxml.objectify)</li>
+<li>Customizable Element class lookup:<ul>
+<li>different pre-implemented lookup mechanisms</li>
+<li>support for externally provided lookup functions</li>
+</ul>
+</li>
+<li>Support for processing instructions (ET-like, not compatible)</li>
+<li>Public C-level API for independent extension modules</li>
+<li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
+<li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
+documentation for differences)</li>
+<li>Element.nsmap property returns a mapping of all namespace prefixes known at
+the Element to their namespace URI</li>
+<li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
+<li>Threading support in parsers and serializers:<ul>
+<li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
+<li>File operations (on file names) free the GIL</li>
+<li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
+<li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
+</ul>
+</li>
+<li>Element iteration over XPath axes:<ul>
+<li>Element.iterdescendants() iterates over the descendants of an element</li>
+<li>Element.iterancestors() iterates over the ancestors of an element (from
+parent to parent)</li>
+<li>Element.itersiblings() iterates over either the following or preceding
+siblings of an element</li>
+<li>Element.iterchildren() iterates over the children of an element in either
+direction</li>
+<li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
+generated elements</li>
+</ul>
+</li>
+<li>Element.getnext() and Element.getprevious() return the direct siblings of an
+element</li>
+</ul>
+</div>
+<div class="section" id="id395">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>filenames with local 8-bit encoding were not supported</li>
+<li>1.1beta did not compile under Python 2.3</li>
+<li>ignore unknown 'pyval' attribute values in objectify</li>
+<li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
+<li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
+<li>XPathSyntaxError now inherits from XPathError</li>
+<li>Threading race conditions in RelaxNG and XMLSchema</li>
+<li>Crash when mixing elements from XSLT results into other trees, concurrent
+XSLT is only allowed when the stylesheet was parsed in the main thread</li>
+<li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
+differences in the regular expression syntax)</li>
+<li>Setting element.text to '' returned None on request, not the empty string</li>
+<li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
+<li>Creating documents no longer copies the parser for later URL resolving.  For
+performance reasons, only a reference is kept.  Resolver updates on the
+parser will now be reflected by documents that were parsed before the
+change.  Although this should rarely become visible, it is a behavioral
+change from 1.0.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id396">
+<h1>1.0.4 (2006-09-09)</h1>
+<div class="section" id="id397">
+<h2>Features added</h2>
+<ul class="simple">
+<li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
+</ul>
+</div>
+<div class="section" id="id398">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
+</ul>
+</div>
+</div>
+<div class="section" id="id399">
+<h1>1.0.3 (2006-08-08)</h1>
+<div class="section" id="id400">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Element.replace(old, new) method to replace a subelement by another one</li>
+</ul>
+</div>
+<div class="section" id="id401">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Crash when mixing elements from XSLT results into other trees</li>
+<li>Copying/deepcopying did not work for ElementTree objects</li>
+<li>Setting an attribute to a non-string value did not raise an exception</li>
+<li>Element.remove() deleted the tail text from the removed Element</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id402">
+<h1>1.0.2 (2006-06-27)</h1>
+<div class="section" id="id403">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for setting a custom default Element class as opposed to namespace
+specific classes (which still override the default class)</li>
+</ul>
+</div>
+<div class="section" id="id404">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Rare exceptions in Python list functions were not handled</li>
+<li>Parsing accepted unicode strings with XML encoding declaration in certain
+cases</li>
+<li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
+<li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
+<li>XSLT and parser exception messages include the error line number</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id405">
+<h1>1.0.1 (2006-06-09)</h1>
+<div class="section" id="id406">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Repeated calls to Element.attrib now efficiently return the same instance</li>
+</ul>
+</div>
+<div class="section" id="id407">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Document deallocation could crash in certain garbage collection scenarios</li>
+<li>Extension function calls in XSLT variable declarations could break the
+stylesheet and crash on repeated calls</li>
+<li>Deep copying Elements could lose namespaces declared in parents</li>
+<li>Deep copying Elements did not copy tail</li>
+<li>Parsing file(-like) objects failed to load external entities</li>
+<li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
+<li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
+<li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
+<li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id408">
+<h1>1.0 (2006-06-01)</h1>
+<div class="section" id="id409">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Element.getiterator() and the findall() methods support finding arbitrary
+elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
+<li>Another speedup in tree iteration code</li>
+<li>General speedup of Python Element object creation and deallocation</li>
+<li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
+<li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
+<li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
+document that contains the element.</li>
+<li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
+find the element in the tree structure</li>
+<li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
+<li>Comment texts can be changed through the API</li>
+<li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
+<li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
+<li>ElementTree.write() no longer serializes in memory (reduced memory
+footprint)</li>
+<li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
+<li>Support for writing the XML representation of Elements and ElementTrees to
+Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
+<li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
+<li>Parsing a unicode string no longer copies the string (reduced memory
+footprint)</li>
+<li>Parsing file-like objects reads chunks rather than the whole file (reduced
+memory footprint)</li>
+<li>Parsing StringIO objects from the start avoids copying the string (reduced
+memory footprint)</li>
+<li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
+information, original encoding and XML version as seen by the parser</li>
+<li>etree module can be compiled without libxslt by commenting out the line
+<tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
+<li>Better error messages in parser exceptions</li>
+<li>Error reporting also works in XSLT</li>
+<li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
+resolvers are registered at parser level</li>
+<li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
+enabled by default, can be switched off with 'regexp=False' keyword argument</li>
+<li>Support for exslt extensions (libexslt) and libxslt extra functions
+(node-set, document, write, output)</li>
+<li>Substantial speedup in XPath.evaluate()</li>
+<li>HTMLParser for parsing (broken) HTML</li>
+<li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
+implementation of libxml2 (as opposed to ET compatible XMLID)</li>
+</ul>
+</div>
+<div class="section" id="id410">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory leak in Element.__setitem__</li>
+<li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
+<li>Memory leak in XPath extension functions</li>
+<li>Memory leak in unicode related setup code</li>
+<li>Element now raises ValueError on empty tag names</li>
+<li>Namespace fixing after moving elements between documents could fail if the
+source document was freed too early</li>
+<li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
+didn't reset the namespace</li>
+<li>Unknown constants from newer libxml2 versions could raise exceptions in the
+error handlers</li>
+<li>lxml.etree compiles much faster</li>
+<li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
+in certain cases</li>
+<li>Document reference in ElementTree objects was not updated when the root
+element was moved to a different document</li>
+<li>Running absolute XPath expressions on an Element now evaluates against the
+root tree</li>
+<li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
+<li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
+objects</li>
+<li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
+<tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
+<li>Memory leak when using iconv encoders in tostring/write</li>
+<li>Deep copying Elements and ElementTrees maintains the document information</li>
+<li>Serialization functions raise LookupError for unknown encodings</li>
+<li>Memory deallocation crash resulting from deep copying elements</li>
+<li>Some ElementTree methods could crash if the root node was not initialized
+(neither file nor element passed to the constructor)</li>
+<li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
+dictionary</li>
+<li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
+<li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
+<li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
+ElementTree root node as reference point</li>
+<li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id411">
+<h1>0.9.2 (2006-05-10)</h1>
+<div class="section" id="id412">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Speedup for Element.makeelement(): the new element reuses the original
+libxml2 document instead of creating a new empty one</li>
+<li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
+<li>ElementTree compatible QName class</li>
+<li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
+</ul>
+</div>
+<div class="section" id="id413">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
+<li>Memory leak if write_c14n fails to write the file after conversion</li>
+<li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
+<li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id414">
+<h1>0.9.1 (2006-03-30)</h1>
+<div class="section" id="id415">
+<h2>Features added</h2>
+<ul class="simple">
+<li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
+SaxError on mismatch</li>
+<li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
+(startElement, endElement) and defaults to empty attributes (keyword
+argument)</li>
+<li>Speedup for repeatedly accessing element tag names</li>
+<li>Minor API performance improvements</li>
+</ul>
+</div>
+<div class="section" id="id416">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
+<li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
+<li>lxml.tests package will no longer be installed (is still in source tar)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id417">
+<h1>0.9 (2006-03-20)</h1>
+<div class="section" id="id418">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Error logging API for libxml2 error messages</li>
+<li>Various performance improvements</li>
+<li>Benchmark script for lxml, ElementTree and cElementTree</li>
+<li>Support for registering extension functions through new FunctionNamespace
+class (see doc/extensions.txt)</li>
+<li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
+<li>Support for variables in XPath expressions (also in XPath class)</li>
+<li>XPath class for compiled XPath expressions</li>
+<li>XMLID module level function (ElementTree compatible)</li>
+<li>XMLParser API for customized libxml2 parser configuration</li>
+<li>Support for custom Element classes through new Namespace API (see
+doc/namespace_extensions.txt)</li>
+<li>Common exception base class LxmlError for module exceptions</li>
+<li>real iterator support in iter(Element), Element.getiterator()</li>
+<li>XSLT objects are callable, result trees support str()</li>
+<li>Added MANIFEST.in for easier creation of RPM files.</li>
+<li>'getparent' method on elements allows navigation to an element's
+parent element.</li>
+<li>Python core compatible SAX tree builder and SAX event generator. See
+doc/sax.txt for more information.</li>
+</ul>
+</div>
+<div class="section" id="id419">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Segfaults and memory leaks in various API functions of Element</li>
+<li>Segfault in XSLT.tostring()</li>
+<li>ElementTree objects no longer interfere, Elements can be root of different
+ElementTrees at the same time</li>
+<li>document('') works in XSLT documents read from files (in-memory documents
+cannot support this due to libxslt deficiencies)</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id420">
+<h1>0.8 (2005-11-03)</h1>
+<div class="section" id="id421">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Support for copy.deepcopy() on elements. copy.copy() works also, but
+does the same thing, and does <em>not</em> create a shallow copy, as that
+makes no sense in the context of libxml2 trees. This means a
+potential incompatibility with ElementTree, but there's more chance
+that it works than if copy.copy() isn't supported at all.</li>
+<li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
+supported and parsing of gzipped XML files works.</li>
+<li>implemented index() on elements, allowing one to find the index of a
+SubElement.</li>
+</ul>
+</div>
+<div class="section" id="id422">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Use xslt-config instead of xml2-config to find out libxml2
+directories to take into account a case where libxslt is installed
+in a different directory than libxslt.</li>
+<li>Eliminate crash condition in iteration when text nodes are changed.</li>
+<li>Passing 'None' to tostring() does not result in a segfault anymore,
+but an AssertionError.</li>
+<li>Some test fixes for Windows.</li>
+<li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
+syntax errors. This should be less confusing.</li>
+<li>Fixed error with uncaught exception in Pyrex code.</li>
+<li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
+segfault.</li>
+<li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
+<li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
+libxml2 version, as it should.</li>
+<li>Passing a UTF-8 encoded string to the XML() function would fail;
+fixed.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id423">
+<h1>0.7 (2005-06-15)</h1>
+<div class="section" id="id424">
+<h2>Features added</h2>
+<ul class="simple">
+<li>parameters (XPath expressions) can be passed to XSLT using keyword
+parameters.</li>
+<li>Simple XInclude support. Calling the xinclude() method on a tree
+will process any XInclude statements in the document.</li>
+<li>XMLSchema support. Use the XMLSchema class or the convenience
+xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
+<li>Added convenience xslt() method on tree. This is less efficient
+than the XSLT object, but makes it easier to write quick code.</li>
+<li>Added convenience relaxng() method on tree. This is less efficient
+than the RelaxNG object, but makes it easier to write quick code.</li>
+<li>Make it possible to use XPathEvaluator with elements as well. The
+XPathEvaluator in this case will retain the element so multiple
+XPath queries can be made against one element efficiently. This
+replaces the second argument to the .evaluate() method that existed
+previously.</li>
+<li>Allow registerNamespace() to be called on an XPathEvaluator, after
+creation, to add additional namespaces. Also allow registerNamespaces(),
+which does the same for a namespace dictionary.</li>
+<li>Add 'prefix' attribute to element to be able to read prefix information.
+This is entirely read-only.</li>
+<li>It is possible to supply an extra nsmap keyword parameter to
+the Element() and SubElement() constructors, which supplies a
+prefix to namespace URI mapping. This will create namespace
+prefix declarations on these elements and these prefixes will show up
+in XML serialization.</li>
+</ul>
+</div>
+<div class="section" id="id425">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Killed yet another memory management related bug: trees created
+using newDoc would not get a libxml2-level dictionary, which caused
+problems when deallocating these documents later if they contained a
+node that came from a document with a dictionary.</li>
+<li>Moving namespaced elements between documents was problematic as
+references to the original document would remain. This has been fixed
+by applying xmlReconciliateNs() after each move operation.</li>
+<li>Can pass None to 'dump()' without segfaults.</li>
+<li>tostring() works properly for non-root elements as well.</li>
+<li>Cleaned out the tostring() method so it should handle encoding
+correctly.</li>
+<li>Cleaned out the ElementTree.write() method so it should handle encoding
+correctly. Writing directly to a file should also be faster, as there is no
+need to go through a Python string in that case. Made sure the test cases
+test both serializing to StringIO as well as serializing to a real file.</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id426">
+<h1>0.6 (2005-05-14)</h1>
+<div class="section" id="id427">
+<h2>Features added</h2>
+<ul class="simple">
+<li>Changed setup.py so that library_dirs is also guessed. This should
+help with compilation on the Mac OS X platform, where otherwise the
+wrong library (shipping with the OS) could be picked up.</li>
+<li>Tweaked setup.py so that it picks up the version from version.txt.</li>
+</ul>
+</div>
+<div class="section" id="id428">
+<h2>Bugs fixed</h2>
+<ul class="simple">
+<li>Do the right thing when handling namespaced attributes.</li>
+<li>fix bug where tostring() moved nodes into new documents. tostring()
+had very nasty side-effects before this fix, sorry!</li>
+</ul>
+</div>
+</div>
+<div class="section" id="id429">
+<h1>0.5.1 (2005-04-09)</h1>
+<ul class="simple">
+<li>Python 2.2 compatibility fixes.</li>
+<li>unicode fixes in Element() and Comment() as well as XML(); unicode
+input wasn't properly being UTF-8 encoded.</li>
+</ul>
+</div>
+<div class="section" id="id430">
+<h1>0.5 (2005-04-08)</h1>
+<p>Initial public release.</p>
+</div>
+</div>
+<div class="footer">
+<hr class="footer" />
+Generated on: 2020-11-27.
+
+</div>
+</body>
+</html>
index a2c0e522dcbe928144da276e3f1c4bf679608380..0eefd39827361937f06e47608c55e498e6ce7039 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="elementtree-compatibility-of-lxml-etree">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu current" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">ElementTree compatibility of lxml.etree</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu current" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">ElementTree compatibility of lxml.etree</h1>
 
 <p>A lot of care has been taken to ensure compatibility between etree and
 ElementTree.  Nonetheless, some differences and incompatibilities exist:</p>
@@ -199,7 +199,7 @@ enough to replace a shallow copy in your case.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 35233397c6d869a6d4f58c7bcb911bb92fdfc2bd..8a5ed6766b0ff8b2f313bf2865975e1a6baeb76f 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="credits">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu current" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Credits</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu current" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Credits</h1>
 
 <div class="section" id="main-contributors">
 <h1>Main contributors</h1>
@@ -88,7 +88,7 @@ Holger Krekel for originally hosting lxml on codespeak.net</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 161d465f3fde8d58be0ab57da3c2e6984e6234ff..c0edee981745142806ecb90909414682870ac0e3 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-cssselect">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu current" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.cssselect</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu current" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.cssselect</h1>
 
 <p>lxml supports a number of interesting languages for tree traversal and element
 selection.  The most important is obviously <a class="reference external" href="xpathxslt.html#xpath">XPath</a>, but there is also
@@ -113,7 +113,7 @@ namespace URIs: the <tt class="docutils literal">CSSSelector</tt> class accepts
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 2aba74c0983b5b49aef0763798cf7bff3e567164..f6ddc0ad8702a6dcac5b5dcffa99fa1a8a3a1ce1 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="using-custom-element-classes-in-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu current" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Using custom Element classes in lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu current" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Using custom Element classes in lxml</h1>
 
 <p>lxml has very sophisticated support for custom Element classes.  You
 can provide your own classes for Elements and have lxml use them by
@@ -525,7 +525,7 @@ and use the blank decorator instead:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 979244f7d04badaaee5fa509dc127e7e5e2c9e24..47fb52a67360f7f9a1e5a8276c4910817b5743be 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="beautifulsoup-parser">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu current" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">BeautifulSoup Parser</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu current" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">BeautifulSoup Parser</h1>
 
 <p><a class="reference external" href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> is a Python package for working with real-world and broken HTML,
 just like <a class="reference external" href="lxmlhtml.html">lxml.html</a>.  As of version 4.x, it can use
@@ -203,7 +203,7 @@ you can simply pass the resulting Unicode string into lxml's parser.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 83c0236bf67e057adfdbe649740e16bd66c31b9f..b58c92cb8126ad87bd4fe42707e49eed4f21844b 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="python-extensions-for-xpath-and-xslt">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu current" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Python extensions for XPath and XSLT</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu current" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Python extensions for XPath and XSLT</h1>
 
 <p>This document describes how to use Python extension functions in XPath
 and XSLT like this:</p>
@@ -530,7 +530,7 @@ will work:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 54045113a55110d1b68ee858a645bb0af420ed3a..7af227acf23c7ca5f0b83c155068127d5f8cc377 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="html5lib-parser">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu current" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">html5lib Parser</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu current" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">html5lib Parser</h1>
 
 <p><a class="reference external" href="http://code.google.com/p/html5lib/">html5lib</a> is a Python package that implements the HTML5 parsing algorithm
 which is heavily influenced by current browsers and based on the <a class="reference external" href="http://www.whatwg.org/specs/web-apps/current-work/">WHATWG
@@ -90,7 +90,7 @@ module.  Note that these are the parser classes provided by html5lib.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index cd93d942ddd651edc55b2b3c8c41678a18a3f1d3..d78b1c41cc513ae4fb68f9bda175bd89429b62c1 100644 (file)
@@ -26,7 +26,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu current" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml - XML and HTML with Python</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu current" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml - XML and HTML with Python</h1>
 
 <div class="pagequote line-block">
 <div class="line"><a class="reference external" href="https://mailman-mail5.webfaction.com/pipermail/lxml/20080131/019119.html">&#187; lxml takes all the pain out of XML. &#171;</a></div>
@@ -43,7 +43,7 @@ in the Python language.</p>
 XML feature completeness of these libraries with the simplicity of a
 native Python API, mostly compatible but superior to the well-known
 <a class="reference external" href="http://effbot.org/zone/element-index.htm">ElementTree</a> API.  The latest release works with all CPython versions
-from 2.7 to 3.8.  See the <a class="reference external" href="intro.html">introduction</a> for more information about
+from 2.7 to 3.9.  See the <a class="reference external" href="intro.html">introduction</a> for more information about
 background and goals of the lxml project.  Some common questions are
 answered in the <a class="reference external" href="FAQ.html">FAQ</a>.</p>
 <div class="section" id="support-the-project">
@@ -81,7 +81,7 @@ Another supporter of the lxml project is
 </div>
 <div class="section" id="documentation">
 <h1>Documentation</h1>
-<p>The complete lxml documentation is available for download as <a class="reference external" href="lxmldoc-4.6.1.pdf">PDF
+<p>The complete lxml documentation is available for download as <a class="reference external" href="lxmldoc-4.6.2.pdf">PDF
 documentation</a>.  The HTML documentation from this web site is part of
 the normal <a class="reference external" href="#download">source download</a>.</p>
 <ul class="simple">
@@ -145,8 +145,8 @@ external C modules, including fast custom element class support.</p>
 Index</a> (PyPI).  It has the source
 that compiles on various platforms.  The source distribution is signed
 with <a class="reference external" href="pubkey.asc">this key</a>.</p>
-<p>The latest version is <a class="reference external" href="/files/lxml-4.6.0.tgz">lxml 4.6.0</a>, released 2020-10-17
-(<a class="reference external" href="/changes-4.6.0.html">changes for 4.6.0</a>).  <a class="reference external" href="#old-versions">Older versions</a>
+<p>The latest version is <a class="reference external" href="/files/lxml-4.6.2.tgz">lxml 4.6.2</a>, released 2020-11-26
+(<a class="reference external" href="/changes-4.6.2.html">changes for 4.6.2</a>).  <a class="reference external" href="#old-versions">Older versions</a>
 are listed below.</p>
 <p>Please take a look at the
 <a class="reference external" href="installation.html">installation instructions</a> !</p>
@@ -154,7 +154,7 @@ are listed below.</p>
 part of the source distribution, so if you want to download the
 documentation for offline use, take the source archive and copy the
 <tt class="docutils literal">doc/html</tt> directory out of the source tree, or use the
-<a class="reference external" href="lxmldoc-4.6.1.pdf">PDF documentation</a>.</p>
+<a class="reference external" href="lxmldoc-4.6.2.pdf">PDF documentation</a>.</p>
 <p>The latest <a class="reference external" href="https://github.com/lxml/lxml/archive/master.zip">installable developer sources</a>
 are available from Github.  It's also possible to check out
 the latest development version of lxml from Github directly, using a command
@@ -215,6 +215,7 @@ obstacle to using lxml in your codebase.</p>
 <a class="reference external" href="http://lxml.de/2.0/">2.0</a>,
 <a class="reference external" href="http://lxml.de/1.3/">1.3</a></p>
 <ul class="simple">
+<li><a class="reference external" href="/files/lxml-4.6.2.tgz">lxml 4.6.2</a>, released 2020-11-26 (<a class="reference external" href="/changes-4.6.2.html">changes for 4.6.2</a>)</li>
 <li><a class="reference external" href="/files/lxml-4.6.1.tgz">lxml 4.6.1</a>, released 2020-10-18 (<a class="reference external" href="/changes-4.6.1.html">changes for 4.6.1</a>)</li>
 <li><a class="reference external" href="/files/lxml-4.6.0.tgz">lxml 4.6.0</a>, released 2020-10-17 (<a class="reference external" href="/changes-4.6.0.html">changes for 4.6.0</a>)</li>
 <li><a class="reference external" href="/files/lxml-4.5.2.tgz">lxml 4.5.2</a>, released 2020-07-09 (<a class="reference external" href="/changes-4.5.2.html">changes for 4.5.2</a>)</li>
@@ -258,7 +259,7 @@ donation is non-refundable.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 721361df0efc1a472f3f2b9514ea8682817fb8a1..ad2585362b4a3a552fe44361168883ea80f096e9 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="installing-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu current" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Installing lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu current" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Installing lxml</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title">Contents</p>
@@ -208,7 +208,7 @@ read the
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 816d7773bcbd2337183ec038f74ef4d7355aaa53..7992bfcf7845630f1a6f4c9ba2c86aafae3e62e0 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="why-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu current" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Why lxml?</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu current" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Why lxml?</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title">Contents</p>
@@ -82,7 +82,7 @@ having to learn new things -- XML is complicated enough.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 72308b158acf2bb1f6b6d4bfc9cef4cf846c92a9..7d6a5f537681748c703c3ac325b9bcf0d558fbc6 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="how-to-read-the-source-of-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu current" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">How to read the source of lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu current" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">How to read the source of lxml</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -286,7 +286,7 @@ implemented in pure Python.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 23b33c4dec6365bef58c8989a37db8403f433a5c..81f44f58280d302972f45529d04b028bc152b631 100644 (file)
@@ -25,7 +25,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-html">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu current" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.html</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu current" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.html</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -696,7 +696,7 @@ microformat.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index c9827f8e58179b46b1d92e4184e128fc80beea50..114092ae7a2a1e219aff7ebf0c19204048e3bbaf 100644 (file)
@@ -25,7 +25,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="lxml-objectify">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu current" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.objectify</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu current" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">lxml.objectify</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -1165,7 +1165,7 @@ support any XPath expression.</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index f9d9fcba424170bcd414cdfea88d4824a045b0af..accb9314dbe0c5eb14511143285f83238f2ddba3 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="parsing-xml-and-html-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu current" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Parsing XML and HTML with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu current" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Parsing XML and HTML with lxml</h1>
 
 <p>lxml provides a very simple and powerful API for parsing XML and HTML.  It
 supports one-step parsing as well as step-by-step parsing using an
@@ -893,7 +893,7 @@ with UTF-8 is also considerably faster in most cases.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index b017c9e6b7c993de97a18cf61e806d3c4b5c6dda..1f10f979d15c9335ab05200e7d3d6dff6ee565d7 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="benchmarks-and-speed">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu current" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Benchmarks and Speed</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu current" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Benchmarks and Speed</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -798,7 +798,7 @@ random.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index f0050071a104cffe4c59f1223950c7d7a9b8754f..c0d0679a0102441dde5efc24f4862c1190ae146d 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="document-loading-and-url-resolving">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu current" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Document loading and URL resolving</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu current" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Document loading and URL resolving</h1>
 
 <div class="contents topic" id="contents">
 <p class="topic-title">Contents</p>
@@ -250,7 +250,7 @@ documents or raises exceptions if access is denied.</li>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index dcdf773ca0e363a6febe11115d83fb3d9d388f9b..9f2909f9e91e483cfc690893f113c537f6d4c236 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="sax-support">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu current" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Sax support</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu current" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Sax support</h1>
 
 <p>In this document we'll describe lxml's SAX support.  lxml has support for
 producing SAX events for an ElementTree or Element.  lxml can also turn SAX
@@ -124,7 +124,7 @@ DOM implementation cannot generate SAX events from a DOM tree.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 9fd936f5a583d0f0108a9c1fb41dc785c6140af2..255edf0457615c9602640449681ae688daae0c42 100644 (file)
@@ -8,5 +8,5 @@
   </head>
   <body>
     <h1>Sitemap of lxml.de - Processing XML and HTML with Python</h1>
-  <div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li></ul><li><a href="http://lxml.de/files/">Download files</a></li></div></div></body>
+  <div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li></ul><li><a href="http://lxml.de/files/">Download files</a></li></div></div></body>
 </html>
\ No newline at end of file
index 18ccc4ca0a0c57f2b9d00d4221bbff9e45521d53..b57f9cc570d595ca92cf4b89af2b9d1412c008f8 100644 (file)
@@ -27,7 +27,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="the-lxml-etree-tutorial">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu current" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">The lxml.etree Tutorial</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu current" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">The lxml.etree Tutorial</h1>
 <table class="docinfo" frame="void" rules="none">
 <col class="docinfo-name" />
 <col class="docinfo-content" />
@@ -1220,7 +1220,7 @@ whereas the other two examples would raise a <tt class="docutils literal">StopIt
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 32bb4d84f5ee0b3d26a85c46abac04f3da463e79..ef31e06a799c2b0ddf2d7d923d1275e7944bb141 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="validation-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu current" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Validation with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu current" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu foreign" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">Validation with lxml</h1>
 
 <p>Apart from the built-in DTD support in parsers, lxml currently supports three
 schema languages: <a class="reference external" href="http://en.wikipedia.org/wiki/Document_Type_Definition">DTD</a>, <a class="reference external" href="http://www.relaxng.org/">Relax NG</a> and <a class="reference external" href="http://www.w3.org/XML/Schema">XML Schema</a>.  All three provide
@@ -556,7 +556,7 @@ reporting during validation.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index 5edd59c5ee855d4dab8bb72f92a9f5922972ed32..e53d01351077c487b5da89f2bd5a7ae623189687 100644 (file)
@@ -24,7 +24,7 @@ function hide_menu() {
 </script><meta name="viewport" content="width=device-width, initial-scale=1" /></head>
 <body onclick="hide_menu()">
 <div class="document" id="xpath-and-xslt-with-lxml">
-<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu current" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 1-menu"><li class="menu title"><a href="changes-4.6.1.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">XPath and XSLT with lxml</h1>
+<div class="sidemenu" id="sidemenu"><div class="menutrigger" onclick="trigger_menu(event)">Menu</div><div class="menu"><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><ul id="lxml-section"><li><span class="section title">lxml</span><ul class="menu foreign" id="index-menu"><li class="menu title"><a href="index.html">lxml</a><ul class="submenu"><li class="menu item"><a href="index.html#introduction">Introduction</a></li><li class="menu item"><a href="index.html#support-the-project">Support the project</a></li><li class="menu item"><a href="index.html#documentation">Documentation</a></li><li class="menu item"><a href="index.html#download">Download</a></li><li class="menu item"><a href="index.html#mailing-list">Mailing list</a></li><li class="menu item"><a href="index.html#bug-tracker">Bug tracker</a></li><li class="menu item"><a href="index.html#license">License</a></li><li class="menu item"><a href="index.html#old-versions">Old Versions</a></li><li class="menu item"><a href="index.html#project-income-report">Project income report</a></li><li class="menu item"><a href="index.html#legal-notice-for-donations">Legal Notice for Donations</a></li></ul></li></ul><ul class="menu foreign" id="intro-menu"><li class="menu title"><a href="intro.html">Why lxml?</a><ul class="submenu"><li class="menu item"><a href="intro.html#motto">Motto</a></li><li class="menu item"><a href="intro.html#aims">Aims</a></li></ul></li></ul><ul class="menu foreign" id="installation-menu"><li class="menu title"><a href="installation.html">Installing lxml</a><ul class="submenu"><li class="menu item"><a href="installation.html#where-to-get-it">Where to get it</a></li><li class="menu item"><a href="installation.html#requirements">Requirements</a></li><li class="menu item"><a href="installation.html#installation">Installation</a></li><li class="menu item"><a href="installation.html#building-lxml-from-dev-sources">Building lxml from dev sources</a></li><li class="menu item"><a href="installation.html#using-lxml-with-python-libxml2">Using lxml with python-libxml2</a></li><li class="menu item"><a href="installation.html#source-builds-on-ms-windows">Source builds on MS Windows</a></li><li class="menu item"><a href="installation.html#source-builds-on-macos-x">Source builds on MacOS-X</a></li></ul></li></ul><ul class="menu foreign" id="performance-menu"><li class="menu title"><a href="performance.html">Benchmarks and Speed</a><ul class="submenu"><li class="menu item"><a href="performance.html#general-notes">General notes</a></li><li class="menu item"><a href="performance.html#how-to-read-the-timings">How to read the timings</a></li><li class="menu item"><a href="performance.html#parsing-and-serialising">Parsing and Serialising</a></li><li class="menu item"><a href="performance.html#the-elementtree-api">The ElementTree API</a></li><li class="menu item"><a href="performance.html#xpath">XPath</a></li><li class="menu item"><a href="performance.html#a-longer-example">A longer example</a></li><li class="menu item"><a href="performance.html#lxml-objectify">lxml.objectify</a></li></ul></li></ul><ul class="menu foreign" id="compatibility-menu"><li class="menu title"><a href="compatibility.html">ElementTree compatibility of lxml.etree</a></li></ul><ul class="menu foreign" id="FAQ-menu"><li class="menu title"><a href="FAQ.html">lxml FAQ - Frequently Asked Questions</a><ul class="submenu"><li class="menu item"><a href="FAQ.html#general-questions">General Questions</a></li><li class="menu item"><a href="FAQ.html#installation">Installation</a></li><li class="menu item"><a href="FAQ.html#contributing">Contributing</a></li><li class="menu item"><a href="FAQ.html#bugs">Bugs</a></li><li class="menu item"><a href="FAQ.html#id1">Threading</a></li><li class="menu item"><a href="FAQ.html#parsing-and-serialisation">Parsing and Serialisation</a></li><li class="menu item"><a href="FAQ.html#xpath-and-document-traversal">XPath and Document Traversal</a></li></ul></li></ul></li></ul><ul id="Developing with lxml-section"><li><span class="section title">Developing with lxml</span><ul class="menu foreign" id="tutorial-menu"><li class="menu title"><a href="tutorial.html">The lxml.etree Tutorial</a><ul class="submenu"><li class="menu item"><a href="tutorial.html#the-element-class">The Element class</a></li><li class="menu item"><a href="tutorial.html#the-elementtree-class">The ElementTree class</a></li><li class="menu item"><a href="tutorial.html#parsing-from-strings-and-files">Parsing from strings and files</a></li><li class="menu item"><a href="tutorial.html#namespaces">Namespaces</a></li><li class="menu item"><a href="tutorial.html#the-e-factory">The E-factory</a></li><li class="menu item"><a href="tutorial.html#elementpath">ElementPath</a></li></ul></li></ul><ul class="menu foreign" id="apidoc lxml-menu"><li class="menu title"><a href="apidoc/lxml.html">API reference</a></li></ul><ul class="menu foreign" id="api-menu"><li class="menu title"><a href="api.html">APIs specific to lxml.etree</a><ul class="submenu"><li class="menu item"><a href="api.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="api.html#other-element-apis">Other Element APIs</a></li><li class="menu item"><a href="api.html#trees-and-documents">Trees and Documents</a></li><li class="menu item"><a href="api.html#iteration">Iteration</a></li><li class="menu item"><a href="api.html#error-handling-on-exceptions">Error handling on exceptions</a></li><li class="menu item"><a href="api.html#error-logging">Error logging</a></li><li class="menu item"><a href="api.html#serialisation">Serialisation</a></li><li class="menu item"><a href="api.html#incremental-xml-generation">Incremental XML generation</a></li><li class="menu item"><a href="api.html#cdata">CDATA</a></li><li class="menu item"><a href="api.html#xinclude-and-elementinclude">XInclude and ElementInclude</a></li></ul></li></ul><ul class="menu foreign" id="parsing-menu"><li class="menu title"><a href="parsing.html">Parsing XML and HTML with lxml</a><ul class="submenu"><li class="menu item"><a href="parsing.html#parsers">Parsers</a></li><li class="menu item"><a href="parsing.html#the-target-parser-interface">The target parser interface</a></li><li class="menu item"><a href="parsing.html#the-feed-parser-interface">The feed parser interface</a></li><li class="menu item"><a href="parsing.html#incremental-event-parsing">Incremental event parsing</a></li><li class="menu item"><a href="parsing.html#iterparse-and-iterwalk">iterparse and iterwalk</a></li><li class="menu item"><a href="parsing.html#python-unicode-strings">Python unicode strings</a></li></ul></li></ul><ul class="menu foreign" id="validation-menu"><li class="menu title"><a href="validation.html">Validation with lxml</a><ul class="submenu"><li class="menu item"><a href="validation.html#validation-at-parse-time">Validation at parse time</a></li><li class="menu item"><a href="validation.html#id1">DTD</a></li><li class="menu item"><a href="validation.html#relaxng">RelaxNG</a></li><li class="menu item"><a href="validation.html#xmlschema">XMLSchema</a></li><li class="menu item"><a href="validation.html#id2">Schematron</a></li><li class="menu item"><a href="validation.html#id3">(Pre-ISO-Schematron)</a></li></ul></li></ul><ul class="menu current" id="xpathxslt-menu"><li class="menu title"><a href="xpathxslt.html">XPath and XSLT with lxml</a><ul class="submenu"><li class="menu item"><a href="xpathxslt.html#xpath">XPath</a></li><li class="menu item"><a href="xpathxslt.html#xslt">XSLT</a></li></ul></li></ul><ul class="menu foreign" id="objectify-menu"><li class="menu title"><a href="objectify.html">lxml.objectify</a><ul class="submenu"><li class="menu item"><a href="objectify.html#the-lxml-objectify-api">The lxml.objectify API</a></li><li class="menu item"><a href="objectify.html#asserting-a-schema">Asserting a Schema</a></li><li class="menu item"><a href="objectify.html#objectpath">ObjectPath</a></li><li class="menu item"><a href="objectify.html#python-data-types">Python data types</a></li><li class="menu item"><a href="objectify.html#how-data-types-are-matched">How data types are matched</a></li><li class="menu item"><a href="objectify.html#what-is-different-from-lxml-etree">What is different from lxml.etree?</a></li></ul></li></ul><ul class="menu foreign" id="lxmlhtml-menu"><li class="menu title"><a href="lxmlhtml.html">lxml.html</a><ul class="submenu"><li class="menu item"><a href="lxmlhtml.html#parsing-html">Parsing HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-element-methods">HTML Element Methods</a></li><li class="menu item"><a href="lxmlhtml.html#running-html-doctests">Running HTML doctests</a></li><li class="menu item"><a href="lxmlhtml.html#creating-html-with-the-e-factory">Creating HTML with the E-factory</a></li><li class="menu item"><a href="lxmlhtml.html#working-with-links">Working with links</a></li><li class="menu item"><a href="lxmlhtml.html#forms">Forms</a></li><li class="menu item"><a href="lxmlhtml.html#cleaning-up-html">Cleaning up HTML</a></li><li class="menu item"><a href="lxmlhtml.html#html-diff">HTML Diff</a></li><li class="menu item"><a href="lxmlhtml.html#examples">Examples</a></li></ul></li></ul><ul class="menu foreign" id="cssselect-menu"><li class="menu title"><a href="cssselect.html">lxml.cssselect</a><ul class="submenu"><li class="menu item"><a href="cssselect.html#the-cssselector-class">The CSSSelector class</a></li><li class="menu item"><a href="cssselect.html#the-cssselect-method">The cssselect method</a></li><li class="menu item"><a href="cssselect.html#supported-selectors">Supported Selectors</a></li><li class="menu item"><a href="cssselect.html#namespaces">Namespaces</a></li></ul></li></ul><ul class="menu foreign" id="elementsoup-menu"><li class="menu title"><a href="elementsoup.html">BeautifulSoup Parser</a><ul class="submenu"><li class="menu item"><a href="elementsoup.html#parsing-with-the-soupparser">Parsing with the soupparser</a></li><li class="menu item"><a href="elementsoup.html#entity-handling">Entity handling</a></li><li class="menu item"><a href="elementsoup.html#using-soupparser-as-a-fallback">Using soupparser as a fallback</a></li><li class="menu item"><a href="elementsoup.html#using-only-the-encoding-detection">Using only the encoding detection</a></li></ul></li></ul><ul class="menu foreign" id="html5parser-menu"><li class="menu title"><a href="html5parser.html">html5lib Parser</a><ul class="submenu"><li class="menu item"><a href="html5parser.html#differences-to-regular-html-parsing">Differences to regular HTML parsing</a></li><li class="menu item"><a href="html5parser.html#function-reference">Function Reference</a></li></ul></li></ul></li></ul><ul id="Extending lxml-section"><li><span class="section title">Extending lxml</span><ul class="menu foreign" id="resolvers-menu"><li class="menu title"><a href="resolvers.html">Document loading and URL resolving</a><ul class="submenu"><li class="menu item"><a href="resolvers.html#xml-catalogs">XML Catalogs</a></li><li class="menu item"><a href="resolvers.html#uri-resolvers">URI Resolvers</a></li><li class="menu item"><a href="resolvers.html#document-loading-in-context">Document loading in context</a></li><li class="menu item"><a href="resolvers.html#i-o-access-control-in-xslt">I/O access control in XSLT</a></li></ul></li></ul><ul class="menu foreign" id="extensions-menu"><li class="menu title"><a href="extensions.html">Python extensions for XPath and XSLT</a><ul class="submenu"><li class="menu item"><a href="extensions.html#xpath-extension-functions">XPath Extension functions</a></li><li class="menu item"><a href="extensions.html#xslt-extension-elements">XSLT extension elements</a></li></ul></li></ul><ul class="menu foreign" id="element classes-menu"><li class="menu title"><a href="element_classes.html">Using custom Element classes in lxml</a><ul class="submenu"><li class="menu item"><a href="element_classes.html#background-on-element-proxies">Background on Element proxies</a></li><li class="menu item"><a href="element_classes.html#element-initialization">Element initialization</a></li><li class="menu item"><a href="element_classes.html#setting-up-a-class-lookup-scheme">Setting up a class lookup scheme</a></li><li class="menu item"><a href="element_classes.html#generating-xml-with-custom-classes">Generating XML with custom classes</a></li><li class="menu item"><a href="element_classes.html#id1">Implementing namespaces</a></li></ul></li></ul><ul class="menu foreign" id="sax-menu"><li class="menu title"><a href="sax.html">Sax support</a><ul class="submenu"><li class="menu item"><a href="sax.html#building-a-tree-from-sax-events">Building a tree from SAX events</a></li><li class="menu item"><a href="sax.html#producing-sax-events-from-an-elementtree-or-element">Producing SAX events from an ElementTree or Element</a></li><li class="menu item"><a href="sax.html#interfacing-with-pulldom-minidom">Interfacing with pulldom/minidom</a></li></ul></li></ul><ul class="menu foreign" id="capi-menu"><li class="menu title"><a href="capi.html">The public C-API of lxml.etree</a><ul class="submenu"><li class="menu item"><a href="capi.html#passing-generated-trees-through-python">Passing generated trees through Python</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-cython">Writing external modules in Cython</a></li><li class="menu item"><a href="capi.html#writing-external-modules-in-c">Writing external modules in C</a></li></ul></li></ul></li></ul><ul id="Developing lxml-section"><li><span class="section title">Developing lxml</span><ul class="menu foreign" id="build-menu"><li class="menu title"><a href="build.html">How to build lxml from source</a><ul class="submenu"><li class="menu item"><a href="build.html#cython">Cython</a></li><li class="menu item"><a href="build.html#github-git-and-hg">Github, git and hg</a></li><li class="menu item"><a href="build.html#building-the-sources">Building the sources</a></li><li class="menu item"><a href="build.html#running-the-tests-and-reporting-errors">Running the tests and reporting errors</a></li><li class="menu item"><a href="build.html#building-an-egg-or-wheel">Building an egg or wheel</a></li><li class="menu item"><a href="build.html#building-lxml-on-macos-x">Building lxml on MacOS-X</a></li><li class="menu item"><a href="build.html#static-linking-on-windows">Static linking on Windows</a></li><li class="menu item"><a href="build.html#building-debian-packages-from-svn-sources">Building Debian packages from SVN sources</a></li></ul></li></ul><ul class="menu foreign" id="lxml source howto-menu"><li class="menu title"><a href="lxml-source-howto.html">How to read the source of lxml</a><ul class="submenu"><li class="menu item"><a href="lxml-source-howto.html#what-is-cython">What is Cython?</a></li><li class="menu item"><a href="lxml-source-howto.html#where-to-start">Where to start?</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-etree">lxml.etree</a></li><li class="menu item"><a href="lxml-source-howto.html#python-modules">Python modules</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-objectify">lxml.objectify</a></li><li class="menu item"><a href="lxml-source-howto.html#lxml-html">lxml.html</a></li></ul></li></ul><ul class="menu foreign" id="changes 4 6 2-menu"><li class="menu title"><a href="changes-4.6.2.html">Release Changelog</a></li></ul><ul class="menu foreign" id="credits-menu"><li class="menu title"><a href="credits.html">Credits</a><ul class="submenu"><li class="menu item"><a href="credits.html#main-contributors">Main contributors</a></li><li class="menu item"><a href="credits.html#special-thanks-goes-to">Special thanks goes to:</a></li></ul></li></ul></li><li><a href="/sitemap.html">Sitemap</a></li></ul></div></div><div class="banner"><div class="banner_image"><img src="python-xml-title.png" /></div><div class="banner_link"><a href="index.html#support-the-project">Like the tool? <br class="first" />Help making it better! <br class="second" />Your donation helps!</a></div></div><h1 class="title">XPath and XSLT with lxml</h1>
 
 <p>lxml supports XPath 1.0, XSLT 1.0 and the EXSLT extensions through
 libxml2 and libxslt in a standards compliant way.</p>
@@ -69,6 +69,9 @@ frequent evaluation: <tt class="docutils literal">XPath</tt> and <tt class="docu
 comparison</a> to learn when to use which.  Their semantics when used on
 Elements and ElementTrees are the same as for the <tt class="docutils literal">xpath()</tt> method described
 here.</p>
+<p>Note that the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods are usually faster than the full-blown XPath
+support.  They also support incremental tree processing through the <tt class="docutils literal">.iterfind()</tt>
+method, whereas XPath always collects all results before returning them.</p>
 <div class="section" id="the-xpath-method">
 <h2>The <tt class="docutils literal">xpath()</tt> method</h2>
 <p>For ElementTree, the xpath method performs a global XPath query against the
@@ -632,7 +635,7 @@ If you want to free it from memory, just do:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-18.
+Generated on: 2020-11-27.
 
 </div>
 </body>
index fa1dfba6c8c9a469339b2ea80504ad53c266626f..d42c66a33f86173fb4991e8edf3b9c17c952f038 100644 (file)
@@ -35,7 +35,7 @@ libxml2_ and libxslt_.  It is unique in that it combines the speed and
 XML feature completeness of these libraries with the simplicity of a
 native Python API, mostly compatible but superior to the well-known
 ElementTree_ API.  The latest release works with all CPython versions
-from 2.7 to 3.8.  See the introduction_ for more information about
+from 2.7 to 3.9.  See the introduction_ for more information about
 background and goals of the lxml project.  Some common questions are
 answered in the FAQ_.
 
@@ -159,8 +159,8 @@ Index <http://pypi.python.org/pypi/lxml/>`_ (PyPI).  It has the source
 that compiles on various platforms.  The source distribution is signed
 with `this key <pubkey.asc>`_.
 
-The latest version is `lxml 4.6.0`_, released 2020-10-17
-(`changes for 4.6.0`_).  `Older versions <#old-versions>`_
+The latest version is `lxml 4.6.2`_, released 2020-11-26
+(`changes for 4.6.2`_).  `Older versions <#old-versions>`_
 are listed below.
 
 Please take a look at the
@@ -256,7 +256,9 @@ See the websites of lxml
 ..
    and the `latest in-development version <http://lxml.de/dev/>`_.
 
-.. _`PDF documentation`: lxmldoc-4.6.1.pdf
+.. _`PDF documentation`: lxmldoc-4.6.2.pdf
+
+* `lxml 4.6.2`_, released 2020-11-26 (`changes for 4.6.2`_)
 
 * `lxml 4.6.1`_, released 2020-10-18 (`changes for 4.6.1`_)
 
@@ -278,6 +280,7 @@ See the websites of lxml
 
 * `older releases <http://lxml.de/4.3/#old-versions>`_
 
+.. _`lxml 4.6.2`: /files/lxml-4.6.2.tgz
 .. _`lxml 4.6.1`: /files/lxml-4.6.1.tgz
 .. _`lxml 4.6.0`: /files/lxml-4.6.0.tgz
 .. _`lxml 4.5.2`: /files/lxml-4.5.2.tgz
@@ -288,6 +291,7 @@ See the websites of lxml
 .. _`lxml 4.4.1`: /files/lxml-4.4.1.tgz
 .. _`lxml 4.4.0`: /files/lxml-4.4.0.tgz
 
+.. _`changes for 4.6.2`: /changes-4.6.2.html
 .. _`changes for 4.6.1`: /changes-4.6.1.html
 .. _`changes for 4.6.0`: /changes-4.6.0.html
 .. _`changes for 4.5.2`: /changes-4.5.2.html
index 98adc9ea3ba916a27e2c993eca2e7376053c936c..8b2870e517fc215ddb9a594eeb10036f0b51e8bd 100644 (file)
@@ -63,6 +63,10 @@ comparison`_ to learn when to use which.  Their semantics when used on
 Elements and ElementTrees are the same as for the ``xpath()`` method described
 here.
 
+Note that the ``.find*()`` methods are usually faster than the full-blown XPath
+support.  They also support incremental tree processing through the ``.iterfind()``
+method, whereas XPath always collects all results before returning them.
+
 .. _`performance comparison`: performance.html#xpath
 
 
index 35e4d0cb5d4942921848d97517751d6c43ca9bf5..845c0d9c023c4074215920c306796ddaad97757b 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -235,6 +235,7 @@ an appropriate version of Cython installed.
         'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
+        'Programming Language :: Python :: 3.9',
         'Programming Language :: C',
         'Operating System :: OS Independent',
         'Topic :: Text Processing :: Markup :: HTML',
index d2d538c2b3d0c77e6cd10c37d2e1d94571799f8b..479c5639f76fc63983c7d7f0511fb47c199ec477 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: lxml
-Version: 4.6.1
+Version: 4.6.2
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: https://lxml.de/
 Author: lxml dev team
@@ -38,14 +38,15 @@ Description: lxml is a Pythonic, mature binding for the libxml2 and libxslt libr
         as soon as a maintenance branch has been established.  Note that this
         requires Cython to be installed at an appropriate version for the build.
         
-        4.6.1 (2020-10-18)
+        4.6.2 (2020-11-26)
         ==================
         
         Bugs fixed
         ----------
         
-        * A vulnerability was discovered in the HTML Cleaner by Yaniv Nizry, which allowed
-          JavaScript to pass through.  The cleaner now removes more sneaky "style" content.
+        * A vulnerability (CVE-2020-27783) was discovered in the HTML Cleaner by Yaniv Nizry,
+          which allowed JavaScript to pass through.  The cleaner now removes more sneaky
+          "style" content.
         
         
         
@@ -62,6 +63,7 @@ Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: C
 Classifier: Operating System :: OS Independent
 Classifier: Topic :: Text Processing :: Markup :: HTML
index 0eafa85f5e9e8bb9c297d96b354fe1658f5bbcd2..9aaa8f8bbb0b19b30254e0407d40b4330cbfe701 100644 (file)
@@ -57,7 +57,7 @@ doc/html/FAQ.html
 doc/html/api.html
 doc/html/build.html
 doc/html/capi.html
-doc/html/changes-4.6.1.html
+doc/html/changes-4.6.2.html
 doc/html/compatibility.html
 doc/html/credits.html
 doc/html/cssselect.html
index 59506015847c51d9d81b6ada6095f568cae59e64..ed50c4bbfdff498ab795da76a31d717d2e8f2f07 100644 (file)
@@ -1,6 +1,6 @@
 # this is a package
 
-__version__ = "4.6.1"
+__version__ = "4.6.2"
 
 
 def get_include():
index c638921abbb8a786e946b6330dfdcb302e31b1c2..2c278278782efb1e100dbd3e9fb678618b035ca6 100644 (file)
@@ -860,7 +860,7 @@ struct __pyx_defaults1 {
   PyObject *__pyx_arg_break_character;
 };
 
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -1546,7 +1546,7 @@ static const char __pyx_k__10[] = ":";
 static const char __pyx_k__12[] = "\\";
 static const char __pyx_k__15[] = ".";
 static const char __pyx_k__16[] = ",";
-static const char __pyx_k__41[] = "/\\*.*?\\*/";
+static const char __pyx_k__42[] = "/\\*.*?\\*/";
 static const char __pyx_k_a_z[] = "[^a-z]";
 static const char __pyx_k_all[] = "__all__";
 static const char __pyx_k_bad[] = "bad";
@@ -1566,6 +1566,7 @@ static const char __pyx_k_s_2[] = "s";
 static const char __pyx_k_set[] = "set";
 static const char __pyx_k_src[] = "src";
 static const char __pyx_k_sub[] = "sub";
+static const char __pyx_k_sys[] = "sys";
 static const char __pyx_k_tag[] = "tag";
 static const char __pyx_k_url[] = "url";
 static const char __pyx_k_args[] = "args";
@@ -1598,6 +1599,7 @@ static const char __pyx_k_test[] = "__test__";
 static const char __pyx_k_text[] = "text";
 static const char __pyx_k_type[] = "type";
 static const char __pyx_k_word[] = "word";
+static const char __pyx_k_ASCII[] = "ASCII";
 static const char __pyx_k_XPath[] = "XPath";
 static const char __pyx_k_aname[] = "aname";
 static const char __pyx_k_avoid[] = "avoid";
@@ -1741,12 +1743,12 @@ static const char __pyx_k_link_regexes[] = "link_regexes";
 static const char __pyx_k_pre_children[] = "pre_children";
 static const char __pyx_k_unquote_plus[] = "unquote_plus";
 static const char __pyx_k_urllib_parse[] = "urllib.parse";
+static const char __pyx_k_version_info[] = "version_info";
 static const char __pyx_k_allow_element[] = "allow_element";
 static const char __pyx_k_annoying_tags[] = "annoying_tags";
 static const char __pyx_k_autolink_html[] = "autolink_html";
 static const char __pyx_k_avoid_classes[] = "avoid_classes";
 static const char __pyx_k_avoid_hosts_2[] = "_avoid_hosts";
-static const char __pyx_k_css_import_re[] = "_css_import_re";
 static const char __pyx_k_kill_elements[] = "_kill_elements";
 static const char __pyx_k_rewrite_links[] = "rewrite_links";
 static const char __pyx_k_tail_children[] = "tail_children";
@@ -1774,12 +1776,13 @@ static const char __pyx_k_is_image_dataurl[] = "_is_image_dataurl";
 static const char __pyx_k_not_an_attribute[] = "not_an_attribute";
 static const char __pyx_k_strip_attributes[] = "strip_attributes";
 static const char __pyx_k_transform_result[] = "_transform_result";
-static const char __pyx_k_css_javascript_re[] = "_css_javascript_re";
 static const char __pyx_k_data_image_base64[] = "^data:image/.+;base64";
 static const char __pyx_k_resolve_base_href[] = "resolve_base_href";
 static const char __pyx_k_Cleaner_clean_html[] = "Cleaner.clean_html";
 static const char __pyx_k_allow_embedded_url[] = "allow_embedded_url";
 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_replace_css_import[] = "_replace_css_import";
+static const char __pyx_k_a_zA_Z_son_a_zA_Z_s[] = "</?[a-zA-Z]+|\\son[a-zA-Z]+\\s*=";
 static const char __pyx_k_find_external_links[] = "_find_external_links";
 static const char __pyx_k_remove_unknown_tags[] = "remove_unknown_tags";
 static const char __pyx_k_substitute_comments[] = "_substitute_comments";
@@ -1794,7 +1797,9 @@ static const char __pyx_k_has_sneaky_javascript[] = "_has_sneaky_javascript";
 static const char __pyx_k_substitute_whitespace[] = "_substitute_whitespace";
 static const char __pyx_k_Cleaner__kill_elements[] = "Cleaner._kill_elements";
 static const char __pyx_k_conditional_comment_re[] = "_conditional_comment_re";
+static const char __pyx_k_looks_like_tag_content[] = "_looks_like_tag_content";
 static const char __pyx_k_remove_javascript_link[] = "_remove_javascript_link";
+static const char __pyx_k_replace_css_javascript[] = "_replace_css_javascript";
 static const char __pyx_k_src_lxml_html_clean_py[] = "src/lxml/html/clean.py";
 static const char __pyx_k_has_conditional_comment[] = "has_conditional_comment";
 static const char __pyx_k_processing_instructions[] = "processing_instructions";
@@ -1817,6 +1822,7 @@ static const char __pyx_k_It_does_not_make_sense_to_pass_i[] = "It does not make
 static const char __pyx_k_descendant_or_self_a_normalize_s[] = "descendant-or-self::a  [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']";
 static const char __pyx_k_Cleaner_kill_conditional_comment_2[] = "Cleaner.kill_conditional_comments";
 static PyObject *__pyx_kp_s_127_0_0_1;
+static PyObject *__pyx_n_s_ASCII;
 static PyObject *__pyx_n_s_AttributeError;
 static PyObject *__pyx_n_s_Cleaner;
 static PyObject *__pyx_n_s_Cleaner___call;
@@ -1850,9 +1856,10 @@ static PyObject *__pyx_kp_s__12;
 static PyObject *__pyx_kp_s__15;
 static PyObject *__pyx_kp_s__16;
 static PyObject *__pyx_kp_s__2;
-static PyObject *__pyx_kp_s__41;
+static PyObject *__pyx_kp_s__42;
 static PyObject *__pyx_n_s_a;
 static PyObject *__pyx_kp_s_a_z;
+static PyObject *__pyx_kp_s_a_zA_Z_son_a_zA_Z_s;
 static PyObject *__pyx_n_s_add_nofollow;
 static PyObject *__pyx_n_s_all;
 static PyObject *__pyx_n_s_allow_element;
@@ -1904,8 +1911,6 @@ static PyObject *__pyx_n_s_compile;
 static PyObject *__pyx_n_s_condition;
 static PyObject *__pyx_n_s_conditional_comment_re;
 static PyObject *__pyx_n_s_copy;
-static PyObject *__pyx_n_s_css_import_re;
-static PyObject *__pyx_n_s_css_javascript_re;
 static PyObject *__pyx_kp_s_data_image_base64;
 static PyObject *__pyx_n_s_deepcopy;
 static PyObject *__pyx_n_s_default;
@@ -1986,6 +1991,7 @@ static PyObject *__pyx_n_s_link_regexes_2;
 static PyObject *__pyx_n_s_link_text;
 static PyObject *__pyx_n_s_links;
 static PyObject *__pyx_kp_s_localhost;
+static PyObject *__pyx_n_s_looks_like_tag_content;
 static PyObject *__pyx_n_s_lower;
 static PyObject *__pyx_n_s_lxml;
 static PyObject *__pyx_n_s_lxml_html;
@@ -2038,6 +2044,8 @@ static PyObject *__pyx_n_s_remove_javascript_link;
 static PyObject *__pyx_n_s_remove_tags;
 static PyObject *__pyx_n_s_remove_unknown_tags;
 static PyObject *__pyx_n_s_replace;
+static PyObject *__pyx_n_s_replace_css_import;
+static PyObject *__pyx_n_s_replace_css_javascript;
 static PyObject *__pyx_n_s_replacement;
 static PyObject *__pyx_n_s_resolve_base_href;
 static PyObject *__pyx_n_s_result;
@@ -2069,6 +2077,7 @@ static PyObject *__pyx_n_s_stylesheet;
 static PyObject *__pyx_n_s_sub;
 static PyObject *__pyx_n_s_substitute_comments;
 static PyObject *__pyx_n_s_substitute_whitespace;
+static PyObject *__pyx_n_s_sys;
 static PyObject *__pyx_n_s_tag;
 static PyObject *__pyx_n_s_tag_link_attrs;
 static PyObject *__pyx_n_s_tags;
@@ -2091,6 +2100,7 @@ static PyObject *__pyx_n_s_urllib_parse;
 static PyObject *__pyx_n_s_urlparse;
 static PyObject *__pyx_n_s_urlsplit;
 static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_n_s_version_info;
 static PyObject *__pyx_n_s_whitelist_tags;
 static PyObject *__pyx_n_s_width;
 static PyObject *__pyx_n_s_word;
@@ -2125,6 +2135,7 @@ static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, &__pyx_n_s_get,
 static __Pyx_CachedCFunction __pyx_umethod_PySet_Type_update = {0, &__pyx_n_s_update, 0, 0, 0};
 static PyObject *__pyx_int_0;
 static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_3;
 static PyObject *__pyx_int_10;
 static PyObject *__pyx_int_40;
 static PyObject *__pyx_int_8203;
@@ -2142,51 +2153,52 @@ static PyObject *__pyx_slice__17;
 static PyObject *__pyx_tuple__11;
 static PyObject *__pyx_tuple__13;
 static PyObject *__pyx_tuple__18;
-static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__19;
 static PyObject *__pyx_tuple__21;
 static PyObject *__pyx_tuple__22;
 static PyObject *__pyx_tuple__23;
 static PyObject *__pyx_tuple__24;
-static PyObject *__pyx_tuple__26;
-static PyObject *__pyx_tuple__28;
-static PyObject *__pyx_tuple__30;
-static PyObject *__pyx_tuple__32;
-static PyObject *__pyx_tuple__34;
-static PyObject *__pyx_tuple__36;
-static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__33;
+static PyObject *__pyx_tuple__35;
+static PyObject *__pyx_tuple__37;
 static PyObject *__pyx_tuple__39;
-static PyObject *__pyx_tuple__42;
-static PyObject *__pyx_tuple__44;
-static PyObject *__pyx_tuple__46;
+static PyObject *__pyx_tuple__40;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__45;
 static PyObject *__pyx_tuple__47;
-static PyObject *__pyx_tuple__49;
-static PyObject *__pyx_tuple__51;
-static PyObject *__pyx_tuple__53;
-static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__48;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__54;
 static PyObject *__pyx_tuple__56;
-static PyObject *__pyx_tuple__58;
-static PyObject *__pyx_tuple__60;
-static PyObject *__pyx_codeobj__19;
-static PyObject *__pyx_codeobj__25;
-static PyObject *__pyx_codeobj__27;
-static PyObject *__pyx_codeobj__29;
-static PyObject *__pyx_codeobj__31;
-static PyObject *__pyx_codeobj__33;
-static PyObject *__pyx_codeobj__35;
-static PyObject *__pyx_codeobj__37;
-static PyObject *__pyx_codeobj__40;
-static PyObject *__pyx_codeobj__43;
-static PyObject *__pyx_codeobj__45;
-static PyObject *__pyx_codeobj__48;
-static PyObject *__pyx_codeobj__50;
-static PyObject *__pyx_codeobj__52;
-static PyObject *__pyx_codeobj__54;
-static PyObject *__pyx_codeobj__57;
-static PyObject *__pyx_codeobj__59;
-static PyObject *__pyx_codeobj__61;
+static PyObject *__pyx_tuple__57;
+static PyObject *__pyx_tuple__59;
+static PyObject *__pyx_tuple__61;
+static PyObject *__pyx_codeobj__20;
+static PyObject *__pyx_codeobj__26;
+static PyObject *__pyx_codeobj__28;
+static PyObject *__pyx_codeobj__30;
+static PyObject *__pyx_codeobj__32;
+static PyObject *__pyx_codeobj__34;
+static PyObject *__pyx_codeobj__36;
+static PyObject *__pyx_codeobj__38;
+static PyObject *__pyx_codeobj__41;
+static PyObject *__pyx_codeobj__44;
+static PyObject *__pyx_codeobj__46;
+static PyObject *__pyx_codeobj__49;
+static PyObject *__pyx_codeobj__51;
+static PyObject *__pyx_codeobj__53;
+static PyObject *__pyx_codeobj__55;
+static PyObject *__pyx_codeobj__58;
+static PyObject *__pyx_codeobj__60;
+static PyObject *__pyx_codeobj__62;
 /* Late includes */
 
-/* "lxml/html/clean.py":78
+/* "lxml/html/clean.py":83
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  * def _is_javascript_scheme(s):             # <<<<<<<<<<<<<<
@@ -2220,14 +2232,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_is_javascript_scheme", 0);
 
-  /* "lxml/html/clean.py":79
+  /* "lxml/html/clean.py":84
  *     re.I).search
  * def _is_javascript_scheme(s):
  *     if _is_image_dataurl(s):             # <<<<<<<<<<<<<<
  *         return None
  *     return _is_possibly_malicious_scheme(s)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_image_dataurl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_image_dataurl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -2241,14 +2253,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_s);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 84, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 84, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_4) {
 
-    /* "lxml/html/clean.py":80
+    /* "lxml/html/clean.py":85
  * def _is_javascript_scheme(s):
  *     if _is_image_dataurl(s):
  *         return None             # <<<<<<<<<<<<<<
@@ -2259,7 +2271,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":79
+    /* "lxml/html/clean.py":84
  *     re.I).search
  * def _is_javascript_scheme(s):
  *     if _is_image_dataurl(s):             # <<<<<<<<<<<<<<
@@ -2268,7 +2280,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
  */
   }
 
-  /* "lxml/html/clean.py":81
+  /* "lxml/html/clean.py":86
  *     if _is_image_dataurl(s):
  *         return None
  *     return _is_possibly_malicious_scheme(s)             # <<<<<<<<<<<<<<
@@ -2276,7 +2288,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
  * _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_possibly_malicious_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 81, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_possibly_malicious_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -2290,14 +2302,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_s);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 81, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":78
+  /* "lxml/html/clean.py":83
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  * def _is_javascript_scheme(s):             # <<<<<<<<<<<<<<
@@ -2318,7 +2330,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean__is_javascript_scheme(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":217
+/* "lxml/html/clean.py":222
  *     whitelist_tags = {'iframe', 'embed'}
  * 
  *     def __init__(self, **kw):             # <<<<<<<<<<<<<<
@@ -2359,7 +2371,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_1__init__(PyObject *__pyx_
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -2370,7 +2382,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_1__init__(PyObject *__pyx_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -2409,19 +2421,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "lxml/html/clean.py":218
+  /* "lxml/html/clean.py":223
  * 
  *     def __init__(self, **kw):
  *         not_an_attribute = object()             # <<<<<<<<<<<<<<
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_not_an_attribute = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":219
+  /* "lxml/html/clean.py":224
  *     def __init__(self, **kw):
  *         not_an_attribute = object()
  *         for name, value in kw.items():             # <<<<<<<<<<<<<<
@@ -2429,7 +2441,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  *             if (default is not None and default is not True and default is not False
  */
   __pyx_t_2 = 0;
-  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kw, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_kw, 1, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_1);
   __pyx_t_1 = __pyx_t_5;
@@ -2437,7 +2449,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
   while (1) {
     __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
     if (unlikely(__pyx_t_7 == 0)) break;
-    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 219, __pyx_L1_error)
+    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 224, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_5);
@@ -2445,19 +2457,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":220
+    /* "lxml/html/clean.py":225
  *         not_an_attribute = object()
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)             # <<<<<<<<<<<<<<
  *             if (default is not None and default is not True and default is not False
  *                     and not isinstance(default, (frozenset, set, tuple, list))):
  */
-    __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_self, __pyx_v_name, __pyx_v_not_an_attribute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 220, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_GetAttr3(__pyx_v_self, __pyx_v_name, __pyx_v_not_an_attribute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 225, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_XDECREF_SET(__pyx_v_default, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":221
+    /* "lxml/html/clean.py":226
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False             # <<<<<<<<<<<<<<
@@ -2479,7 +2491,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
       goto __pyx_L6_bool_binop_done;
     }
 
-    /* "lxml/html/clean.py":222
+    /* "lxml/html/clean.py":227
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False
  *                     and not isinstance(default, (frozenset, set, tuple, list))):             # <<<<<<<<<<<<<<
@@ -2488,7 +2500,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
     __pyx_t_9 = (__pyx_v_default != Py_False);
 
-    /* "lxml/html/clean.py":221
+    /* "lxml/html/clean.py":226
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False             # <<<<<<<<<<<<<<
@@ -2502,7 +2514,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
       goto __pyx_L6_bool_binop_done;
     }
 
-    /* "lxml/html/clean.py":222
+    /* "lxml/html/clean.py":227
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False
  *                     and not isinstance(default, (frozenset, set, tuple, list))):             # <<<<<<<<<<<<<<
@@ -2538,7 +2550,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
     __pyx_t_8 = __pyx_t_9;
     __pyx_L6_bool_binop_done:;
 
-    /* "lxml/html/clean.py":221
+    /* "lxml/html/clean.py":226
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False             # <<<<<<<<<<<<<<
@@ -2547,14 +2559,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
     if (unlikely(__pyx_t_8)) {
 
-      /* "lxml/html/clean.py":224
+      /* "lxml/html/clean.py":229
  *                     and not isinstance(default, (frozenset, set, tuple, list))):
  *                 raise TypeError(
  *                     "Unknown parameter: %s=%r" % (name, value))             # <<<<<<<<<<<<<<
  *             setattr(self, name, value)
  *         if self.inline_style is None and 'inline_style' not in kw:
  */
-      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 224, __pyx_L1_error)
+      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 229, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_v_name);
       __Pyx_GIVEREF(__pyx_v_name);
@@ -2562,25 +2574,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
       __Pyx_INCREF(__pyx_v_value);
       __Pyx_GIVEREF(__pyx_v_value);
       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_value);
-      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_parameter_s_r, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Unknown_parameter_s_r, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 229, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":223
+      /* "lxml/html/clean.py":228
  *             if (default is not None and default is not True and default is not False
  *                     and not isinstance(default, (frozenset, set, tuple, list))):
  *                 raise TypeError(             # <<<<<<<<<<<<<<
  *                     "Unknown parameter: %s=%r" % (name, value))
  *             setattr(self, name, value)
  */
-      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 223, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 228, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(0, 223, __pyx_L1_error)
+      __PYX_ERR(0, 228, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":221
+      /* "lxml/html/clean.py":226
  *         for name, value in kw.items():
  *             default = getattr(self, name, not_an_attribute)
  *             if (default is not None and default is not True and default is not False             # <<<<<<<<<<<<<<
@@ -2589,25 +2601,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
     }
 
-    /* "lxml/html/clean.py":225
+    /* "lxml/html/clean.py":230
  *                 raise TypeError(
  *                     "Unknown parameter: %s=%r" % (name, value))
  *             setattr(self, name, value)             # <<<<<<<<<<<<<<
  *         if self.inline_style is None and 'inline_style' not in kw:
  *             self.inline_style = self.style
  */
-    __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 225, __pyx_L1_error)
+    __pyx_t_12 = PyObject_SetAttr(__pyx_v_self, __pyx_v_name, __pyx_v_value); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 230, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":226
+  /* "lxml/html/clean.py":231
  *                     "Unknown parameter: %s=%r" % (name, value))
  *             setattr(self, name, value)
  *         if self.inline_style is None and 'inline_style' not in kw:             # <<<<<<<<<<<<<<
  *             self.inline_style = self.style
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_9 = (__pyx_t_1 == Py_None);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -2617,25 +2629,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
     __pyx_t_8 = __pyx_t_10;
     goto __pyx_L15_bool_binop_done;
   }
-  __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_inline_style, __pyx_v_kw, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 226, __pyx_L1_error)
+  __pyx_t_10 = (__Pyx_PyDict_ContainsTF(__pyx_n_s_inline_style, __pyx_v_kw, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 231, __pyx_L1_error)
   __pyx_t_9 = (__pyx_t_10 != 0);
   __pyx_t_8 = __pyx_t_9;
   __pyx_L15_bool_binop_done:;
   if (__pyx_t_8) {
 
-    /* "lxml/html/clean.py":227
+    /* "lxml/html/clean.py":232
  *             setattr(self, name, value)
  *         if self.inline_style is None and 'inline_style' not in kw:
  *             self.inline_style = self.style             # <<<<<<<<<<<<<<
  * 
  *         if kw.get("allow_tags"):
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inline_style, __pyx_t_1) < 0) __PYX_ERR(0, 227, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_inline_style, __pyx_t_1) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":226
+    /* "lxml/html/clean.py":231
  *                     "Unknown parameter: %s=%r" % (name, value))
  *             setattr(self, name, value)
  *         if self.inline_style is None and 'inline_style' not in kw:             # <<<<<<<<<<<<<<
@@ -2644,46 +2656,46 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
   }
 
-  /* "lxml/html/clean.py":229
+  /* "lxml/html/clean.py":234
  *             self.inline_style = self.style
  * 
  *         if kw.get("allow_tags"):             # <<<<<<<<<<<<<<
  *             if kw.get("remove_unknown_tags"):
  *                 raise ValueError("It does not make sense to pass in both "
  */
-  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_allow_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_allow_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 229, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 234, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_8) {
 
-    /* "lxml/html/clean.py":230
+    /* "lxml/html/clean.py":235
  * 
  *         if kw.get("allow_tags"):
  *             if kw.get("remove_unknown_tags"):             # <<<<<<<<<<<<<<
  *                 raise ValueError("It does not make sense to pass in both "
  *                                  "allow_tags and remove_unknown_tags")
  */
-    __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_remove_unknown_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyDict_GetItemDefault(__pyx_v_kw, __pyx_n_s_remove_unknown_tags, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 235, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (unlikely(__pyx_t_8)) {
 
-      /* "lxml/html/clean.py":231
+      /* "lxml/html/clean.py":236
  *         if kw.get("allow_tags"):
  *             if kw.get("remove_unknown_tags"):
  *                 raise ValueError("It does not make sense to pass in both "             # <<<<<<<<<<<<<<
  *                                  "allow_tags and remove_unknown_tags")
  *             self.remove_unknown_tags = False
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_Raise(__pyx_t_1, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(0, 231, __pyx_L1_error)
+      __PYX_ERR(0, 236, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":230
+      /* "lxml/html/clean.py":235
  * 
  *         if kw.get("allow_tags"):
  *             if kw.get("remove_unknown_tags"):             # <<<<<<<<<<<<<<
@@ -2692,16 +2704,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
     }
 
-    /* "lxml/html/clean.py":233
+    /* "lxml/html/clean.py":238
  *                 raise ValueError("It does not make sense to pass in both "
  *                                  "allow_tags and remove_unknown_tags")
  *             self.remove_unknown_tags = False             # <<<<<<<<<<<<<<
  * 
  *     # Used to lookup the primary URL for a given tag that is up for
  */
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags, Py_False) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags, Py_False) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":229
+    /* "lxml/html/clean.py":234
  *             self.inline_style = self.style
  * 
  *         if kw.get("allow_tags"):             # <<<<<<<<<<<<<<
@@ -2710,7 +2722,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
  */
   }
 
-  /* "lxml/html/clean.py":217
+  /* "lxml/html/clean.py":222
  *     whitelist_tags = {'iframe', 'embed'}
  * 
  *     def __init__(self, **kw):             # <<<<<<<<<<<<<<
@@ -2737,7 +2749,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner___init__(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":257
+/* "lxml/html/clean.py":262
  *         )
  * 
  *     def __call__(self, doc):             # <<<<<<<<<<<<<<
@@ -2781,11 +2793,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_3__call__(PyObject *__pyx_
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 257, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, 1); __PYX_ERR(0, 262, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 257, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 262, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -2798,7 +2810,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_3__call__(PyObject *__pyx_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 257, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 262, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -2853,7 +2865,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   __Pyx_RefNannySetupContext("__call__", 0);
   __Pyx_INCREF(__pyx_v_doc);
 
-  /* "lxml/html/clean.py":261
+  /* "lxml/html/clean.py":266
  *         Cleans the document.
  *         """
  *         try:             # <<<<<<<<<<<<<<
@@ -2869,19 +2881,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "lxml/html/clean.py":262
+      /* "lxml/html/clean.py":267
  *         """
  *         try:
  *             getroot = doc.getroot             # <<<<<<<<<<<<<<
  *         except AttributeError:
  *             pass  # Element instance
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 262, __pyx_L3_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_getroot); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 267, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_getroot = __pyx_t_4;
       __pyx_t_4 = 0;
 
-      /* "lxml/html/clean.py":261
+      /* "lxml/html/clean.py":266
  *         Cleans the document.
  *         """
  *         try:             # <<<<<<<<<<<<<<
@@ -2890,7 +2902,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":266
+    /* "lxml/html/clean.py":271
  *             pass  # Element instance
  *         else:
  *             doc = getroot()  # ElementTree instance, instead of an element             # <<<<<<<<<<<<<<
@@ -2911,7 +2923,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 266, __pyx_L5_except_error)
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF_SET(__pyx_v_doc, __pyx_t_4);
@@ -2924,7 +2936,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/html/clean.py":263
+    /* "lxml/html/clean.py":268
  *         try:
  *             getroot = doc.getroot
  *         except AttributeError:             # <<<<<<<<<<<<<<
@@ -2939,7 +2951,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "lxml/html/clean.py":261
+    /* "lxml/html/clean.py":266
  *         Cleans the document.
  *         """
  *         try:             # <<<<<<<<<<<<<<
@@ -2959,14 +2971,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_L8_try_end:;
   }
 
-  /* "lxml/html/clean.py":268
+  /* "lxml/html/clean.py":273
  *             doc = getroot()  # ElementTree instance, instead of an element
  *         # convert XHTML to HTML
  *         xhtml_to_html(doc)             # <<<<<<<<<<<<<<
  *         # Normalize a case that IE treats <image> like <img>, and that
  *         # can confuse either this step or later steps.
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 268, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_6 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -2980,19 +2992,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 273, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/html/clean.py":271
+  /* "lxml/html/clean.py":276
  *         # Normalize a case that IE treats <image> like <img>, and that
  *         # can confuse either this step or later steps.
  *         for el in doc.iter('image'):             # <<<<<<<<<<<<<<
  *             el.tag = 'img'
  *         if not self.comments:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_6 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -3006,16 +3018,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_image) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_image);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
     __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
     __pyx_t_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
+    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 271, __pyx_L1_error)
+    __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 276, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   for (;;) {
@@ -3023,17 +3035,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       if (likely(PyList_CheckExact(__pyx_t_5))) {
         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 271, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 276, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 271, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -3043,7 +3055,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 271, __pyx_L1_error)
+          else __PYX_ERR(0, 276, __pyx_L1_error)
         }
         break;
       }
@@ -3052,16 +3064,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "lxml/html/clean.py":272
+    /* "lxml/html/clean.py":277
  *         # can confuse either this step or later steps.
  *         for el in doc.iter('image'):
  *             el.tag = 'img'             # <<<<<<<<<<<<<<
  *         if not self.comments:
  *             # Of course, if we were going to kill comments anyway, we don't
  */
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_img) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_img) < 0) __PYX_ERR(0, 277, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":271
+    /* "lxml/html/clean.py":276
  *         # Normalize a case that IE treats <image> like <img>, and that
  *         # can confuse either this step or later steps.
  *         for el in doc.iter('image'):             # <<<<<<<<<<<<<<
@@ -3071,28 +3083,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":273
+  /* "lxml/html/clean.py":278
  *         for el in doc.iter('image'):
  *             el.tag = 'img'
  *         if not self.comments:             # <<<<<<<<<<<<<<
  *             # Of course, if we were going to kill comments anyway, we don't
  *             # need to worry about this
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 278, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 273, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_11 = ((!__pyx_t_10) != 0);
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":276
+    /* "lxml/html/clean.py":281
  *             # Of course, if we were going to kill comments anyway, we don't
  *             # need to worry about this
  *             self.kill_conditional_comments(doc)             # <<<<<<<<<<<<<<
  * 
  *         kill_tags = set(self.kill_tags or ())
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_conditional_comments); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_conditional_comments); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 281, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -3106,12 +3118,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_doc);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 281, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":273
+    /* "lxml/html/clean.py":278
  *         for el in doc.iter('image'):
  *             el.tag = 'img'
  *         if not self.comments:             # <<<<<<<<<<<<<<
@@ -3120,16 +3132,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":278
+  /* "lxml/html/clean.py":283
  *             self.kill_conditional_comments(doc)
  * 
  *         kill_tags = set(self.kill_tags or ())             # <<<<<<<<<<<<<<
  *         remove_tags = set(self.remove_tags or ())
  *         allow_tags = set(self.allow_tags or ())
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 278, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 283, __pyx_L1_error)
   if (!__pyx_t_11) {
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
@@ -3141,22 +3153,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   __Pyx_INCREF(__pyx_empty_tuple);
   __pyx_t_5 = __pyx_empty_tuple;
   __pyx_L12_bool_binop_done:;
-  __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
+  __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_v_kill_tags = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/html/clean.py":279
+  /* "lxml/html/clean.py":284
  * 
  *         kill_tags = set(self.kill_tags or ())
  *         remove_tags = set(self.remove_tags or ())             # <<<<<<<<<<<<<<
  *         allow_tags = set(self.allow_tags or ())
  * 
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
   if (!__pyx_t_11) {
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else {
@@ -3168,22 +3180,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   __Pyx_INCREF(__pyx_empty_tuple);
   __pyx_t_4 = __pyx_empty_tuple;
   __pyx_L14_bool_binop_done:;
-  __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 279, __pyx_L1_error)
+  __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_remove_tags = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":280
+  /* "lxml/html/clean.py":285
  *         kill_tags = set(self.kill_tags or ())
  *         remove_tags = set(self.remove_tags or ())
  *         allow_tags = set(self.allow_tags or ())             # <<<<<<<<<<<<<<
  * 
  *         if self.scripts:
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_tags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 285, __pyx_L1_error)
   if (!__pyx_t_11) {
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
@@ -3195,35 +3207,35 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   __Pyx_INCREF(__pyx_empty_tuple);
   __pyx_t_5 = __pyx_empty_tuple;
   __pyx_L16_bool_binop_done:;
-  __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
+  __pyx_t_4 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_v_allow_tags = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "lxml/html/clean.py":282
+  /* "lxml/html/clean.py":287
  *         allow_tags = set(self.allow_tags or ())
  * 
  *         if self.scripts:             # <<<<<<<<<<<<<<
  *             kill_tags.add('script')
  *         if self.safe_attrs_only:
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scripts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_scripts); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 287, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 282, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 287, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":283
+    /* "lxml/html/clean.py":288
  * 
  *         if self.scripts:
  *             kill_tags.add('script')             # <<<<<<<<<<<<<<
  *         if self.safe_attrs_only:
  *             safe_attrs = set(self.safe_attrs)
  */
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 283, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_script); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":282
+    /* "lxml/html/clean.py":287
  *         allow_tags = set(self.allow_tags or ())
  * 
  *         if self.scripts:             # <<<<<<<<<<<<<<
@@ -3232,46 +3244,46 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":284
+  /* "lxml/html/clean.py":289
  *         if self.scripts:
  *             kill_tags.add('script')
  *         if self.safe_attrs_only:             # <<<<<<<<<<<<<<
  *             safe_attrs = set(self.safe_attrs)
  *             for el in doc.iter(etree.Element):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 284, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":285
+    /* "lxml/html/clean.py":290
  *             kill_tags.add('script')
  *         if self.safe_attrs_only:
  *             safe_attrs = set(self.safe_attrs)             # <<<<<<<<<<<<<<
  *             for el in doc.iter(etree.Element):
  *                 attrib = el.attrib
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 285, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 290, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 285, __pyx_L1_error)
+    __pyx_t_5 = PySet_New(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 290, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_safe_attrs = ((PyObject*)__pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":286
+    /* "lxml/html/clean.py":291
  *         if self.safe_attrs_only:
  *             safe_attrs = set(self.safe_attrs)
  *             for el in doc.iter(etree.Element):             # <<<<<<<<<<<<<<
  *                 attrib = el.attrib
  *                 for aname in attrib.keys():
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 291, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 286, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 291, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_6 = NULL;
@@ -3287,16 +3299,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_13);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
       __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 286, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 286, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 291, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     for (;;) {
@@ -3304,17 +3316,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         if (likely(PyList_CheckExact(__pyx_t_4))) {
           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
+          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
           #else
-          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
           #else
-          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 286, __pyx_L1_error)
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         }
@@ -3324,7 +3336,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 286, __pyx_L1_error)
+            else __PYX_ERR(0, 291, __pyx_L1_error)
           }
           break;
         }
@@ -3333,19 +3345,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":287
+      /* "lxml/html/clean.py":292
  *             safe_attrs = set(self.safe_attrs)
  *             for el in doc.iter(etree.Element):
  *                 attrib = el.attrib             # <<<<<<<<<<<<<<
  *                 for aname in attrib.keys():
  *                     if aname not in safe_attrs:
  */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 287, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 292, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_XDECREF_SET(__pyx_v_attrib, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":288
+      /* "lxml/html/clean.py":293
  *             for el in doc.iter(etree.Element):
  *                 attrib = el.attrib
  *                 for aname in attrib.keys():             # <<<<<<<<<<<<<<
@@ -3355,9 +3367,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __pyx_t_14 = 0;
       if (unlikely(__pyx_v_attrib == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
-        __PYX_ERR(0, 288, __pyx_L1_error)
+        __PYX_ERR(0, 293, __pyx_L1_error)
       }
-      __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_15), (&__pyx_t_7)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 288, __pyx_L1_error)
+      __pyx_t_13 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_15), (&__pyx_t_7)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 293, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_13);
       __Pyx_XDECREF(__pyx_t_5);
       __pyx_t_5 = __pyx_t_13;
@@ -3365,32 +3377,32 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       while (1) {
         __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_15, &__pyx_t_14, &__pyx_t_13, NULL, NULL, __pyx_t_7);
         if (unlikely(__pyx_t_16 == 0)) break;
-        if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 288, __pyx_L1_error)
+        if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 293, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
         __Pyx_XDECREF_SET(__pyx_v_aname, __pyx_t_13);
         __pyx_t_13 = 0;
 
-        /* "lxml/html/clean.py":289
+        /* "lxml/html/clean.py":294
  *                 attrib = el.attrib
  *                 for aname in attrib.keys():
  *                     if aname not in safe_attrs:             # <<<<<<<<<<<<<<
  *                         del attrib[aname]
  *         if self.javascript:
  */
-        __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_aname, __pyx_v_safe_attrs, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 289, __pyx_L1_error)
+        __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_v_aname, __pyx_v_safe_attrs, Py_NE)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 294, __pyx_L1_error)
         __pyx_t_10 = (__pyx_t_11 != 0);
         if (__pyx_t_10) {
 
-          /* "lxml/html/clean.py":290
+          /* "lxml/html/clean.py":295
  *                 for aname in attrib.keys():
  *                     if aname not in safe_attrs:
  *                         del attrib[aname]             # <<<<<<<<<<<<<<
  *         if self.javascript:
  *             if not (self.safe_attrs_only and
  */
-          if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 290, __pyx_L1_error)
+          if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
 
-          /* "lxml/html/clean.py":289
+          /* "lxml/html/clean.py":294
  *                 attrib = el.attrib
  *                 for aname in attrib.keys():
  *                     if aname not in safe_attrs:             # <<<<<<<<<<<<<<
@@ -3401,7 +3413,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":286
+      /* "lxml/html/clean.py":291
  *         if self.safe_attrs_only:
  *             safe_attrs = set(self.safe_attrs)
  *             for el in doc.iter(etree.Element):             # <<<<<<<<<<<<<<
@@ -3411,7 +3423,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/html/clean.py":284
+    /* "lxml/html/clean.py":289
  *         if self.scripts:
  *             kill_tags.add('script')
  *         if self.safe_attrs_only:             # <<<<<<<<<<<<<<
@@ -3420,29 +3432,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":291
+  /* "lxml/html/clean.py":296
  *                     if aname not in safe_attrs:
  *                         del attrib[aname]
  *         if self.javascript:             # <<<<<<<<<<<<<<
  *             if not (self.safe_attrs_only and
  *                     self.safe_attrs == defs.safe_attrs):
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 291, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":292
+    /* "lxml/html/clean.py":297
  *                         del attrib[aname]
  *         if self.javascript:
  *             if not (self.safe_attrs_only and             # <<<<<<<<<<<<<<
  *                     self.safe_attrs == defs.safe_attrs):
  *                 # safe_attrs handles events attributes itself
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs_only); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 297, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 292, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 297, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     if (__pyx_t_11) {
     } else {
@@ -3450,29 +3462,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       goto __pyx_L27_bool_binop_done;
     }
 
-    /* "lxml/html/clean.py":293
+    /* "lxml/html/clean.py":298
  *         if self.javascript:
  *             if not (self.safe_attrs_only and
  *                     self.safe_attrs == defs.safe_attrs):             # <<<<<<<<<<<<<<
  *                 # safe_attrs handles events attributes itself
  *                 for el in doc.iter(etree.Element):
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 298, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_13, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 298, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 293, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_10 = __pyx_t_11;
     __pyx_L27_bool_binop_done:;
 
-    /* "lxml/html/clean.py":292
+    /* "lxml/html/clean.py":297
  *                         del attrib[aname]
  *         if self.javascript:
  *             if not (self.safe_attrs_only and             # <<<<<<<<<<<<<<
@@ -3482,18 +3494,18 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_11 = ((!__pyx_t_10) != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":295
+      /* "lxml/html/clean.py":300
  *                     self.safe_attrs == defs.safe_attrs):
  *                 # safe_attrs handles events attributes itself
  *                 for el in doc.iter(etree.Element):             # <<<<<<<<<<<<<<
  *                     attrib = el.attrib
  *                     for aname in attrib.keys():
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
+      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_13);
-      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 295, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 295, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_t_4 = NULL;
@@ -3509,16 +3521,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
       if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
         __pyx_t_13 = __pyx_t_5; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
         __pyx_t_9 = NULL;
       } else {
-        __pyx_t_8 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 295, __pyx_L1_error)
+        __pyx_t_8 = -1; __pyx_t_13 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_9 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 295, __pyx_L1_error)
+        __pyx_t_9 = Py_TYPE(__pyx_t_13)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 300, __pyx_L1_error)
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       for (;;) {
@@ -3526,17 +3538,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           if (likely(PyList_CheckExact(__pyx_t_13))) {
             if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
+            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
             #else
-            __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+            __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_5);
             #endif
           } else {
             if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_13)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 295, __pyx_L1_error)
+            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 300, __pyx_L1_error)
             #else
-            __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
+            __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_5);
             #endif
           }
@@ -3546,7 +3558,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(0, 295, __pyx_L1_error)
+              else __PYX_ERR(0, 300, __pyx_L1_error)
             }
             break;
           }
@@ -3555,19 +3567,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":296
+        /* "lxml/html/clean.py":301
  *                 # safe_attrs handles events attributes itself
  *                 for el in doc.iter(etree.Element):
  *                     attrib = el.attrib             # <<<<<<<<<<<<<<
  *                     for aname in attrib.keys():
  *                         if aname.startswith('on'):
  */
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_XDECREF_SET(__pyx_v_attrib, __pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":297
+        /* "lxml/html/clean.py":302
  *                 for el in doc.iter(etree.Element):
  *                     attrib = el.attrib
  *                     for aname in attrib.keys():             # <<<<<<<<<<<<<<
@@ -3577,9 +3589,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __pyx_t_15 = 0;
         if (unlikely(__pyx_v_attrib == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "keys");
-          __PYX_ERR(0, 297, __pyx_L1_error)
+          __PYX_ERR(0, 302, __pyx_L1_error)
         }
-        __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_14), (&__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_attrib, 0, __pyx_n_s_keys, (&__pyx_t_14), (&__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 302, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_XDECREF(__pyx_t_5);
         __pyx_t_5 = __pyx_t_6;
@@ -3587,19 +3599,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         while (1) {
           __pyx_t_16 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_14, &__pyx_t_15, &__pyx_t_6, NULL, NULL, __pyx_t_7);
           if (unlikely(__pyx_t_16 == 0)) break;
-          if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 297, __pyx_L1_error)
+          if (unlikely(__pyx_t_16 == -1)) __PYX_ERR(0, 302, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_XDECREF_SET(__pyx_v_aname, __pyx_t_6);
           __pyx_t_6 = 0;
 
-          /* "lxml/html/clean.py":298
+          /* "lxml/html/clean.py":303
  *                     attrib = el.attrib
  *                     for aname in attrib.keys():
  *                         if aname.startswith('on'):             # <<<<<<<<<<<<<<
  *                             del attrib[aname]
  *             doc.rewrite_links(self._remove_javascript_link,
  */
-          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_aname, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 298, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_aname, __pyx_n_s_startswith); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 303, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_t_17 = NULL;
           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -3613,23 +3625,23 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           }
           __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_17, __pyx_n_s_on) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_on);
           __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 298, __pyx_L1_error)
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 303, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 298, __pyx_L1_error)
+          __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 303, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           if (__pyx_t_11) {
 
-            /* "lxml/html/clean.py":299
+            /* "lxml/html/clean.py":304
  *                     for aname in attrib.keys():
  *                         if aname.startswith('on'):
  *                             del attrib[aname]             # <<<<<<<<<<<<<<
  *             doc.rewrite_links(self._remove_javascript_link,
  *                               resolve_base_href=False)
  */
-            if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 299, __pyx_L1_error)
+            if (unlikely(PyObject_DelItem(__pyx_v_attrib, __pyx_v_aname) < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
 
-            /* "lxml/html/clean.py":298
+            /* "lxml/html/clean.py":303
  *                     attrib = el.attrib
  *                     for aname in attrib.keys():
  *                         if aname.startswith('on'):             # <<<<<<<<<<<<<<
@@ -3640,7 +3652,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":295
+        /* "lxml/html/clean.py":300
  *                     self.safe_attrs == defs.safe_attrs):
  *                 # safe_attrs handles events attributes itself
  *                 for el in doc.iter(etree.Element):             # <<<<<<<<<<<<<<
@@ -3650,7 +3662,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
-      /* "lxml/html/clean.py":292
+      /* "lxml/html/clean.py":297
  *                         del attrib[aname]
  *         if self.javascript:
  *             if not (self.safe_attrs_only and             # <<<<<<<<<<<<<<
@@ -3659,70 +3671,70 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":300
+    /* "lxml/html/clean.py":305
  *                         if aname.startswith('on'):
  *                             del attrib[aname]
  *             doc.rewrite_links(self._remove_javascript_link,             # <<<<<<<<<<<<<<
  *                               resolve_base_href=False)
  *             # If we're deleting style then we don't have to remove JS links
  */
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_rewrite_links); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 300, __pyx_L1_error)
+    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_rewrite_links); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 305, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_javascript_link); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 300, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_javascript_link); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 300, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 305, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_GIVEREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":301
+    /* "lxml/html/clean.py":306
  *                             del attrib[aname]
  *             doc.rewrite_links(self._remove_javascript_link,
  *                               resolve_base_href=False)             # <<<<<<<<<<<<<<
  *             # If we're deleting style then we don't have to remove JS links
  *             # from styles, otherwise...
  */
-    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 301, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 306, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_base_href, Py_False) < 0) __PYX_ERR(0, 301, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_resolve_base_href, Py_False) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":300
+    /* "lxml/html/clean.py":305
  *                         if aname.startswith('on'):
  *                             del attrib[aname]
  *             doc.rewrite_links(self._remove_javascript_link,             # <<<<<<<<<<<<<<
  *                               resolve_base_href=False)
  *             # If we're deleting style then we don't have to remove JS links
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 300, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/html/clean.py":304
+    /* "lxml/html/clean.py":309
  *             # If we're deleting style then we don't have to remove JS links
  *             # from styles, otherwise...
  *             if not self.inline_style:             # <<<<<<<<<<<<<<
  *                 for el in _find_styled_elements(doc):
  *                     old = el.get('style')
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 304, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 304, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_10 = ((!__pyx_t_11) != 0);
     if (__pyx_t_10) {
 
-      /* "lxml/html/clean.py":305
+      /* "lxml/html/clean.py":310
  *             # from styles, otherwise...
  *             if not self.inline_style:
  *                 for el in _find_styled_elements(doc):             # <<<<<<<<<<<<<<
  *                     old = el.get('style')
- *                     new = _css_javascript_re.sub('', old)
+ *                     new = _replace_css_javascript('', old)
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_find_styled_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_find_styled_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_6 = NULL;
       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
@@ -3736,16 +3748,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
         __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
         __pyx_t_9 = NULL;
       } else {
-        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 305, __pyx_L1_error)
+        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 305, __pyx_L1_error)
+        __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       for (;;) {
@@ -3753,17 +3765,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           if (likely(PyList_CheckExact(__pyx_t_5))) {
             if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
+            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           } else {
             if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 305, __pyx_L1_error)
+            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 310, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 305, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           }
@@ -3773,7 +3785,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(0, 305, __pyx_L1_error)
+              else __PYX_ERR(0, 310, __pyx_L1_error)
             }
             break;
           }
@@ -3782,14 +3794,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":306
+        /* "lxml/html/clean.py":311
  *             if not self.inline_style:
  *                 for el in _find_styled_elements(doc):
  *                     old = el.get('style')             # <<<<<<<<<<<<<<
- *                     new = _css_javascript_re.sub('', old)
- *                     new = _css_import_re.sub('', new)
+ *                     new = _replace_css_javascript('', old)
+ *                     new = _replace_css_import('', new)
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 306, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 311, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_13 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -3803,57 +3815,54 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_style);
         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 306, __pyx_L1_error)
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":307
+        /* "lxml/html/clean.py":312
  *                 for el in _find_styled_elements(doc):
  *                     old = el.get('style')
- *                     new = _css_javascript_re.sub('', old)             # <<<<<<<<<<<<<<
- *                     new = _css_import_re.sub('', new)
+ *                     new = _replace_css_javascript('', old)             # <<<<<<<<<<<<<<
+ *                     new = _replace_css_import('', new)
  *                     if self._has_sneaky_javascript(new):
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_css_javascript_re); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 307, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_replace_css_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 312, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_sub); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 307, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_6 = NULL;
+        __pyx_t_13 = NULL;
         __pyx_t_7 = 0;
-        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
-          if (likely(__pyx_t_6)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
-            __Pyx_INCREF(__pyx_t_6);
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_13);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
             __pyx_t_7 = 1;
           }
         }
         #if CYTHON_FAST_PYCALL
-        if (PyFunction_Check(__pyx_t_13)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (PyFunction_Check(__pyx_t_6)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
+          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         #if CYTHON_FAST_PYCCALL
-        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
+          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         {
-          __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 307, __pyx_L1_error)
+          __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 312, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_17);
-          if (__pyx_t_6) {
-            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_6); __pyx_t_6 = NULL;
+          if (__pyx_t_13) {
+            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
           }
           __Pyx_INCREF(__pyx_kp_s__2);
           __Pyx_GIVEREF(__pyx_kp_s__2);
@@ -3861,117 +3870,114 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           __Pyx_INCREF(__pyx_v_old);
           __Pyx_GIVEREF(__pyx_v_old);
           PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_old);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         }
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":308
+        /* "lxml/html/clean.py":313
  *                     old = el.get('style')
- *                     new = _css_javascript_re.sub('', old)
- *                     new = _css_import_re.sub('', new)             # <<<<<<<<<<<<<<
+ *                     new = _replace_css_javascript('', old)
+ *                     new = _replace_css_import('', new)             # <<<<<<<<<<<<<<
  *                     if self._has_sneaky_javascript(new):
  *                         # Something tricky is going on...
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_css_import_re); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 308, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_sub); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 308, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_13 = NULL;
+        __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_replace_css_import); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 313, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_17 = NULL;
         __pyx_t_7 = 0;
-        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
-          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
-          if (likely(__pyx_t_13)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
-            __Pyx_INCREF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_17)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_17);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_17, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
             __pyx_t_7 = 1;
           }
         }
         #if CYTHON_FAST_PYCALL
-        if (PyFunction_Check(__pyx_t_17)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
-          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (PyFunction_Check(__pyx_t_6)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_new};
+          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         #if CYTHON_FAST_PYCCALL
-        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
-          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_new};
+          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 308, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_6);
-          if (__pyx_t_13) {
-            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
+          __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          if (__pyx_t_17) {
+            __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17); __pyx_t_17 = NULL;
           }
           __Pyx_INCREF(__pyx_kp_s__2);
           __Pyx_GIVEREF(__pyx_kp_s__2);
-          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
           __Pyx_INCREF(__pyx_v_new);
           __Pyx_GIVEREF(__pyx_v_new);
-          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_new);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 308, __pyx_L1_error)
+          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_new);
+          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         }
-        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":309
- *                     new = _css_javascript_re.sub('', old)
- *                     new = _css_import_re.sub('', new)
+        /* "lxml/html/clean.py":314
+ *                     new = _replace_css_javascript('', old)
+ *                     new = _replace_css_import('', new)
  *                     if self._has_sneaky_javascript(new):             # <<<<<<<<<<<<<<
  *                         # Something tricky is going on...
  *                         del el.attrib['style']
  */
-        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 309, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_17);
-        __pyx_t_6 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
-          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
-          if (likely(__pyx_t_6)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
-            __Pyx_INCREF(__pyx_t_6);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 314, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+            __Pyx_INCREF(__pyx_t_13);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_17, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_new);
-        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 309, __pyx_L1_error)
+        __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_new);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 314, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 309, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_10) {
 
-          /* "lxml/html/clean.py":311
+          /* "lxml/html/clean.py":316
  *                     if self._has_sneaky_javascript(new):
  *                         # Something tricky is going on...
  *                         del el.attrib['style']             # <<<<<<<<<<<<<<
  *                     elif new != old:
  *                         el.set('style', new)
  */
-          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 311, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
-          if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_n_s_style) < 0)) __PYX_ERR(0, 311, __pyx_L1_error)
+          if (unlikely(PyObject_DelItem(__pyx_t_4, __pyx_n_s_style) < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-          /* "lxml/html/clean.py":309
- *                     new = _css_javascript_re.sub('', old)
- *                     new = _css_import_re.sub('', new)
+          /* "lxml/html/clean.py":314
+ *                     new = _replace_css_javascript('', old)
+ *                     new = _replace_css_import('', new)
  *                     if self._has_sneaky_javascript(new):             # <<<<<<<<<<<<<<
  *                         # Something tricky is going on...
  *                         del el.attrib['style']
@@ -3979,75 +3985,75 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           goto __pyx_L37;
         }
 
-        /* "lxml/html/clean.py":312
+        /* "lxml/html/clean.py":317
  *                         # Something tricky is going on...
  *                         del el.attrib['style']
  *                     elif new != old:             # <<<<<<<<<<<<<<
  *                         el.set('style', new)
  *             if not self.style:
  */
-        __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 312, __pyx_L1_error)
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
+        __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 317, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_10) {
 
-          /* "lxml/html/clean.py":313
+          /* "lxml/html/clean.py":318
  *                         del el.attrib['style']
  *                     elif new != old:
  *                         el.set('style', new)             # <<<<<<<<<<<<<<
  *             if not self.style:
  *                 for el in list(doc.iter('style')):
  */
-          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 313, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_17);
-          __pyx_t_6 = NULL;
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 318, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          __pyx_t_13 = NULL;
           __pyx_t_7 = 0;
-          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
-            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
-            if (likely(__pyx_t_6)) {
-              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
-              __Pyx_INCREF(__pyx_t_6);
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+            __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
+            if (likely(__pyx_t_13)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+              __Pyx_INCREF(__pyx_t_13);
               __Pyx_INCREF(function);
-              __Pyx_DECREF_SET(__pyx_t_17, function);
+              __Pyx_DECREF_SET(__pyx_t_6, function);
               __pyx_t_7 = 1;
             }
           }
           #if CYTHON_FAST_PYCALL
-          if (PyFunction_Check(__pyx_t_17)) {
-            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_style, __pyx_v_new};
-            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
-            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+          if (PyFunction_Check(__pyx_t_6)) {
+            PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_n_s_style, __pyx_v_new};
+            __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
             __Pyx_GOTREF(__pyx_t_4);
           } else
           #endif
           #if CYTHON_FAST_PYCCALL
-          if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
-            PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_n_s_style, __pyx_v_new};
-            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
-            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+          if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+            PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_n_s_style, __pyx_v_new};
+            __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
+            __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
             __Pyx_GOTREF(__pyx_t_4);
           } else
           #endif
           {
-            __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 313, __pyx_L1_error)
-            __Pyx_GOTREF(__pyx_t_13);
-            if (__pyx_t_6) {
-              __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
+            __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 318, __pyx_L1_error)
+            __Pyx_GOTREF(__pyx_t_17);
+            if (__pyx_t_13) {
+              __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_13); __pyx_t_13 = NULL;
             }
             __Pyx_INCREF(__pyx_n_s_style);
             __Pyx_GIVEREF(__pyx_n_s_style);
-            PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_n_s_style);
+            PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_7, __pyx_n_s_style);
             __Pyx_INCREF(__pyx_v_new);
             __Pyx_GIVEREF(__pyx_v_new);
-            PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_new);
-            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 313, __pyx_L1_error)
+            PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_new);
+            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 318, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
-            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
           }
-          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-          /* "lxml/html/clean.py":312
+          /* "lxml/html/clean.py":317
  *                         # Something tricky is going on...
  *                         del el.attrib['style']
  *                     elif new != old:             # <<<<<<<<<<<<<<
@@ -4057,17 +4063,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_L37:;
 
-        /* "lxml/html/clean.py":305
+        /* "lxml/html/clean.py":310
  *             # from styles, otherwise...
  *             if not self.inline_style:
  *                 for el in _find_styled_elements(doc):             # <<<<<<<<<<<<<<
  *                     old = el.get('style')
- *                     new = _css_javascript_re.sub('', old)
+ *                     new = _replace_css_javascript('', old)
  */
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":304
+      /* "lxml/html/clean.py":309
  *             # If we're deleting style then we don't have to remove JS links
  *             # from styles, otherwise...
  *             if not self.inline_style:             # <<<<<<<<<<<<<<
@@ -4076,45 +4082,45 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":314
+    /* "lxml/html/clean.py":319
  *                     elif new != old:
  *                         el.set('style', new)
  *             if not self.style:             # <<<<<<<<<<<<<<
  *                 for el in list(doc.iter('style')):
  *                     if el.get('type', '').lower().strip() == 'text/javascript':
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 319, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 314, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_11 = ((!__pyx_t_10) != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":315
+      /* "lxml/html/clean.py":320
  *                         el.set('style', new)
  *             if not self.style:
  *                 for el in list(doc.iter('style')):             # <<<<<<<<<<<<<<
  *                     if el.get('type', '').lower().strip() == 'text/javascript':
  *                         el.drop_tree()
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_17 = NULL;
+      __pyx_t_6 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
-        __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_4);
-        if (likely(__pyx_t_17)) {
+        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+        if (likely(__pyx_t_6)) {
           PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
-          __Pyx_INCREF(__pyx_t_17);
+          __Pyx_INCREF(__pyx_t_6);
           __Pyx_INCREF(function);
           __Pyx_DECREF_SET(__pyx_t_4, function);
         }
       }
-      __pyx_t_5 = (__pyx_t_17) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_17, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_style);
-      __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
+      __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_n_s_style) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_style);
+      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 320, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+      __pyx_t_4 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
@@ -4122,102 +4128,102 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       for (;;) {
         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 315, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 320, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
         __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":316
+        /* "lxml/html/clean.py":321
  *             if not self.style:
  *                 for el in list(doc.iter('style')):
  *                     if el.get('type', '').lower().strip() == 'text/javascript':             # <<<<<<<<<<<<<<
  *                         el.drop_tree()
  *                         continue
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 321, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 316, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_lower); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lower); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_13 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(function);
+            __Pyx_DECREF_SET(__pyx_t_17, function);
+          }
+        }
+        __pyx_t_6 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strip); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 321, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __pyx_t_6 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
           if (likely(__pyx_t_6)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
             __Pyx_INCREF(__pyx_t_6);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_17, function);
           }
         }
-        __pyx_t_17 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 316, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_strip); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 316, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-        __pyx_t_17 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_13);
-          if (likely(__pyx_t_17)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
-            __Pyx_INCREF(__pyx_t_17);
-            __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
-          }
-        }
-        __pyx_t_4 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
-        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 316, __pyx_L1_error)
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 321, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_text_javascript, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 316, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+        __pyx_t_11 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_text_javascript, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 321, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":317
+          /* "lxml/html/clean.py":322
  *                 for el in list(doc.iter('style')):
  *                     if el.get('type', '').lower().strip() == 'text/javascript':
  *                         el.drop_tree()             # <<<<<<<<<<<<<<
  *                         continue
  *                     old = el.text or ''
  */
-          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 317, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_13);
-          __pyx_t_17 = NULL;
-          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-            __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_13);
-            if (likely(__pyx_t_17)) {
-              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
-              __Pyx_INCREF(__pyx_t_17);
+          __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 322, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_17);
+          __pyx_t_6 = NULL;
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+            if (likely(__pyx_t_6)) {
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+              __Pyx_INCREF(__pyx_t_6);
               __Pyx_INCREF(function);
-              __Pyx_DECREF_SET(__pyx_t_13, function);
+              __Pyx_DECREF_SET(__pyx_t_17, function);
             }
           }
-          __pyx_t_4 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
-          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
-          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 317, __pyx_L1_error)
+          __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-          /* "lxml/html/clean.py":318
+          /* "lxml/html/clean.py":323
  *                     if el.get('type', '').lower().strip() == 'text/javascript':
  *                         el.drop_tree()
  *                         continue             # <<<<<<<<<<<<<<
  *                     old = el.text or ''
- *                     new = _css_javascript_re.sub('', old)
+ *                     new = _replace_css_javascript('', old)
  */
           goto __pyx_L39_continue;
 
-          /* "lxml/html/clean.py":316
+          /* "lxml/html/clean.py":321
  *             if not self.style:
  *                 for el in list(doc.iter('style')):
  *                     if el.get('type', '').lower().strip() == 'text/javascript':             # <<<<<<<<<<<<<<
@@ -4226,22 +4232,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         }
 
-        /* "lxml/html/clean.py":319
+        /* "lxml/html/clean.py":324
  *                         el.drop_tree()
  *                         continue
  *                     old = el.text or ''             # <<<<<<<<<<<<<<
- *                     new = _css_javascript_re.sub('', old)
+ *                     new = _replace_css_javascript('', old)
  *                     # The imported CSS can do anything; we just can't allow:
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 319, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 319, __pyx_L1_error)
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 324, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 324, __pyx_L1_error)
         if (!__pyx_t_11) {
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         } else {
-          __Pyx_INCREF(__pyx_t_13);
-          __pyx_t_4 = __pyx_t_13;
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_INCREF(__pyx_t_17);
+          __pyx_t_4 = __pyx_t_17;
+          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
           goto __pyx_L42_bool_binop_done;
         }
         __Pyx_INCREF(__pyx_kp_s__2);
@@ -4250,25 +4256,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __Pyx_XDECREF_SET(__pyx_v_old, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":320
+        /* "lxml/html/clean.py":325
  *                         continue
  *                     old = el.text or ''
- *                     new = _css_javascript_re.sub('', old)             # <<<<<<<<<<<<<<
+ *                     new = _replace_css_javascript('', old)             # <<<<<<<<<<<<<<
  *                     # The imported CSS can do anything; we just can't allow:
- *                     new = _css_import_re.sub('', old)
+ *                     new = _replace_css_import('', new)
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_css_javascript_re); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 320, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_sub); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 320, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_replace_css_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 325, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_17);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_13 = NULL;
+        __pyx_t_6 = NULL;
         __pyx_t_7 = 0;
         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
-          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
-          if (likely(__pyx_t_13)) {
+          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+          if (likely(__pyx_t_6)) {
             PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
-            __Pyx_INCREF(__pyx_t_13);
+            __Pyx_INCREF(__pyx_t_6);
             __Pyx_INCREF(function);
             __Pyx_DECREF_SET(__pyx_t_17, function);
             __pyx_t_7 = 1;
@@ -4276,140 +4279,137 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_17)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
+          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+          PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s__2, __pyx_v_old};
+          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         {
-          __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 320, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_6);
-          if (__pyx_t_13) {
-            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
+          __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 325, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_13);
+          if (__pyx_t_6) {
+            __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
           }
           __Pyx_INCREF(__pyx_kp_s__2);
           __Pyx_GIVEREF(__pyx_kp_s__2);
-          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
           __Pyx_INCREF(__pyx_v_old);
           __Pyx_GIVEREF(__pyx_v_old);
-          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_old);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 320, __pyx_L1_error)
+          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_old);
+          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 325, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         }
         __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         __Pyx_XDECREF_SET(__pyx_v_new, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":322
- *                     new = _css_javascript_re.sub('', old)
+        /* "lxml/html/clean.py":327
+ *                     new = _replace_css_javascript('', old)
  *                     # The imported CSS can do anything; we just can't allow:
- *                     new = _css_import_re.sub('', old)             # <<<<<<<<<<<<<<
+ *                     new = _replace_css_import('', new)             # <<<<<<<<<<<<<<
  *                     if self._has_sneaky_javascript(new):
  *                         # Something tricky is going on...
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_css_import_re); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 322, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_replace_css_import); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 327, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_17);
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_sub); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
-        __pyx_t_17 = NULL;
+        __pyx_t_13 = NULL;
         __pyx_t_7 = 0;
-        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_17)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_17);
+        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_17);
+          if (likely(__pyx_t_13)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+            __Pyx_INCREF(__pyx_t_13);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
+            __Pyx_DECREF_SET(__pyx_t_17, function);
             __pyx_t_7 = 1;
           }
         }
         #if CYTHON_FAST_PYCALL
-        if (PyFunction_Check(__pyx_t_6)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+        if (PyFunction_Check(__pyx_t_17)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
+          __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         #if CYTHON_FAST_PYCCALL
-        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
-          PyObject *__pyx_temp[3] = {__pyx_t_17, __pyx_kp_s__2, __pyx_v_old};
-          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
-          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
+          PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_kp_s__2, __pyx_v_new};
+          __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
+          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
           __Pyx_GOTREF(__pyx_t_4);
         } else
         #endif
         {
-          __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 322, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_13);
-          if (__pyx_t_17) {
-            __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_17); __pyx_t_17 = NULL;
+          __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 327, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
+          if (__pyx_t_13) {
+            __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13); __pyx_t_13 = NULL;
           }
           __Pyx_INCREF(__pyx_kp_s__2);
           __Pyx_GIVEREF(__pyx_kp_s__2);
-          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_kp_s__2);
-          __Pyx_INCREF(__pyx_v_old);
-          __Pyx_GIVEREF(__pyx_v_old);
-          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_old);
-          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 322, __pyx_L1_error)
+          PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s__2);
+          __Pyx_INCREF(__pyx_v_new);
+          __Pyx_GIVEREF(__pyx_v_new);
+          PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_new);
+          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 327, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         }
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         __Pyx_DECREF_SET(__pyx_v_new, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "lxml/html/clean.py":323
+        /* "lxml/html/clean.py":328
  *                     # The imported CSS can do anything; we just can't allow:
- *                     new = _css_import_re.sub('', old)
+ *                     new = _replace_css_import('', new)
  *                     if self._has_sneaky_javascript(new):             # <<<<<<<<<<<<<<
  *                         # Something tricky is going on...
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 323, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_13 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_13)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_13);
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_has_sneaky_javascript); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 328, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __pyx_t_6 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+          if (likely(__pyx_t_6)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+            __Pyx_INCREF(__pyx_t_6);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
+            __Pyx_DECREF_SET(__pyx_t_17, function);
           }
         }
-        __pyx_t_4 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_new);
-        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 323, __pyx_L1_error)
+        __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_new);
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 328, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 323, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 328, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":325
+          /* "lxml/html/clean.py":330
  *                     if self._has_sneaky_javascript(new):
  *                         # Something tricky is going on...
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'             # <<<<<<<<<<<<<<
  *                     elif new != old:
  *                         el.text = new
  */
-          if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_kp_s_deleted) < 0) __PYX_ERR(0, 325, __pyx_L1_error)
+          if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_kp_s_deleted) < 0) __PYX_ERR(0, 330, __pyx_L1_error)
 
-          /* "lxml/html/clean.py":323
+          /* "lxml/html/clean.py":328
  *                     # The imported CSS can do anything; we just can't allow:
- *                     new = _css_import_re.sub('', old)
+ *                     new = _replace_css_import('', new)
  *                     if self._has_sneaky_javascript(new):             # <<<<<<<<<<<<<<
  *                         # Something tricky is going on...
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
@@ -4417,28 +4417,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           goto __pyx_L44;
         }
 
-        /* "lxml/html/clean.py":326
+        /* "lxml/html/clean.py":331
  *                         # Something tricky is going on...
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
  *                     elif new != old:             # <<<<<<<<<<<<<<
  *                         el.text = new
  *         if self.comments:
  */
-        __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 326, __pyx_L1_error)
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 326, __pyx_L1_error)
+        __pyx_t_4 = PyObject_RichCompare(__pyx_v_new, __pyx_v_old, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 331, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":327
+          /* "lxml/html/clean.py":332
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
  *                     elif new != old:
  *                         el.text = new             # <<<<<<<<<<<<<<
  *         if self.comments:
  *             kill_tags.add(etree.Comment)
  */
-          if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_new) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
+          if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_new) < 0) __PYX_ERR(0, 332, __pyx_L1_error)
 
-          /* "lxml/html/clean.py":326
+          /* "lxml/html/clean.py":331
  *                         # Something tricky is going on...
  *                         el.text = '/[inserted by cython to avoid comment start]* deleted *[inserted by cython to avoid comment closer]/'
  *                     elif new != old:             # <<<<<<<<<<<<<<
@@ -4448,7 +4448,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_L44:;
 
-        /* "lxml/html/clean.py":315
+        /* "lxml/html/clean.py":320
  *                         el.set('style', new)
  *             if not self.style:
  *                 for el in list(doc.iter('style')):             # <<<<<<<<<<<<<<
@@ -4459,7 +4459,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":314
+      /* "lxml/html/clean.py":319
  *                     elif new != old:
  *                         el.set('style', new)
  *             if not self.style:             # <<<<<<<<<<<<<<
@@ -4468,7 +4468,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":291
+    /* "lxml/html/clean.py":296
  *                     if aname not in safe_attrs:
  *                         del attrib[aname]
  *         if self.javascript:             # <<<<<<<<<<<<<<
@@ -4477,35 +4477,35 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":328
+  /* "lxml/html/clean.py":333
  *                     elif new != old:
  *                         el.text = new
  *         if self.comments:             # <<<<<<<<<<<<<<
  *             kill_tags.add(etree.Comment)
  *         if self.processing_instructions:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 328, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 333, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 328, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 333, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":329
+    /* "lxml/html/clean.py":334
  *                         el.text = new
  *         if self.comments:
  *             kill_tags.add(etree.Comment)             # <<<<<<<<<<<<<<
  *         if self.processing_instructions:
  *             kill_tags.add(etree.ProcessingInstruction)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Comment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 329, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_Comment); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 334, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 329, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 334, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "lxml/html/clean.py":328
+    /* "lxml/html/clean.py":333
  *                     elif new != old:
  *                         el.text = new
  *         if self.comments:             # <<<<<<<<<<<<<<
@@ -4514,35 +4514,35 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":330
+  /* "lxml/html/clean.py":335
  *         if self.comments:
  *             kill_tags.add(etree.Comment)
  *         if self.processing_instructions:             # <<<<<<<<<<<<<<
  *             kill_tags.add(etree.ProcessingInstruction)
  *         if self.style:
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 330, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 330, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 335, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":331
+    /* "lxml/html/clean.py":336
  *             kill_tags.add(etree.Comment)
  *         if self.processing_instructions:
  *             kill_tags.add(etree.ProcessingInstruction)             # <<<<<<<<<<<<<<
  *         if self.style:
  *             kill_tags.add('style')
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 331, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 331, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 336, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":330
+    /* "lxml/html/clean.py":335
  *         if self.comments:
  *             kill_tags.add(etree.Comment)
  *         if self.processing_instructions:             # <<<<<<<<<<<<<<
@@ -4551,29 +4551,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":332
+  /* "lxml/html/clean.py":337
  *         if self.processing_instructions:
  *             kill_tags.add(etree.ProcessingInstruction)
  *         if self.style:             # <<<<<<<<<<<<<<
  *             kill_tags.add('style')
  *         if self.inline_style:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 337, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 337, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":333
+    /* "lxml/html/clean.py":338
  *             kill_tags.add(etree.ProcessingInstruction)
  *         if self.style:
  *             kill_tags.add('style')             # <<<<<<<<<<<<<<
  *         if self.inline_style:
  *             etree.strip_attributes(doc, 'style')
  */
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 333, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_style); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 338, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":332
+    /* "lxml/html/clean.py":337
  *         if self.processing_instructions:
  *             kill_tags.add(etree.ProcessingInstruction)
  *         if self.style:             # <<<<<<<<<<<<<<
@@ -4582,79 +4582,79 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":334
+  /* "lxml/html/clean.py":339
  *         if self.style:
  *             kill_tags.add('style')
  *         if self.inline_style:             # <<<<<<<<<<<<<<
  *             etree.strip_attributes(doc, 'style')
  *         if self.links:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 334, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_inline_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":335
+    /* "lxml/html/clean.py":340
  *             kill_tags.add('style')
  *         if self.inline_style:
  *             etree.strip_attributes(doc, 'style')             # <<<<<<<<<<<<<<
  *         if self.links:
  *             kill_tags.add('link')
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 335, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 340, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip_attributes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 335, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strip_attributes); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 340, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = NULL;
     __pyx_t_7 = 0;
-    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
       if (likely(__pyx_t_4)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
         __Pyx_INCREF(__pyx_t_4);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
         __pyx_t_7 = 1;
       }
     }
     #if CYTHON_FAST_PYCALL
-    if (PyFunction_Check(__pyx_t_6)) {
+    if (PyFunction_Check(__pyx_t_17)) {
       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_doc, __pyx_n_s_style};
-      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else
     #endif
     #if CYTHON_FAST_PYCCALL
-    if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+    if (__Pyx_PyFastCFunction_Check(__pyx_t_17)) {
       PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_doc, __pyx_n_s_style};
-      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_17, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else
     #endif
     {
-      __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 335, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       if (__pyx_t_4) {
-        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
+        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
       }
       __Pyx_INCREF(__pyx_v_doc);
       __Pyx_GIVEREF(__pyx_v_doc);
-      PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_doc);
+      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_doc);
       __Pyx_INCREF(__pyx_n_s_style);
       __Pyx_GIVEREF(__pyx_n_s_style);
-      PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_n_s_style);
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 335, __pyx_L1_error)
+      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_n_s_style);
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 340, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     }
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":334
+    /* "lxml/html/clean.py":339
  *         if self.style:
  *             kill_tags.add('style')
  *         if self.inline_style:             # <<<<<<<<<<<<<<
@@ -4663,29 +4663,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":336
+  /* "lxml/html/clean.py":341
  *         if self.inline_style:
  *             etree.strip_attributes(doc, 'style')
  *         if self.links:             # <<<<<<<<<<<<<<
  *             kill_tags.add('link')
  *         elif self.style or self.javascript:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_links); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_links); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 336, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":337
+    /* "lxml/html/clean.py":342
  *             etree.strip_attributes(doc, 'style')
  *         if self.links:
  *             kill_tags.add('link')             # <<<<<<<<<<<<<<
  *         elif self.style or self.javascript:
  *             # We must get rid of included stylesheets if Javascript is not
  */
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 337, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_link); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 342, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":336
+    /* "lxml/html/clean.py":341
  *         if self.inline_style:
  *             etree.strip_attributes(doc, 'style')
  *         if self.links:             # <<<<<<<<<<<<<<
@@ -4695,161 +4695,161 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     goto __pyx_L49;
   }
 
-  /* "lxml/html/clean.py":338
+  /* "lxml/html/clean.py":343
  *         if self.links:
  *             kill_tags.add('link')
  *         elif self.style or self.javascript:             # <<<<<<<<<<<<<<
  *             # We must get rid of included stylesheets if Javascript is not
  *             # allowed, as you can put Javascript in them
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_style); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (!__pyx_t_10) {
   } else {
     __pyx_t_11 = __pyx_t_10;
     goto __pyx_L50_bool_binop_done;
   }
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 338, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_javascript); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 343, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 338, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 343, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_11 = __pyx_t_10;
   __pyx_L50_bool_binop_done:;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":341
+    /* "lxml/html/clean.py":346
  *             # We must get rid of included stylesheets if Javascript is not
  *             # allowed, as you can put Javascript in them
  *             for el in list(doc.iter('link')):             # <<<<<<<<<<<<<<
  *                 if 'stylesheet' in el.get('rel', '').lower():
  *                     # Note this kills alternate stylesheets as well
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_13 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-      if (likely(__pyx_t_13)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_13);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+        __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_link) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_link);
-    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 341, __pyx_L1_error)
+    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_n_s_link) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_n_s_link);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+    __pyx_t_17 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_5 = __pyx_t_17; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     for (;;) {
       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 341, __pyx_L1_error)
+      __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
       #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 341, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 346, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_17);
       #endif
-      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
-      __pyx_t_6 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+      __pyx_t_17 = 0;
 
-      /* "lxml/html/clean.py":342
+      /* "lxml/html/clean.py":347
  *             # allowed, as you can put Javascript in them
  *             for el in list(doc.iter('link')):
  *                 if 'stylesheet' in el.get('rel', '').lower():             # <<<<<<<<<<<<<<
  *                     # Note this kills alternate stylesheets as well
  *                     if not self.allow_element(el):
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 342, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 347, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 342, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lower); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 347, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
         if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
         }
       }
-      __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+      __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 342, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_stylesheet, __pyx_t_6, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
+      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 347, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_17);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_11 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_stylesheet, __pyx_t_17, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 347, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
       __pyx_t_10 = (__pyx_t_11 != 0);
       if (__pyx_t_10) {
 
-        /* "lxml/html/clean.py":344
+        /* "lxml/html/clean.py":349
  *                 if 'stylesheet' in el.get('rel', '').lower():
  *                     # Note this kills alternate stylesheets as well
  *                     if not self.allow_element(el):             # <<<<<<<<<<<<<<
  *                         el.drop_tree()
  *         if self.meta:
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 344, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 349, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+        __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
+        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 349, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 349, __pyx_L1_error)
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         __pyx_t_11 = ((!__pyx_t_10) != 0);
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":345
+          /* "lxml/html/clean.py":350
  *                     # Note this kills alternate stylesheets as well
  *                     if not self.allow_element(el):
  *                         el.drop_tree()             # <<<<<<<<<<<<<<
  *         if self.meta:
  *             kill_tags.add('meta')
  */
-          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 345, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_13);
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
           __pyx_t_4 = NULL;
-          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+          if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
             if (likely(__pyx_t_4)) {
-              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
               __Pyx_INCREF(__pyx_t_4);
               __Pyx_INCREF(function);
-              __Pyx_DECREF_SET(__pyx_t_13, function);
+              __Pyx_DECREF_SET(__pyx_t_6, function);
             }
           }
-          __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+          __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 345, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_6);
-          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+          if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 350, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_17);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 
-          /* "lxml/html/clean.py":344
+          /* "lxml/html/clean.py":349
  *                 if 'stylesheet' in el.get('rel', '').lower():
  *                     # Note this kills alternate stylesheets as well
  *                     if not self.allow_element(el):             # <<<<<<<<<<<<<<
@@ -4858,7 +4858,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         }
 
-        /* "lxml/html/clean.py":342
+        /* "lxml/html/clean.py":347
  *             # allowed, as you can put Javascript in them
  *             for el in list(doc.iter('link')):
  *                 if 'stylesheet' in el.get('rel', '').lower():             # <<<<<<<<<<<<<<
@@ -4867,7 +4867,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":341
+      /* "lxml/html/clean.py":346
  *             # We must get rid of included stylesheets if Javascript is not
  *             # allowed, as you can put Javascript in them
  *             for el in list(doc.iter('link')):             # <<<<<<<<<<<<<<
@@ -4877,7 +4877,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":338
+    /* "lxml/html/clean.py":343
  *         if self.links:
  *             kill_tags.add('link')
  *         elif self.style or self.javascript:             # <<<<<<<<<<<<<<
@@ -4887,29 +4887,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __pyx_L49:;
 
-  /* "lxml/html/clean.py":346
+  /* "lxml/html/clean.py":351
  *                     if not self.allow_element(el):
  *                         el.drop_tree()
  *         if self.meta:             # <<<<<<<<<<<<<<
  *             kill_tags.add('meta')
  *         if self.page_structure:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_meta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_meta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 351, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 346, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 351, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":347
+    /* "lxml/html/clean.py":352
  *                         el.drop_tree()
  *         if self.meta:
  *             kill_tags.add('meta')             # <<<<<<<<<<<<<<
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))
  */
-    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 347, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_kill_tags, __pyx_n_s_meta); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 352, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":346
+    /* "lxml/html/clean.py":351
  *                     if not self.allow_element(el):
  *                         el.drop_tree()
  *         if self.meta:             # <<<<<<<<<<<<<<
@@ -4918,31 +4918,31 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":348
+  /* "lxml/html/clean.py":353
  *         if self.meta:
  *             kill_tags.add('meta')
  *         if self.page_structure:             # <<<<<<<<<<<<<<
  *             remove_tags.update(('head', 'html', 'title'))
  *         if self.embedded:
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_page_structure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_page_structure); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 353, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 348, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 353, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":349
+    /* "lxml/html/clean.py":354
  *             kill_tags.add('meta')
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))             # <<<<<<<<<<<<<<
  *         if self.embedded:
  *             # FIXME: is <layer> really embedded?
  */
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 349, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":348
+    /* "lxml/html/clean.py":353
  *         if self.meta:
  *             kill_tags.add('meta')
  *         if self.page_structure:             # <<<<<<<<<<<<<<
@@ -4951,87 +4951,87 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":350
+  /* "lxml/html/clean.py":355
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))
  *         if self.embedded:             # <<<<<<<<<<<<<<
  *             # FIXME: is <layer> really embedded?
  *             # We should get rid of any <param> tags not inside <applet>;
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_embedded); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_embedded); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 355, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 350, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 355, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_11) {
 
-    /* "lxml/html/clean.py":354
+    /* "lxml/html/clean.py":359
  *             # We should get rid of any <param> tags not inside <applet>;
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):             # <<<<<<<<<<<<<<
  *                 parent = el.getparent()
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_13 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-      if (likely(__pyx_t_13)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_13);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+        __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_n_s_param) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_param);
-    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 354, __pyx_L1_error)
+    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_n_s_param) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_n_s_param);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 359, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+    __pyx_t_17 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_5 = __pyx_t_17; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     for (;;) {
       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 354, __pyx_L1_error)
+      __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 359, __pyx_L1_error)
       #else
-      __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 354, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 359, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_17);
       #endif
-      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
-      __pyx_t_6 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+      __pyx_t_17 = 0;
 
-      /* "lxml/html/clean.py":355
+      /* "lxml/html/clean.py":360
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):
  *                 parent = el.getparent()             # <<<<<<<<<<<<<<
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_getparent); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 355, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_getparent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
         if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
         }
       }
-      __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+      __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 355, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_6);
-      __pyx_t_6 = 0;
+      if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 360, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_17);
+      __pyx_t_17 = 0;
 
-      /* "lxml/html/clean.py":356
+      /* "lxml/html/clean.py":361
  *             for el in list(doc.iter('param')):
  *                 parent = el.getparent()
  *                 while parent is not None and parent.tag not in ('applet', 'object'):             # <<<<<<<<<<<<<<
@@ -5046,52 +5046,52 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           __pyx_t_11 = __pyx_t_18;
           goto __pyx_L63_bool_binop_done;
         }
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_applet, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_tag); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 361, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_applet, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
         if (__pyx_t_10) {
         } else {
           __pyx_t_18 = __pyx_t_10;
           goto __pyx_L65_bool_binop_done;
         }
-        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_object, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
+        __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_17, __pyx_n_s_object, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 361, __pyx_L1_error)
         __pyx_t_18 = __pyx_t_10;
         __pyx_L65_bool_binop_done:;
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         __pyx_t_10 = (__pyx_t_18 != 0);
         __pyx_t_11 = __pyx_t_10;
         __pyx_L63_bool_binop_done:;
         if (!__pyx_t_11) break;
 
-        /* "lxml/html/clean.py":357
+        /* "lxml/html/clean.py":362
  *                 parent = el.getparent()
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()             # <<<<<<<<<<<<<<
  *                 if parent is None:
  *                     el.drop_tree()
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_getparent); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 357, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_parent, __pyx_n_s_getparent); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 362, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+        __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_6);
-        __pyx_t_6 = 0;
+        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 362, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_17);
+        __pyx_t_17 = 0;
       }
 
-      /* "lxml/html/clean.py":358
+      /* "lxml/html/clean.py":363
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()
  *                 if parent is None:             # <<<<<<<<<<<<<<
@@ -5102,33 +5102,33 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __pyx_t_10 = (__pyx_t_11 != 0);
       if (__pyx_t_10) {
 
-        /* "lxml/html/clean.py":359
+        /* "lxml/html/clean.py":364
  *                     parent = parent.getparent()
  *                 if parent is None:
  *                     el.drop_tree()             # <<<<<<<<<<<<<<
  *             kill_tags.update(('applet',))
  *             # The alternate contents that are in an iframe are a good fallback:
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 359, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 364, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+        __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 359, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 364, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 
-        /* "lxml/html/clean.py":358
+        /* "lxml/html/clean.py":363
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()
  *                 if parent is None:             # <<<<<<<<<<<<<<
@@ -5137,7 +5137,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":354
+      /* "lxml/html/clean.py":359
  *             # We should get rid of any <param> tags not inside <applet>;
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):             # <<<<<<<<<<<<<<
@@ -5147,29 +5147,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":360
+    /* "lxml/html/clean.py":365
  *                 if parent is None:
  *                     el.drop_tree()
  *             kill_tags.update(('applet',))             # <<<<<<<<<<<<<<
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
  */
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 360, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":362
+    /* "lxml/html/clean.py":367
  *             kill_tags.update(('applet',))
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))             # <<<<<<<<<<<<<<
  *         if self.frames:
  *             # FIXME: ideally we should look at the frame links, but
  */
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 362, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":350
+    /* "lxml/html/clean.py":355
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))
  *         if self.embedded:             # <<<<<<<<<<<<<<
@@ -5178,37 +5178,37 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":363
+  /* "lxml/html/clean.py":368
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
  *         if self.frames:             # <<<<<<<<<<<<<<
  *             # FIXME: ideally we should look at the frame links, but
  *             # generally frames don't mix properly with an HTML
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_frames); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 363, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":367
+    /* "lxml/html/clean.py":372
  *             # generally frames don't mix properly with an HTML
  *             # fragment anyway.
  *             kill_tags.update(defs.frame_tags)             # <<<<<<<<<<<<<<
  *         if self.forms:
  *             remove_tags.add('form')
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frame_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 367, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_frame_tags); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 372, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_t_17); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":363
+    /* "lxml/html/clean.py":368
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
  *         if self.frames:             # <<<<<<<<<<<<<<
@@ -5217,40 +5217,40 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":368
+  /* "lxml/html/clean.py":373
  *             # fragment anyway.
  *             kill_tags.update(defs.frame_tags)
  *         if self.forms:             # <<<<<<<<<<<<<<
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_forms); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 373, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 368, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 373, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":369
+    /* "lxml/html/clean.py":374
  *             kill_tags.update(defs.frame_tags)
  *         if self.forms:
  *             remove_tags.add('form')             # <<<<<<<<<<<<<<
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:
  */
-    __pyx_t_12 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 369, __pyx_L1_error)
+    __pyx_t_12 = PySet_Add(__pyx_v_remove_tags, __pyx_n_s_form); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 374, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":370
+    /* "lxml/html/clean.py":375
  *         if self.forms:
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))             # <<<<<<<<<<<<<<
  *         if self.annoying_tags:
  *             remove_tags.update(('blink', 'marquee'))
  */
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 370, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_kill_tags, __pyx_tuple__8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":368
+    /* "lxml/html/clean.py":373
  *             # fragment anyway.
  *             kill_tags.update(defs.frame_tags)
  *         if self.forms:             # <<<<<<<<<<<<<<
@@ -5259,31 +5259,31 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":371
+  /* "lxml/html/clean.py":376
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:             # <<<<<<<<<<<<<<
  *             remove_tags.update(('blink', 'marquee'))
  * 
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_annoying_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_annoying_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":372
+    /* "lxml/html/clean.py":377
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:
  *             remove_tags.update(('blink', 'marquee'))             # <<<<<<<<<<<<<<
  * 
  *         _remove = []
  */
-    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PySet_Type_update, __pyx_v_remove_tags, __pyx_tuple__9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":371
+    /* "lxml/html/clean.py":376
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:             # <<<<<<<<<<<<<<
@@ -5292,89 +5292,89 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":374
+  /* "lxml/html/clean.py":379
  *             remove_tags.update(('blink', 'marquee'))
  * 
  *         _remove = []             # <<<<<<<<<<<<<<
  *         _kill = []
  *         for el in doc.iter():
  */
-  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v__remove = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":375
+  /* "lxml/html/clean.py":380
  * 
  *         _remove = []
  *         _kill = []             # <<<<<<<<<<<<<<
  *         for el in doc.iter():
  *             if el.tag in kill_tags:
  */
-  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 380, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v__kill = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":376
+  /* "lxml/html/clean.py":381
  *         _remove = []
  *         _kill = []
  *         for el in doc.iter():             # <<<<<<<<<<<<<<
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_13 = NULL;
-  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-    __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-    if (likely(__pyx_t_13)) {
-      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-      __Pyx_INCREF(__pyx_t_13);
+  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 381, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __pyx_t_6 = NULL;
+  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+    if (likely(__pyx_t_6)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+      __Pyx_INCREF(__pyx_t_6);
       __Pyx_INCREF(function);
-      __Pyx_DECREF_SET(__pyx_t_6, function);
+      __Pyx_DECREF_SET(__pyx_t_17, function);
     }
   }
-  __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
-  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+  __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
   if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
-    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
+    __pyx_t_17 = __pyx_t_5; __Pyx_INCREF(__pyx_t_17); __pyx_t_8 = 0;
     __pyx_t_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 376, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
+    __pyx_t_8 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
+    __pyx_t_9 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 381, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   for (;;) {
     if (likely(!__pyx_t_9)) {
-      if (likely(PyList_CheckExact(__pyx_t_6))) {
-        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
+      if (likely(PyList_CheckExact(__pyx_t_17))) {
+        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_17)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
-        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 376, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
     } else {
-      __pyx_t_5 = __pyx_t_9(__pyx_t_6);
+      __pyx_t_5 = __pyx_t_9(__pyx_t_17);
       if (unlikely(!__pyx_t_5)) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 376, __pyx_L1_error)
+          else __PYX_ERR(0, 381, __pyx_L1_error)
         }
         break;
       }
@@ -5383,49 +5383,49 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":377
+    /* "lxml/html/clean.py":382
  *         _kill = []
  *         for el in doc.iter():
  *             if el.tag in kill_tags:             # <<<<<<<<<<<<<<
  *                 if self.allow_element(el):
  *                     continue
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_kill_tags, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
+    __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_kill_tags, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_11 = (__pyx_t_10 != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":378
+      /* "lxml/html/clean.py":383
  *         for el in doc.iter():
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
  *                     continue
  *                 _kill.append(el)
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 378, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 383, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
         if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
         }
       }
-      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 378, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 383, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":379
+        /* "lxml/html/clean.py":384
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):
  *                     continue             # <<<<<<<<<<<<<<
@@ -5434,7 +5434,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         goto __pyx_L71_continue;
 
-        /* "lxml/html/clean.py":378
+        /* "lxml/html/clean.py":383
  *         for el in doc.iter():
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
@@ -5443,16 +5443,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":380
+      /* "lxml/html/clean.py":385
  *                 if self.allow_element(el):
  *                     continue
  *                 _kill.append(el)             # <<<<<<<<<<<<<<
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):
  */
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 380, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__kill, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 385, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":377
+      /* "lxml/html/clean.py":382
  *         _kill = []
  *         for el in doc.iter():
  *             if el.tag in kill_tags:             # <<<<<<<<<<<<<<
@@ -5462,49 +5462,49 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       goto __pyx_L73;
     }
 
-    /* "lxml/html/clean.py":381
+    /* "lxml/html/clean.py":386
  *                     continue
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:             # <<<<<<<<<<<<<<
  *                 if self.allow_element(el):
  *                     continue
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_remove_tags, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 381, __pyx_L1_error)
+    __pyx_t_11 = (__Pyx_PySet_ContainsTF(__pyx_t_5, __pyx_v_remove_tags, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_10 = (__pyx_t_11 != 0);
     if (__pyx_t_10) {
 
-      /* "lxml/html/clean.py":382
+      /* "lxml/html/clean.py":387
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
  *                     continue
  *                 _remove.append(el)
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 382, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_element); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 387, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
         if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
         }
       }
-      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 387, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 382, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 387, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       if (__pyx_t_10) {
 
-        /* "lxml/html/clean.py":383
+        /* "lxml/html/clean.py":388
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):
  *                     continue             # <<<<<<<<<<<<<<
@@ -5513,7 +5513,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         goto __pyx_L71_continue;
 
-        /* "lxml/html/clean.py":382
+        /* "lxml/html/clean.py":387
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
@@ -5522,16 +5522,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":384
+      /* "lxml/html/clean.py":389
  *                 if self.allow_element(el):
  *                     continue
  *                 _remove.append(el)             # <<<<<<<<<<<<<<
  * 
  *         if _remove and _remove[0] == doc:
  */
-      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 384, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyList_Append(__pyx_v__remove, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 389, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":381
+      /* "lxml/html/clean.py":386
  *                     continue
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:             # <<<<<<<<<<<<<<
@@ -5541,7 +5541,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __pyx_L73:;
 
-    /* "lxml/html/clean.py":376
+    /* "lxml/html/clean.py":381
  *         _remove = []
  *         _kill = []
  *         for el in doc.iter():             # <<<<<<<<<<<<<<
@@ -5550,9 +5550,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     __pyx_L71_continue:;
   }
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 
-  /* "lxml/html/clean.py":386
+  /* "lxml/html/clean.py":391
  *                 _remove.append(el)
  * 
  *         if _remove and _remove[0] == doc:             # <<<<<<<<<<<<<<
@@ -5565,67 +5565,67 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_10 = __pyx_t_11;
     goto __pyx_L77_bool_binop_done;
   }
-  __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v__remove, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
+  __pyx_t_17 = __Pyx_GetItemInt_List(__pyx_v__remove, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_17);
+  __pyx_t_5 = PyObject_RichCompare(__pyx_t_17, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 391, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_10 = __pyx_t_11;
   __pyx_L77_bool_binop_done:;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":389
+    /* "lxml/html/clean.py":394
  *             # We have to drop the parent-most tag, which we can't
  *             # do.  Instead we'll rewrite it:
  *             el = _remove.pop(0)             # <<<<<<<<<<<<<<
  *             el.tag = 'div'
  *             el.attrib.clear()
  */
-    __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v__remove, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 389, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v__remove, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":390
+    /* "lxml/html/clean.py":395
  *             # do.  Instead we'll rewrite it:
  *             el = _remove.pop(0)
  *             el.tag = 'div'             # <<<<<<<<<<<<<<
  *             el.attrib.clear()
  *         elif _kill and _kill[0] == doc:
  */
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 395, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":391
+    /* "lxml/html/clean.py":396
  *             el = _remove.pop(0)
  *             el.tag = 'div'
  *             el.attrib.clear()             # <<<<<<<<<<<<<<
  *         elif _kill and _kill[0] == doc:
  *             # We have to drop the parent-most element, which we can't
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error)
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 396, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s_clear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 396, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 391, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_13);
-      if (likely(__pyx_t_6)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
-        __Pyx_INCREF(__pyx_t_6);
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+    __pyx_t_17 = NULL;
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_6);
+      if (likely(__pyx_t_17)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_17);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_13, function);
+        __Pyx_DECREF_SET(__pyx_t_6, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
+    __pyx_t_5 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 396, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":386
+    /* "lxml/html/clean.py":391
  *                 _remove.append(el)
  * 
  *         if _remove and _remove[0] == doc:             # <<<<<<<<<<<<<<
@@ -5635,7 +5635,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     goto __pyx_L76;
   }
 
-  /* "lxml/html/clean.py":392
+  /* "lxml/html/clean.py":397
  *             el.tag = 'div'
  *             el.attrib.clear()
  *         elif _kill and _kill[0] == doc:             # <<<<<<<<<<<<<<
@@ -5648,51 +5648,51 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_10 = __pyx_t_11;
     goto __pyx_L79_bool_binop_done;
   }
-  __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v__kill, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v__kill, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_13 = PyObject_RichCompare(__pyx_t_5, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 392, __pyx_L1_error)
+  __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_v_doc, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 397, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 397, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_10 = __pyx_t_11;
   __pyx_L79_bool_binop_done:;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":395
+    /* "lxml/html/clean.py":400
  *             # We have to drop the parent-most element, which we can't
  *             # do.  Instead we'll clear it:
  *             el = _kill.pop(0)             # <<<<<<<<<<<<<<
  *             if el.tag != 'html':
  *                 el.tag = 'div'
  */
-    __pyx_t_13 = __Pyx_PyList_PopIndex(__pyx_v__kill, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 395, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_13);
-    __pyx_t_13 = 0;
+    __pyx_t_6 = __Pyx_PyList_PopIndex(__pyx_v__kill, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
+    __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":396
+    /* "lxml/html/clean.py":401
  *             # do.  Instead we'll clear it:
  *             el = _kill.pop(0)
  *             if el.tag != 'html':             # <<<<<<<<<<<<<<
  *                 el.tag = 'div'
  *             el.clear()
  */
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 396, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_13, __pyx_n_s_html, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 396, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_10 = (__Pyx_PyString_Equals(__pyx_t_6, __pyx_n_s_html, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (__pyx_t_10) {
 
-      /* "lxml/html/clean.py":397
+      /* "lxml/html/clean.py":402
  *             el = _kill.pop(0)
  *             if el.tag != 'html':
  *                 el.tag = 'div'             # <<<<<<<<<<<<<<
  *             el.clear()
  * 
  */
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":396
+      /* "lxml/html/clean.py":401
  *             # do.  Instead we'll clear it:
  *             el = _kill.pop(0)
  *             if el.tag != 'html':             # <<<<<<<<<<<<<<
@@ -5701,33 +5701,33 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":398
+    /* "lxml/html/clean.py":403
  *             if el.tag != 'html':
  *                 el.tag = 'div'
  *             el.clear()             # <<<<<<<<<<<<<<
  * 
  *         _kill.reverse() # start with innermost tags
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_clear); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = NULL;
+    __pyx_t_17 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
-      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
-      if (likely(__pyx_t_6)) {
+      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_17)) {
         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_17);
         __Pyx_INCREF(function);
         __Pyx_DECREF_SET(__pyx_t_5, function);
       }
     }
-    __pyx_t_13 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 398, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":392
+    /* "lxml/html/clean.py":397
  *             el.tag = 'div'
  *             el.attrib.clear()
  *         elif _kill and _kill[0] == doc:             # <<<<<<<<<<<<<<
@@ -5737,61 +5737,61 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __pyx_L76:;
 
-  /* "lxml/html/clean.py":400
+  /* "lxml/html/clean.py":405
  *             el.clear()
  * 
  *         _kill.reverse() # start with innermost tags             # <<<<<<<<<<<<<<
  *         for el in _kill:
  *             el.drop_tree()
  */
-  __pyx_t_12 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 400, __pyx_L1_error)
+  __pyx_t_12 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 405, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":401
+  /* "lxml/html/clean.py":406
  * 
  *         _kill.reverse() # start with innermost tags
  *         for el in _kill:             # <<<<<<<<<<<<<<
  *             el.drop_tree()
  *         for el in _remove:
  */
-  __pyx_t_13 = __pyx_v__kill; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
+  __pyx_t_6 = __pyx_v__kill; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
   for (;;) {
-    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
+    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
     #else
-    __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 406, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":402
+    /* "lxml/html/clean.py":407
  *         _kill.reverse() # start with innermost tags
  *         for el in _kill:
  *             el.drop_tree()             # <<<<<<<<<<<<<<
  *         for el in _remove:
  *             el.drop_tag()
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 407, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __pyx_t_4 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
       if (likely(__pyx_t_4)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
         __Pyx_INCREF(__pyx_t_4);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 407, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":401
+    /* "lxml/html/clean.py":406
  * 
  *         _kill.reverse() # start with innermost tags
  *         for el in _kill:             # <<<<<<<<<<<<<<
@@ -5799,54 +5799,54 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *         for el in _remove:
  */
   }
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/html/clean.py":403
+  /* "lxml/html/clean.py":408
  *         for el in _kill:
  *             el.drop_tree()
  *         for el in _remove:             # <<<<<<<<<<<<<<
  *             el.drop_tag()
  * 
  */
-  __pyx_t_13 = __pyx_v__remove; __Pyx_INCREF(__pyx_t_13); __pyx_t_8 = 0;
+  __pyx_t_6 = __pyx_v__remove; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
   for (;;) {
-    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_13)) break;
+    if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_13, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 403, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 408, __pyx_L1_error)
     #else
-    __pyx_t_5 = PySequence_ITEM(__pyx_t_13, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 403, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":404
+    /* "lxml/html/clean.py":409
  *             el.drop_tree()
  *         for el in _remove:
  *             el.drop_tag()             # <<<<<<<<<<<<<<
  * 
  *         if self.remove_unknown_tags:
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 409, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
     __pyx_t_4 = NULL;
-    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
+    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_17);
       if (likely(__pyx_t_4)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
         __Pyx_INCREF(__pyx_t_4);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
+    __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 409, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":403
+    /* "lxml/html/clean.py":408
  *         for el in _kill:
  *             el.drop_tree()
  *         for el in _remove:             # <<<<<<<<<<<<<<
@@ -5854,22 +5854,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  * 
  */
   }
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/html/clean.py":406
+  /* "lxml/html/clean.py":411
  *             el.drop_tag()
  * 
  *         if self.remove_unknown_tags:             # <<<<<<<<<<<<<<
  *             if allow_tags:
  *                 raise ValueError(
  */
-  __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 406, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_13);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 406, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_remove_unknown_tags); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 411, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_6);
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 411, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":407
+    /* "lxml/html/clean.py":412
  * 
  *         if self.remove_unknown_tags:
  *             if allow_tags:             # <<<<<<<<<<<<<<
@@ -5879,20 +5879,20 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_10 = (PySet_GET_SIZE(__pyx_v_allow_tags) != 0);
     if (unlikely(__pyx_t_10)) {
 
-      /* "lxml/html/clean.py":408
+      /* "lxml/html/clean.py":413
  *         if self.remove_unknown_tags:
  *             if allow_tags:
  *                 raise ValueError(             # <<<<<<<<<<<<<<
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)
  */
-      __pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 408, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __Pyx_Raise(__pyx_t_13, 0, 0, 0);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __PYX_ERR(0, 408, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 413, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __PYX_ERR(0, 413, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":407
+      /* "lxml/html/clean.py":412
  * 
  *         if self.remove_unknown_tags:
  *             if allow_tags:             # <<<<<<<<<<<<<<
@@ -5901,25 +5901,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":410
+    /* "lxml/html/clean.py":415
  *                 raise ValueError(
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)             # <<<<<<<<<<<<<<
  *         if allow_tags:
  *             # make sure we do not remove comments/PIs if users want them (which is rare enough)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_defs); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 410, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_defs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-    __pyx_t_13 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 410, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __pyx_t_6 = PySet_New(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 415, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __Pyx_DECREF_SET(__pyx_v_allow_tags, ((PyObject*)__pyx_t_13));
-    __pyx_t_13 = 0;
+    __Pyx_DECREF_SET(__pyx_v_allow_tags, ((PyObject*)__pyx_t_6));
+    __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":406
+    /* "lxml/html/clean.py":411
  *             el.drop_tag()
  * 
  *         if self.remove_unknown_tags:             # <<<<<<<<<<<<<<
@@ -5928,7 +5928,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":411
+  /* "lxml/html/clean.py":416
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)
  *         if allow_tags:             # <<<<<<<<<<<<<<
@@ -5938,36 +5938,36 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   __pyx_t_10 = (PySet_GET_SIZE(__pyx_v_allow_tags) != 0);
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":413
+    /* "lxml/html/clean.py":418
  *         if allow_tags:
  *             # make sure we do not remove comments/PIs if users want them (which is rare enough)
  *             if not self.comments:             # <<<<<<<<<<<<<<
  *                 allow_tags.add(etree.Comment)
  *             if not self.processing_instructions:
  */
-    __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 413, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 413, __pyx_L1_error)
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_comments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 418, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 418, __pyx_L1_error)
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_11 = ((!__pyx_t_10) != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":414
+      /* "lxml/html/clean.py":419
  *             # make sure we do not remove comments/PIs if users want them (which is rare enough)
  *             if not self.comments:
  *                 allow_tags.add(etree.Comment)             # <<<<<<<<<<<<<<
  *             if not self.processing_instructions:
  *                 allow_tags.add(etree.ProcessingInstruction)
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_etree); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 414, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 414, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_etree); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 419, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 414, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_5); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 419, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":413
+      /* "lxml/html/clean.py":418
  *         if allow_tags:
  *             # make sure we do not remove comments/PIs if users want them (which is rare enough)
  *             if not self.comments:             # <<<<<<<<<<<<<<
@@ -5976,36 +5976,36 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":415
+    /* "lxml/html/clean.py":420
  *             if not self.comments:
  *                 allow_tags.add(etree.Comment)
  *             if not self.processing_instructions:             # <<<<<<<<<<<<<<
  *                 allow_tags.add(etree.ProcessingInstruction)
  * 
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 415, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_processing_instructions); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 415, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_10 = ((!__pyx_t_11) != 0);
     if (__pyx_t_10) {
 
-      /* "lxml/html/clean.py":416
+      /* "lxml/html/clean.py":421
  *                 allow_tags.add(etree.Comment)
  *             if not self.processing_instructions:
  *                 allow_tags.add(etree.ProcessingInstruction)             # <<<<<<<<<<<<<<
  * 
  *             bad = []
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 421, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 416, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 421, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_13); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 416, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_12 = PySet_Add(__pyx_v_allow_tags, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 421, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":415
+      /* "lxml/html/clean.py":420
  *             if not self.comments:
  *                 allow_tags.add(etree.Comment)
  *             if not self.processing_instructions:             # <<<<<<<<<<<<<<
@@ -6014,109 +6014,109 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":418
+    /* "lxml/html/clean.py":423
  *                 allow_tags.add(etree.ProcessingInstruction)
  * 
  *             bad = []             # <<<<<<<<<<<<<<
  *             for el in doc.iter():
  *                 if el.tag not in allow_tags:
  */
-    __pyx_t_13 = PyList_New(0); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 418, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
-    __pyx_v_bad = ((PyObject*)__pyx_t_13);
-    __pyx_t_13 = 0;
+    __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
+    __pyx_v_bad = ((PyObject*)__pyx_t_6);
+    __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":419
+    /* "lxml/html/clean.py":424
  * 
  *             bad = []
  *             for el in doc.iter():             # <<<<<<<<<<<<<<
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = NULL;
+    __pyx_t_17 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
-      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
-      if (likely(__pyx_t_6)) {
+      __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_5);
+      if (likely(__pyx_t_17)) {
         PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
-        __Pyx_INCREF(__pyx_t_6);
+        __Pyx_INCREF(__pyx_t_17);
         __Pyx_INCREF(function);
         __Pyx_DECREF_SET(__pyx_t_5, function);
       }
     }
-    __pyx_t_13 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
-    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_13);
+    __pyx_t_6 = (__pyx_t_17) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_17) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
+    __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
-      __pyx_t_5 = __pyx_t_13; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
+    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
+      __pyx_t_5 = __pyx_t_6; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 424, __pyx_L1_error)
     }
-    __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     for (;;) {
       if (likely(!__pyx_t_9)) {
         if (likely(PyList_CheckExact(__pyx_t_5))) {
           if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_13 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
+          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
           #else
-          __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_13);
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
+          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
           #else
-          __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_13);
+          __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 424, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_6);
           #endif
         }
       } else {
-        __pyx_t_13 = __pyx_t_9(__pyx_t_5);
-        if (unlikely(!__pyx_t_13)) {
+        __pyx_t_6 = __pyx_t_9(__pyx_t_5);
+        if (unlikely(!__pyx_t_6)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 419, __pyx_L1_error)
+            else __PYX_ERR(0, 424, __pyx_L1_error)
           }
           break;
         }
-        __Pyx_GOTREF(__pyx_t_13);
+        __Pyx_GOTREF(__pyx_t_6);
       }
-      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_13);
-      __pyx_t_13 = 0;
+      __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
+      __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":420
+      /* "lxml/html/clean.py":425
  *             bad = []
  *             for el in doc.iter():
  *                 if el.tag not in allow_tags:             # <<<<<<<<<<<<<<
  *                     bad.append(el)
  *             if bad:
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
-      __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_13, __pyx_v_allow_tags, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 425, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
+      __pyx_t_10 = (__Pyx_PySet_ContainsTF(__pyx_t_6, __pyx_v_allow_tags, Py_NE)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 425, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_11 = (__pyx_t_10 != 0);
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":421
+        /* "lxml/html/clean.py":426
  *             for el in doc.iter():
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)             # <<<<<<<<<<<<<<
  *             if bad:
  *                 if bad[0] is doc:
  */
-        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 421, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 426, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":420
+        /* "lxml/html/clean.py":425
  *             bad = []
  *             for el in doc.iter():
  *                 if el.tag not in allow_tags:             # <<<<<<<<<<<<<<
@@ -6125,7 +6125,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":419
+      /* "lxml/html/clean.py":424
  * 
  *             bad = []
  *             for el in doc.iter():             # <<<<<<<<<<<<<<
@@ -6135,7 +6135,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":422
+    /* "lxml/html/clean.py":427
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)
  *             if bad:             # <<<<<<<<<<<<<<
@@ -6145,71 +6145,71 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     __pyx_t_11 = (PyList_GET_SIZE(__pyx_v_bad) != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":423
+      /* "lxml/html/clean.py":428
  *                     bad.append(el)
  *             if bad:
  *                 if bad[0] is doc:             # <<<<<<<<<<<<<<
  *                     el = bad.pop(0)
  *                     el.tag = 'div'
  */
-      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_bad, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 423, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_bad, 0, long, 1, __Pyx_PyInt_From_long, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 428, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_11 = (__pyx_t_5 == __pyx_v_doc);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_10 = (__pyx_t_11 != 0);
       if (__pyx_t_10) {
 
-        /* "lxml/html/clean.py":424
+        /* "lxml/html/clean.py":429
  *             if bad:
  *                 if bad[0] is doc:
  *                     el = bad.pop(0)             # <<<<<<<<<<<<<<
  *                     el.tag = 'div'
  *                     el.attrib.clear()
  */
-        __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v_bad, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyList_PopIndex(__pyx_v_bad, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":425
+        /* "lxml/html/clean.py":430
  *                 if bad[0] is doc:
  *                     el = bad.pop(0)
  *                     el.tag = 'div'             # <<<<<<<<<<<<<<
  *                     el.attrib.clear()
  *                 for el in bad:
  */
-        if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 430, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":426
+        /* "lxml/html/clean.py":431
  *                     el = bad.pop(0)
  *                     el.tag = 'div'
  *                     el.attrib.clear()             # <<<<<<<<<<<<<<
  *                 for el in bad:
  *                     el.drop_tag()
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 426, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_clear); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 426, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_attrib); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-        __pyx_t_13 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
-          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-          if (likely(__pyx_t_13)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-            __Pyx_INCREF(__pyx_t_13);
+        __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_clear); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 431, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __pyx_t_6 = NULL;
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_17))) {
+          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+          if (likely(__pyx_t_6)) {
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+            __Pyx_INCREF(__pyx_t_6);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_6, function);
+            __Pyx_DECREF_SET(__pyx_t_17, function);
           }
         }
-        __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
-        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
+        __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_17);
+        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":423
+        /* "lxml/html/clean.py":428
  *                     bad.append(el)
  *             if bad:
  *                 if bad[0] is doc:             # <<<<<<<<<<<<<<
@@ -6218,7 +6218,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":427
+      /* "lxml/html/clean.py":432
  *                     el.tag = 'div'
  *                     el.attrib.clear()
  *                 for el in bad:             # <<<<<<<<<<<<<<
@@ -6229,41 +6229,41 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       for (;;) {
         if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
+        __pyx_t_17 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_17); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
         #else
-        __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
+        __pyx_t_17 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 432, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         #endif
-        __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
-        __pyx_t_6 = 0;
+        __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_17);
+        __pyx_t_17 = 0;
 
-        /* "lxml/html/clean.py":428
+        /* "lxml/html/clean.py":433
  *                     el.attrib.clear()
  *                 for el in bad:
  *                     el.drop_tag()             # <<<<<<<<<<<<<<
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 428, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 433, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
+        __pyx_t_17 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 428, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_6);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 433, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_17);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+        __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 
-        /* "lxml/html/clean.py":427
+        /* "lxml/html/clean.py":432
  *                     el.tag = 'div'
  *                     el.attrib.clear()
  *                 for el in bad:             # <<<<<<<<<<<<<<
@@ -6273,7 +6273,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":422
+      /* "lxml/html/clean.py":427
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)
  *             if bad:             # <<<<<<<<<<<<<<
@@ -6282,7 +6282,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":411
+    /* "lxml/html/clean.py":416
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)
  *         if allow_tags:             # <<<<<<<<<<<<<<
@@ -6291,78 +6291,78 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":429
+  /* "lxml/html/clean.py":434
  *                 for el in bad:
  *                     el.drop_tag()
  *         if self.add_nofollow:             # <<<<<<<<<<<<<<
  *             for el in _find_external_links(doc):
  *                 if not self.allow_follow(el):
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_nofollow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 429, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_add_nofollow); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 434, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":430
+    /* "lxml/html/clean.py":435
  *                     el.drop_tag()
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):             # <<<<<<<<<<<<<<
  *                 if not self.allow_follow(el):
  *                     rel = el.get('rel')
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_find_external_links); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_13 = NULL;
-    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
-      __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_6);
-      if (likely(__pyx_t_13)) {
-        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
-        __Pyx_INCREF(__pyx_t_13);
+    __Pyx_GetModuleGlobalName(__pyx_t_17, __pyx_n_s_find_external_links); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 435, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_17);
+    __pyx_t_6 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_17))) {
+      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_17);
+      if (likely(__pyx_t_6)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_17);
+        __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(function);
-        __Pyx_DECREF_SET(__pyx_t_6, function);
+        __Pyx_DECREF_SET(__pyx_t_17, function);
       }
     }
-    __pyx_t_5 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_13, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_doc);
-    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+    __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_17, __pyx_t_6, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_17, __pyx_v_doc);
+    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
     if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
-      __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
+      __pyx_t_17 = __pyx_t_5; __Pyx_INCREF(__pyx_t_17); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_17 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 435, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_17);
+      __pyx_t_9 = Py_TYPE(__pyx_t_17)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 435, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     for (;;) {
       if (likely(!__pyx_t_9)) {
-        if (likely(PyList_CheckExact(__pyx_t_6))) {
-          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
+        if (likely(PyList_CheckExact(__pyx_t_17))) {
+          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_17)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
+          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
           #else
-          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         } else {
-          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_17)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
+          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_17, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
           #else
-          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
+          __pyx_t_5 = PySequence_ITEM(__pyx_t_17, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         }
       } else {
-        __pyx_t_5 = __pyx_t_9(__pyx_t_6);
+        __pyx_t_5 = __pyx_t_9(__pyx_t_17);
         if (unlikely(!__pyx_t_5)) {
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 430, __pyx_L1_error)
+            else __PYX_ERR(0, 435, __pyx_L1_error)
           }
           break;
         }
@@ -6371,80 +6371,80 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":431
+      /* "lxml/html/clean.py":436
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):
  *                 if not self.allow_follow(el):             # <<<<<<<<<<<<<<
  *                     rel = el.get('rel')
  *                     if rel:
  */
-      __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_follow); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 431, __pyx_L1_error)
-      __Pyx_GOTREF(__pyx_t_13);
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_follow); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
+      __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_4 = NULL;
-      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
         if (likely(__pyx_t_4)) {
-          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_4);
           __Pyx_INCREF(function);
-          __Pyx_DECREF_SET(__pyx_t_13, function);
+          __Pyx_DECREF_SET(__pyx_t_6, function);
         }
       }
-      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
+      __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_el);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
-      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
+      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 436, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_11 = ((!__pyx_t_10) != 0);
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":432
+        /* "lxml/html/clean.py":437
  *             for el in _find_external_links(doc):
  *                 if not self.allow_follow(el):
  *                     rel = el.get('rel')             # <<<<<<<<<<<<<<
  *                     if rel:
  *                         if ('nofollow' in rel
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 432, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
           }
         }
-        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_13, __pyx_t_4, __pyx_n_s_rel) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_n_s_rel);
+        __pyx_t_5 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_n_s_rel) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_rel);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF_SET(__pyx_v_rel, __pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":433
+        /* "lxml/html/clean.py":438
  *                 if not self.allow_follow(el):
  *                     rel = el.get('rel')
  *                     if rel:             # <<<<<<<<<<<<<<
  *                         if ('nofollow' in rel
  *                                 and ' nofollow ' in (' %s ' % rel)):
  */
-        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 438, __pyx_L1_error)
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":434
+          /* "lxml/html/clean.py":439
  *                     rel = el.get('rel')
  *                     if rel:
  *                         if ('nofollow' in rel             # <<<<<<<<<<<<<<
  *                                 and ' nofollow ' in (' %s ' % rel)):
  *                             continue
  */
-          __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 434, __pyx_L1_error)
+          __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_n_s_nofollow, __pyx_v_rel, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 439, __pyx_L1_error)
           __pyx_t_18 = (__pyx_t_10 != 0);
           if (__pyx_t_18) {
           } else {
@@ -6452,22 +6452,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
             goto __pyx_L104_bool_binop_done;
           }
 
-          /* "lxml/html/clean.py":435
+          /* "lxml/html/clean.py":440
  *                     if rel:
  *                         if ('nofollow' in rel
  *                                 and ' nofollow ' in (' %s ' % rel)):             # <<<<<<<<<<<<<<
  *                             continue
  *                         rel = '%s nofollow' % rel
  */
-          __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
-          __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_nofollow_2, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 435, __pyx_L1_error)
+          __pyx_t_18 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_nofollow_2, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_18 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __pyx_t_10 = (__pyx_t_18 != 0);
           __pyx_t_11 = __pyx_t_10;
           __pyx_L104_bool_binop_done:;
 
-          /* "lxml/html/clean.py":434
+          /* "lxml/html/clean.py":439
  *                     rel = el.get('rel')
  *                     if rel:
  *                         if ('nofollow' in rel             # <<<<<<<<<<<<<<
@@ -6476,7 +6476,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
           if (__pyx_t_11) {
 
-            /* "lxml/html/clean.py":436
+            /* "lxml/html/clean.py":441
  *                         if ('nofollow' in rel
  *                                 and ' nofollow ' in (' %s ' % rel)):
  *                             continue             # <<<<<<<<<<<<<<
@@ -6485,7 +6485,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
             goto __pyx_L99_continue;
 
-            /* "lxml/html/clean.py":434
+            /* "lxml/html/clean.py":439
  *                     rel = el.get('rel')
  *                     if rel:
  *                         if ('nofollow' in rel             # <<<<<<<<<<<<<<
@@ -6494,19 +6494,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
           }
 
-          /* "lxml/html/clean.py":437
+          /* "lxml/html/clean.py":442
  *                                 and ' nofollow ' in (' %s ' % rel)):
  *                             continue
  *                         rel = '%s nofollow' % rel             # <<<<<<<<<<<<<<
  *                     else:
  *                         rel = 'nofollow'
  */
-          __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_nofollow, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 437, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_nofollow, __pyx_v_rel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 442, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF_SET(__pyx_v_rel, __pyx_t_5);
           __pyx_t_5 = 0;
 
-          /* "lxml/html/clean.py":433
+          /* "lxml/html/clean.py":438
  *                 if not self.allow_follow(el):
  *                     rel = el.get('rel')
  *                     if rel:             # <<<<<<<<<<<<<<
@@ -6516,7 +6516,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           goto __pyx_L102;
         }
 
-        /* "lxml/html/clean.py":439
+        /* "lxml/html/clean.py":444
  *                         rel = '%s nofollow' % rel
  *                     else:
  *                         rel = 'nofollow'             # <<<<<<<<<<<<<<
@@ -6529,63 +6529,63 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_L102:;
 
-        /* "lxml/html/clean.py":440
+        /* "lxml/html/clean.py":445
  *                     else:
  *                         rel = 'nofollow'
  *                     el.set('rel', rel)             # <<<<<<<<<<<<<<
  * 
  *     def allow_follow(self, anchor):
  */
-        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 440, __pyx_L1_error)
-        __Pyx_GOTREF(__pyx_t_13);
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_set); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 445, __pyx_L1_error)
+        __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_4 = NULL;
         __pyx_t_7 = 0;
-        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
-          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_13);
+        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
           if (likely(__pyx_t_4)) {
-            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
+            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
             __Pyx_INCREF(__pyx_t_4);
             __Pyx_INCREF(function);
-            __Pyx_DECREF_SET(__pyx_t_13, function);
+            __Pyx_DECREF_SET(__pyx_t_6, function);
             __pyx_t_7 = 1;
           }
         }
         #if CYTHON_FAST_PYCALL
-        if (PyFunction_Check(__pyx_t_13)) {
+        if (PyFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_rel, __pyx_v_rel};
-          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_5);
         } else
         #endif
         #if CYTHON_FAST_PYCCALL
-        if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
+        if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_n_s_rel, __pyx_v_rel};
-          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_13, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
           __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_5);
         } else
         #endif
         {
-          __pyx_t_17 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 440, __pyx_L1_error)
-          __Pyx_GOTREF(__pyx_t_17);
+          __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 445, __pyx_L1_error)
+          __Pyx_GOTREF(__pyx_t_13);
           if (__pyx_t_4) {
-            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __pyx_t_4 = NULL;
+            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
           }
           __Pyx_INCREF(__pyx_n_s_rel);
           __Pyx_GIVEREF(__pyx_n_s_rel);
-          PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_7, __pyx_n_s_rel);
+          PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_n_s_rel);
           __Pyx_INCREF(__pyx_v_rel);
           __Pyx_GIVEREF(__pyx_v_rel);
-          PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_7, __pyx_v_rel);
-          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_13, __pyx_t_17, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 440, __pyx_L1_error)
+          PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_rel);
+          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 445, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
-          __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
+          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         }
-        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":431
+        /* "lxml/html/clean.py":436
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):
  *                 if not self.allow_follow(el):             # <<<<<<<<<<<<<<
@@ -6594,7 +6594,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":430
+      /* "lxml/html/clean.py":435
  *                     el.drop_tag()
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):             # <<<<<<<<<<<<<<
@@ -6603,9 +6603,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       __pyx_L99_continue:;
     }
-    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
 
-    /* "lxml/html/clean.py":429
+    /* "lxml/html/clean.py":434
  *                 for el in bad:
  *                     el.drop_tag()
  *         if self.add_nofollow:             # <<<<<<<<<<<<<<
@@ -6614,7 +6614,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":257
+  /* "lxml/html/clean.py":262
  *         )
  * 
  *     def __call__(self, doc):             # <<<<<<<<<<<<<<
@@ -6655,7 +6655,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":442
+/* "lxml/html/clean.py":447
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
@@ -6699,11 +6699,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_5allow_follow(PyObject *__
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_anchor)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, 1); __PYX_ERR(0, 442, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, 1); __PYX_ERR(0, 447, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_follow") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_follow") < 0)) __PYX_ERR(0, 447, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -6716,7 +6716,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_5allow_follow(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 447, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_follow", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -6734,7 +6734,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_4allow_follow(CYTHON_UNUSE
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("allow_follow", 0);
 
-  /* "lxml/html/clean.py":446
+  /* "lxml/html/clean.py":451
  *         Override to suppress rel="nofollow" on some anchors.
  *         """
  *         return False             # <<<<<<<<<<<<<<
@@ -6746,7 +6746,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_4allow_follow(CYTHON_UNUSE
   __pyx_r = Py_False;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":442
+  /* "lxml/html/clean.py":447
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
@@ -6761,7 +6761,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_4allow_follow(CYTHON_UNUSE
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":448
+/* "lxml/html/clean.py":453
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
@@ -6805,11 +6805,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_7allow_element(PyObject *_
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, 1); __PYX_ERR(0, 448, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, 1); __PYX_ERR(0, 453, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_element") < 0)) __PYX_ERR(0, 448, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_element") < 0)) __PYX_ERR(0, 453, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -6822,7 +6822,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_7allow_element(PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 448, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 453, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -6857,24 +6857,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("allow_element", 0);
 
-  /* "lxml/html/clean.py":455
+  /* "lxml/html/clean.py":460
  *         :return: true to accept the element or false to reject/discard it.
  *         """
  *         if el.tag not in self._tag_link_attrs:             # <<<<<<<<<<<<<<
  *             return False
  *         attr = self._tag_link_attrs[el.tag]
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 455, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 460, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/html/clean.py":456
+    /* "lxml/html/clean.py":461
  *         """
  *         if el.tag not in self._tag_link_attrs:
  *             return False             # <<<<<<<<<<<<<<
@@ -6886,7 +6886,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     __pyx_r = Py_False;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":455
+    /* "lxml/html/clean.py":460
  *         :return: true to accept the element or false to reject/discard it.
  *         """
  *         if el.tag not in self._tag_link_attrs:             # <<<<<<<<<<<<<<
@@ -6895,25 +6895,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
   }
 
-  /* "lxml/html/clean.py":457
+  /* "lxml/html/clean.py":462
  *         if el.tag not in self._tag_link_attrs:
  *             return False
  *         attr = self._tag_link_attrs[el.tag]             # <<<<<<<<<<<<<<
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tag_link_attrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 462, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_attr = __pyx_t_5;
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":458
+  /* "lxml/html/clean.py":463
  *             return False
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):             # <<<<<<<<<<<<<<
@@ -6934,7 +6934,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
   __pyx_t_3 = (__pyx_t_4 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":459
+    /* "lxml/html/clean.py":464
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:             # <<<<<<<<<<<<<<
@@ -6945,26 +6945,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       __pyx_t_5 = __pyx_v_attr; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
+      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_attr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 464, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 464, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_5))) {
           if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
+          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         } else {
           if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
+          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 464, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -6974,7 +6974,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 459, __pyx_L1_error)
+            else __PYX_ERR(0, 464, __pyx_L1_error)
           }
           break;
         }
@@ -6983,14 +6983,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       __Pyx_XDECREF_SET(__pyx_v_one_attr, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":460
+      /* "lxml/html/clean.py":465
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:
  *                 url = el.get(one_attr)             # <<<<<<<<<<<<<<
  *                 if not url:
  *                     return False
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_9 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -7004,24 +7004,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       }
       __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_9, __pyx_v_one_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_one_attr);
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF_SET(__pyx_v_url, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":461
+      /* "lxml/html/clean.py":466
  *             for one_attr in attr:
  *                 url = el.get(one_attr)
  *                 if not url:             # <<<<<<<<<<<<<<
  *                     return False
  *                 if not self.allow_embedded_url(el, url):
  */
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
       __pyx_t_4 = ((!__pyx_t_3) != 0);
       if (__pyx_t_4) {
 
-        /* "lxml/html/clean.py":462
+        /* "lxml/html/clean.py":467
  *                 url = el.get(one_attr)
  *                 if not url:
  *                     return False             # <<<<<<<<<<<<<<
@@ -7034,7 +7034,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         goto __pyx_L0;
 
-        /* "lxml/html/clean.py":461
+        /* "lxml/html/clean.py":466
  *             for one_attr in attr:
  *                 url = el.get(one_attr)
  *                 if not url:             # <<<<<<<<<<<<<<
@@ -7043,14 +7043,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
       }
 
-      /* "lxml/html/clean.py":463
+      /* "lxml/html/clean.py":468
  *                 if not url:
  *                     return False
  *                 if not self.allow_embedded_url(el, url):             # <<<<<<<<<<<<<<
  *                     return False
  *             return True
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 468, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_9 = NULL;
       __pyx_t_10 = 0;
@@ -7067,7 +7067,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_el, __pyx_v_url};
-        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
@@ -7075,13 +7075,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_v_el, __pyx_v_url};
-        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
       #endif
       {
-        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 463, __pyx_L1_error)
+        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 468, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         if (__pyx_t_9) {
           __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -7092,17 +7092,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
         __Pyx_INCREF(__pyx_v_url);
         __Pyx_GIVEREF(__pyx_v_url);
         PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_url);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 468, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       }
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 463, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_3 = ((!__pyx_t_4) != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/html/clean.py":464
+        /* "lxml/html/clean.py":469
  *                     return False
  *                 if not self.allow_embedded_url(el, url):
  *                     return False             # <<<<<<<<<<<<<<
@@ -7115,7 +7115,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         goto __pyx_L0;
 
-        /* "lxml/html/clean.py":463
+        /* "lxml/html/clean.py":468
  *                 if not url:
  *                     return False
  *                 if not self.allow_embedded_url(el, url):             # <<<<<<<<<<<<<<
@@ -7124,7 +7124,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
       }
 
-      /* "lxml/html/clean.py":459
+      /* "lxml/html/clean.py":464
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:             # <<<<<<<<<<<<<<
@@ -7134,7 +7134,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":465
+    /* "lxml/html/clean.py":470
  *                 if not self.allow_embedded_url(el, url):
  *                     return False
  *             return True             # <<<<<<<<<<<<<<
@@ -7146,7 +7146,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":458
+    /* "lxml/html/clean.py":463
  *             return False
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):             # <<<<<<<<<<<<<<
@@ -7155,7 +7155,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
   }
 
-  /* "lxml/html/clean.py":467
+  /* "lxml/html/clean.py":472
  *             return True
  *         else:
  *             url = el.get(attr)             # <<<<<<<<<<<<<<
@@ -7163,7 +7163,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  *                 return False
  */
   /*else*/ {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 472, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_2 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -7177,24 +7177,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     }
     __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_2, __pyx_v_attr) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_attr);
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_v_url = __pyx_t_5;
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":468
+    /* "lxml/html/clean.py":473
  *         else:
  *             url = el.get(attr)
  *             if not url:             # <<<<<<<<<<<<<<
  *                 return False
  *             return self.allow_embedded_url(el, url)
  */
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 473, __pyx_L1_error)
     __pyx_t_4 = ((!__pyx_t_3) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/html/clean.py":469
+      /* "lxml/html/clean.py":474
  *             url = el.get(attr)
  *             if not url:
  *                 return False             # <<<<<<<<<<<<<<
@@ -7206,7 +7206,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       __pyx_r = Py_False;
       goto __pyx_L0;
 
-      /* "lxml/html/clean.py":468
+      /* "lxml/html/clean.py":473
  *         else:
  *             url = el.get(attr)
  *             if not url:             # <<<<<<<<<<<<<<
@@ -7215,7 +7215,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
     }
 
-    /* "lxml/html/clean.py":470
+    /* "lxml/html/clean.py":475
  *             if not url:
  *                 return False
  *             return self.allow_embedded_url(el, url)             # <<<<<<<<<<<<<<
@@ -7223,7 +7223,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  *     def allow_embedded_url(self, el, url):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_allow_embedded_url); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_2 = NULL;
     __pyx_t_10 = 0;
@@ -7240,7 +7240,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_el, __pyx_v_url};
-      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else
@@ -7248,13 +7248,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_el, __pyx_v_url};
-      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_10, 2+__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else
     #endif
     {
-      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 475, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       if (__pyx_t_2) {
         __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -7265,7 +7265,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
       __Pyx_INCREF(__pyx_v_url);
       __Pyx_GIVEREF(__pyx_v_url);
       PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_url);
-      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 470, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 475, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
     }
@@ -7275,7 +7275,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     goto __pyx_L0;
   }
 
-  /* "lxml/html/clean.py":448
+  /* "lxml/html/clean.py":453
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
@@ -7301,7 +7301,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":472
+/* "lxml/html/clean.py":477
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
@@ -7348,17 +7348,17 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_9allow_embedded_url(PyObje
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_el)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 1); __PYX_ERR(0, 472, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 1); __PYX_ERR(0, 477, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_url)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 2); __PYX_ERR(0, 472, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 2); __PYX_ERR(0, 477, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_embedded_url") < 0)) __PYX_ERR(0, 472, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_embedded_url") < 0)) __PYX_ERR(0, 477, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -7373,7 +7373,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_9allow_embedded_url(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 477, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_embedded_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -7410,14 +7410,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("allow_embedded_url", 0);
 
-  /* "lxml/html/clean.py":481
+  /* "lxml/html/clean.py":486
  *         :return: true to accept the URL and false to reject it.
  *         """
  *         if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:             # <<<<<<<<<<<<<<
  *             return False
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = (__pyx_t_2 != Py_None);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -7427,11 +7427,11 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     __pyx_t_1 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_whitelist_tags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 481, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_t_2, __pyx_t_5, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_t_3 = (__pyx_t_4 != 0);
@@ -7439,7 +7439,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "lxml/html/clean.py":482
+    /* "lxml/html/clean.py":487
  *         """
  *         if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:
  *             return False             # <<<<<<<<<<<<<<
@@ -7451,7 +7451,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     __pyx_r = Py_False;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":481
+    /* "lxml/html/clean.py":486
  *         :return: true to accept the URL and false to reject it.
  *         """
  *         if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:             # <<<<<<<<<<<<<<
@@ -7460,14 +7460,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":483
+  /* "lxml/html/clean.py":488
  *         if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:
  *             return False
  *         scheme, netloc, path, query, fragment = urlsplit(url)             # <<<<<<<<<<<<<<
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_6 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -7481,7 +7481,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   }
   __pyx_t_5 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_v_url) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_url);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
@@ -7490,7 +7490,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     if (unlikely(size != 5)) {
       if (size > 5) __Pyx_RaiseTooManyValuesError(5);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(0, 483, __pyx_L1_error)
+      __PYX_ERR(0, 488, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -7516,7 +7516,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
       Py_ssize_t i;
       PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
       for (i=0; i < 5; i++) {
-        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 483, __pyx_L1_error)
+        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 488, __pyx_L1_error)
         __Pyx_GOTREF(item);
         *(temps[i]) = item;
       }
@@ -7526,7 +7526,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   } else {
     Py_ssize_t index = -1;
     PyObject** temps[5] = {&__pyx_t_2,&__pyx_t_6,&__pyx_t_7,&__pyx_t_8,&__pyx_t_9};
-    __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 483, __pyx_L1_error)
+    __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 488, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -7535,7 +7535,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
       __Pyx_GOTREF(item);
       *(temps[index]) = item;
     }
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
     __pyx_t_11 = NULL;
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     goto __pyx_L7_unpacking_done;
@@ -7543,7 +7543,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     __pyx_t_11 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(0, 483, __pyx_L1_error)
+    __PYX_ERR(0, 488, __pyx_L1_error)
     __pyx_L7_unpacking_done:;
   }
   __pyx_v_scheme = __pyx_t_2;
@@ -7557,14 +7557,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   __pyx_v_fragment = __pyx_t_9;
   __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":484
+  /* "lxml/html/clean.py":489
  *             return False
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]             # <<<<<<<<<<<<<<
  *         if scheme not in ('http', 'https'):
  *             return False
  */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_netloc, __pyx_n_s_lower); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_netloc, __pyx_n_s_lower); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
@@ -7578,22 +7578,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   }
   __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_split); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF_SET(__pyx_v_netloc, __pyx_t_9);
   __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":485
+  /* "lxml/html/clean.py":490
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):             # <<<<<<<<<<<<<<
@@ -7602,20 +7602,20 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   __Pyx_INCREF(__pyx_v_scheme);
   __pyx_t_9 = __pyx_v_scheme;
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_http, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_http, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
   if (__pyx_t_3) {
   } else {
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L9_bool_binop_done;
   }
-  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_https, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 485, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_9, __pyx_n_s_https, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
   __pyx_t_1 = __pyx_t_3;
   __pyx_L9_bool_binop_done:;
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_3 = (__pyx_t_1 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":486
+    /* "lxml/html/clean.py":491
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):
  *             return False             # <<<<<<<<<<<<<<
@@ -7627,7 +7627,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     __pyx_r = Py_False;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":485
+    /* "lxml/html/clean.py":490
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):             # <<<<<<<<<<<<<<
@@ -7636,21 +7636,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":487
+  /* "lxml/html/clean.py":492
  *         if scheme not in ('http', 'https'):
  *             return False
  *         if netloc in self.host_whitelist:             # <<<<<<<<<<<<<<
  *             return True
  *         return False
  */
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host_whitelist); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 487, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_host_whitelist); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 492, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_netloc, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 487, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_netloc, __pyx_t_9, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 492, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __pyx_t_1 = (__pyx_t_3 != 0);
   if (__pyx_t_1) {
 
-    /* "lxml/html/clean.py":488
+    /* "lxml/html/clean.py":493
  *             return False
  *         if netloc in self.host_whitelist:
  *             return True             # <<<<<<<<<<<<<<
@@ -7662,7 +7662,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":487
+    /* "lxml/html/clean.py":492
  *         if scheme not in ('http', 'https'):
  *             return False
  *         if netloc in self.host_whitelist:             # <<<<<<<<<<<<<<
@@ -7671,7 +7671,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":489
+  /* "lxml/html/clean.py":494
  *         if netloc in self.host_whitelist:
  *             return True
  *         return False             # <<<<<<<<<<<<<<
@@ -7683,7 +7683,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   __pyx_r = Py_False;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":472
+  /* "lxml/html/clean.py":477
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
@@ -7713,7 +7713,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -7757,11 +7757,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_11kill_conditional_comment
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, 1); __PYX_ERR(0, 491, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, 1); __PYX_ERR(0, 496, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill_conditional_comments") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill_conditional_comments") < 0)) __PYX_ERR(0, 496, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -7774,7 +7774,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_11kill_conditional_comment
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 496, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.kill_conditional_comments", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -7787,7 +7787,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_11kill_conditional_comment
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":499
+/* "lxml/html/clean.py":504
  *         has_conditional_comment = _conditional_comment_re.search
  *         self._kill_elements(
  *             doc, lambda el: has_conditional_comment(el.text),             # <<<<<<<<<<<<<<
@@ -7825,8 +7825,8 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p
   __pyx_outer_scope = (struct __pyx_obj_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments *) __Pyx_CyFunction_GetClosure(__pyx_self);
   __pyx_cur_scope = __pyx_outer_scope;
   __Pyx_XDECREF(__pyx_r);
-  if (unlikely(!__pyx_cur_scope->__pyx_v_has_conditional_comment)) { __Pyx_RaiseClosureNameError("has_conditional_comment"); __PYX_ERR(0, 499, __pyx_L1_error) }
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
+  if (unlikely(!__pyx_cur_scope->__pyx_v_has_conditional_comment)) { __Pyx_RaiseClosureNameError("has_conditional_comment"); __PYX_ERR(0, 504, __pyx_L1_error) }
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_has_conditional_comment);
   __pyx_t_3 = __pyx_cur_scope->__pyx_v_has_conditional_comment; __pyx_t_4 = NULL;
@@ -7842,7 +7842,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p
   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_1;
@@ -7863,7 +7863,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":491
+/* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -7890,57 +7890,57 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(0, 491, __pyx_L1_error)
+    __PYX_ERR(0, 496, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
 
-  /* "lxml/html/clean.py":497
+  /* "lxml/html/clean.py":502
  *         we'll kill any comments that could be conditional.
  *         """
  *         has_conditional_comment = _conditional_comment_re.search             # <<<<<<<<<<<<<<
  *         self._kill_elements(
  *             doc, lambda el: has_conditional_comment(el.text),
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_conditional_comment_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_conditional_comment_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 497, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_cur_scope->__pyx_v_has_conditional_comment = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":498
+  /* "lxml/html/clean.py":503
  *         """
  *         has_conditional_comment = _conditional_comment_re.search
  *         self._kill_elements(             # <<<<<<<<<<<<<<
  *             doc, lambda el: has_conditional_comment(el.text),
  *             etree.Comment)
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_kill_elements); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "lxml/html/clean.py":499
+  /* "lxml/html/clean.py":504
  *         has_conditional_comment = _conditional_comment_re.search
  *         self._kill_elements(
  *             doc, lambda el: has_conditional_comment(el.text),             # <<<<<<<<<<<<<<
  *             etree.Comment)
  * 
  */
-  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_25kill_conditional_comments_lambda, 0, __pyx_n_s_Cleaner_kill_conditional_comment, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml_html_clean, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 499, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_25kill_conditional_comments_lambda, 0, __pyx_n_s_Cleaner_kill_conditional_comment, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lxml_html_clean, __pyx_d, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
 
-  /* "lxml/html/clean.py":500
+  /* "lxml/html/clean.py":505
  *         self._kill_elements(
  *             doc, lambda el: has_conditional_comment(el.text),
  *             etree.Comment)             # <<<<<<<<<<<<<<
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_Comment); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -7958,7 +7958,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_doc, __pyx_t_3, __pyx_t_5};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -7968,7 +7968,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_doc, __pyx_t_3, __pyx_t_5};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -7976,7 +7976,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 503, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -7990,14 +7990,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
     PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 498, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":491
+  /* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -8024,7 +8024,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":502
+/* "lxml/html/clean.py":507
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
@@ -8074,13 +8074,13 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_13_kill_elements(PyObject
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 1); __PYX_ERR(0, 502, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 1); __PYX_ERR(0, 507, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_condition)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 2); __PYX_ERR(0, 502, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 2); __PYX_ERR(0, 507, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -8090,7 +8090,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_13_kill_elements(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill_elements") < 0)) __PYX_ERR(0, 502, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill_elements") < 0)) __PYX_ERR(0, 507, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -8110,7 +8110,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_13_kill_elements(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 507, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._kill_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8141,26 +8141,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_kill_elements", 0);
 
-  /* "lxml/html/clean.py":503
+  /* "lxml/html/clean.py":508
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):
  *         bad = []             # <<<<<<<<<<<<<<
  *         for el in doc.iter(iterate):
  *             if condition(el):
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bad = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":504
+  /* "lxml/html/clean.py":509
  *     def _kill_elements(self, doc, condition, iterate=None):
  *         bad = []
  *         for el in doc.iter(iterate):             # <<<<<<<<<<<<<<
  *             if condition(el):
  *                 bad.append(el)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_doc, __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -8174,16 +8174,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_iterate) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_iterate);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
     __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
   } else {
-    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
+    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 509, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 509, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
@@ -8191,17 +8191,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 504, __pyx_L1_error)
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       } else {
         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 504, __pyx_L1_error)
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 509, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       }
@@ -8211,7 +8211,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 504, __pyx_L1_error)
+          else __PYX_ERR(0, 509, __pyx_L1_error)
         }
         break;
       }
@@ -8220,7 +8220,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":505
+    /* "lxml/html/clean.py":510
  *         bad = []
  *         for el in doc.iter(iterate):
  *             if condition(el):             # <<<<<<<<<<<<<<
@@ -8240,23 +8240,23 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
     }
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_el);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 510, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_7) {
 
-      /* "lxml/html/clean.py":506
+      /* "lxml/html/clean.py":511
  *         for el in doc.iter(iterate):
  *             if condition(el):
  *                 bad.append(el)             # <<<<<<<<<<<<<<
  *         for el in bad:
  *             el.drop_tree()
  */
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 506, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_bad, __pyx_v_el); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 511, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":505
+      /* "lxml/html/clean.py":510
  *         bad = []
  *         for el in doc.iter(iterate):
  *             if condition(el):             # <<<<<<<<<<<<<<
@@ -8265,7 +8265,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
  */
     }
 
-    /* "lxml/html/clean.py":504
+    /* "lxml/html/clean.py":509
  *     def _kill_elements(self, doc, condition, iterate=None):
  *         bad = []
  *         for el in doc.iter(iterate):             # <<<<<<<<<<<<<<
@@ -8275,7 +8275,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":507
+  /* "lxml/html/clean.py":512
  *             if condition(el):
  *                 bad.append(el)
  *         for el in bad:             # <<<<<<<<<<<<<<
@@ -8286,22 +8286,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   for (;;) {
     if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 512, __pyx_L1_error)
     #else
-    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
+    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":508
+    /* "lxml/html/clean.py":513
  *                 bad.append(el)
  *         for el in bad:
  *             el.drop_tree()             # <<<<<<<<<<<<<<
  * 
  *     def _remove_javascript_link(self, link):
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 508, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_drop_tree); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -8315,12 +8315,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
     }
     __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
     __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":507
+    /* "lxml/html/clean.py":512
  *             if condition(el):
  *                 bad.append(el)
  *         for el in bad:             # <<<<<<<<<<<<<<
@@ -8330,7 +8330,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":502
+  /* "lxml/html/clean.py":507
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
@@ -8356,7 +8356,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":510
+/* "lxml/html/clean.py":515
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
@@ -8399,11 +8399,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link(
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_link)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, 1); __PYX_ERR(0, 510, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, 1); __PYX_ERR(0, 515, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remove_javascript_link") < 0)) __PYX_ERR(0, 510, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remove_javascript_link") < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -8416,7 +8416,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link(
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._remove_javascript_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8445,16 +8445,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_remove_javascript_link", 0);
 
-  /* "lxml/html/clean.py":512
+  /* "lxml/html/clean.py":517
  *     def _remove_javascript_link(self, link):
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', unquote_plus(link))             # <<<<<<<<<<<<<<
  *         if _is_javascript_scheme(new):
  *             # FIXME: should this be None to delete?
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -8468,7 +8468,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   }
   __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_link) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_link);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 517, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -8486,7 +8486,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s__2, __pyx_t_3};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -8495,14 +8495,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_kp_s__2, __pyx_t_3};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 517, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -8513,7 +8513,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
     __Pyx_GIVEREF(__pyx_t_3);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -8521,14 +8521,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   __pyx_v_new = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":513
+  /* "lxml/html/clean.py":518
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', unquote_plus(link))
  *         if _is_javascript_scheme(new):             # <<<<<<<<<<<<<<
  *             # FIXME: should this be None to delete?
  *             return ''
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_javascript_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_javascript_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 518, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -8542,14 +8542,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   }
   __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_new) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_new);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 518, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 518, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_7) {
 
-    /* "lxml/html/clean.py":515
+    /* "lxml/html/clean.py":520
  *         if _is_javascript_scheme(new):
  *             # FIXME: should this be None to delete?
  *             return ''             # <<<<<<<<<<<<<<
@@ -8561,7 +8561,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
     __pyx_r = __pyx_kp_s__2;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":513
+    /* "lxml/html/clean.py":518
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', unquote_plus(link))
  *         if _is_javascript_scheme(new):             # <<<<<<<<<<<<<<
@@ -8570,7 +8570,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
  */
   }
 
-  /* "lxml/html/clean.py":516
+  /* "lxml/html/clean.py":521
  *             # FIXME: should this be None to delete?
  *             return ''
  *         return link             # <<<<<<<<<<<<<<
@@ -8582,7 +8582,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   __pyx_r = __pyx_v_link;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":510
+  /* "lxml/html/clean.py":515
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
@@ -8606,7 +8606,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":520
+/* "lxml/html/clean.py":525
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
  * 
  *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
@@ -8650,11 +8650,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript(P
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_style)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, 1); __PYX_ERR(0, 520, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, 1); __PYX_ERR(0, 525, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_has_sneaky_javascript") < 0)) __PYX_ERR(0, 520, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_has_sneaky_javascript") < 0)) __PYX_ERR(0, 525, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -8667,7 +8667,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript(P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 520, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._has_sneaky_javascript", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8696,14 +8696,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   __Pyx_RefNannySetupContext("_has_sneaky_javascript", 0);
   __Pyx_INCREF(__pyx_v_style);
 
-  /* "lxml/html/clean.py":531
+  /* "lxml/html/clean.py":536
  *         more sneaky attempts.
  *         """
  *         style = self._substitute_comments('', style)             # <<<<<<<<<<<<<<
  *         style = style.replace('\\', '')
  *         style = _substitute_whitespace('', style)
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_substitute_comments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_substitute_comments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 536, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -8720,7 +8720,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s__2, __pyx_v_style};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -8728,13 +8728,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s__2, __pyx_v_style};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 536, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_3) {
       __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
@@ -8745,7 +8745,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
     __Pyx_INCREF(__pyx_v_style);
     __Pyx_GIVEREF(__pyx_v_style);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_style);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -8753,29 +8753,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   __Pyx_DECREF_SET(__pyx_v_style, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":532
+  /* "lxml/html/clean.py":537
  *         """
  *         style = self._substitute_comments('', style)
  *         style = style.replace('\\', '')             # <<<<<<<<<<<<<<
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_replace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":533
+  /* "lxml/html/clean.py":538
  *         style = self._substitute_comments('', style)
  *         style = style.replace('\\', '')
  *         style = _substitute_whitespace('', style)             # <<<<<<<<<<<<<<
  *         style = style.lower()
  *         if 'javascript:' in style:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 538, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_5 = NULL;
   __pyx_t_4 = 0;
@@ -8792,7 +8792,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__2, __pyx_v_style};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -8800,13 +8800,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
     PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s__2, __pyx_v_style};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 538, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     if (__pyx_t_5) {
       __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -8817,7 +8817,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
     __Pyx_INCREF(__pyx_v_style);
     __Pyx_GIVEREF(__pyx_v_style);
     PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_4, __pyx_v_style);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 538, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
@@ -8825,14 +8825,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   __Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":534
+  /* "lxml/html/clean.py":539
  *         style = style.replace('\\', '')
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()             # <<<<<<<<<<<<<<
  *         if 'javascript:' in style:
  *             return True
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_style, __pyx_n_s_lower); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 539, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -8846,24 +8846,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   }
   __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 539, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF_SET(__pyx_v_style, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":535
+  /* "lxml/html/clean.py":540
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()
  *         if 'javascript:' in style:             # <<<<<<<<<<<<<<
  *             return True
  *         if 'expression(' in style:
  */
-  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_javascript_2, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 535, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_javascript_2, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 540, __pyx_L1_error)
   __pyx_t_7 = (__pyx_t_6 != 0);
   if (__pyx_t_7) {
 
-    /* "lxml/html/clean.py":536
+    /* "lxml/html/clean.py":541
  *         style = style.lower()
  *         if 'javascript:' in style:
  *             return True             # <<<<<<<<<<<<<<
@@ -8875,7 +8875,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":535
+    /* "lxml/html/clean.py":540
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()
  *         if 'javascript:' in style:             # <<<<<<<<<<<<<<
@@ -8884,18 +8884,18 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
  */
   }
 
-  /* "lxml/html/clean.py":537
+  /* "lxml/html/clean.py":542
  *         if 'javascript:' in style:
  *             return True
  *         if 'expression(' in style:             # <<<<<<<<<<<<<<
  *             return True
  *         if '</noscript' in style:
  */
-  __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_expression, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 537, __pyx_L1_error)
+  __pyx_t_7 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_expression, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 542, __pyx_L1_error)
   __pyx_t_6 = (__pyx_t_7 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/html/clean.py":538
+    /* "lxml/html/clean.py":543
  *             return True
  *         if 'expression(' in style:
  *             return True             # <<<<<<<<<<<<<<
@@ -8907,7 +8907,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":537
+    /* "lxml/html/clean.py":542
  *         if 'javascript:' in style:
  *             return True
  *         if 'expression(' in style:             # <<<<<<<<<<<<<<
@@ -8916,30 +8916,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
  */
   }
 
-  /* "lxml/html/clean.py":539
+  /* "lxml/html/clean.py":544
  *         if 'expression(' in style:
  *             return True
  *         if '</noscript' in style:             # <<<<<<<<<<<<<<
  *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
  *             return True
  */
-  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_noscript, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 539, __pyx_L1_error)
+  __pyx_t_6 = (__Pyx_PySequence_ContainsTF(__pyx_kp_s_noscript, __pyx_v_style, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 544, __pyx_L1_error)
   __pyx_t_7 = (__pyx_t_6 != 0);
   if (__pyx_t_7) {
 
-    /* "lxml/html/clean.py":541
+    /* "lxml/html/clean.py":546
  *         if '</noscript' in style:
  *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
  *             return True             # <<<<<<<<<<<<<<
- *         return False
- * 
+ *         if _looks_like_tag_content(style):
+ *             # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
  */
     __Pyx_XDECREF(__pyx_r);
     __Pyx_INCREF(Py_True);
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":539
+    /* "lxml/html/clean.py":544
  *         if 'expression(' in style:
  *             return True
  *         if '</noscript' in style:             # <<<<<<<<<<<<<<
@@ -8948,28 +8948,77 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
  */
   }
 
-  /* "lxml/html/clean.py":542
+  /* "lxml/html/clean.py":547
  *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
  *             return True
- *         return False             # <<<<<<<<<<<<<<
- * 
- *     def clean_html(self, html):
+ *         if _looks_like_tag_content(style):             # <<<<<<<<<<<<<<
+ *             # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ *             return True
  */
-  __Pyx_XDECREF(__pyx_r);
-  __Pyx_INCREF(Py_False);
-  __pyx_r = Py_False;
-  goto __pyx_L0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_looks_like_tag_content); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_3 = NULL;
+  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
+    if (likely(__pyx_t_3)) {
+      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+      __Pyx_INCREF(__pyx_t_3);
+      __Pyx_INCREF(function);
+      __Pyx_DECREF_SET(__pyx_t_1, function);
+    }
+  }
+  __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_style) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_style);
+  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 547, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (__pyx_t_7) {
 
-  /* "lxml/html/clean.py":520
- *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
+    /* "lxml/html/clean.py":549
+ *         if _looks_like_tag_content(style):
+ *             # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ *             return True             # <<<<<<<<<<<<<<
+ *         return False
  * 
- *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
- *         """
- *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
  */
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_True);
+    __pyx_r = Py_True;
+    goto __pyx_L0;
 
-  /* function exit code */
-  __pyx_L1_error:;
+    /* "lxml/html/clean.py":547
+ *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
+ *             return True
+ *         if _looks_like_tag_content(style):             # <<<<<<<<<<<<<<
+ *             # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ *             return True
+ */
+  }
+
+  /* "lxml/html/clean.py":550
+ *             # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+ *             return True
+ *         return False             # <<<<<<<<<<<<<<
+ * 
+ *     def clean_html(self, html):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(Py_False);
+  __pyx_r = Py_False;
+  goto __pyx_L0;
+
+  /* "lxml/html/clean.py":525
+ *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
+ * 
+ *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
+ *         """
+ *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
+ */
+
+  /* function exit code */
+  __pyx_L1_error:;
   __Pyx_XDECREF(__pyx_t_1);
   __Pyx_XDECREF(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3);
@@ -8983,7 +9032,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":544
+/* "lxml/html/clean.py":552
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
@@ -9026,11 +9075,11 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_19clean_html(PyObject *__p
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_html)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, 1); __PYX_ERR(0, 544, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, 1); __PYX_ERR(0, 552, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clean_html") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clean_html") < 0)) __PYX_ERR(0, 552, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -9043,7 +9092,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_19clean_html(PyObject *__p
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 552, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.clean_html", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9073,7 +9122,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("clean_html", 0);
 
-  /* "lxml/html/clean.py":545
+  /* "lxml/html/clean.py":553
  * 
  *     def clean_html(self, html):
  *         result_type = type(html)             # <<<<<<<<<<<<<<
@@ -9083,28 +9132,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
   __pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
 
-  /* "lxml/html/clean.py":546
+  /* "lxml/html/clean.py":554
  *     def clean_html(self, html):
  *         result_type = type(html)
  *         if isinstance(html, basestring):             # <<<<<<<<<<<<<<
  *             doc = fromstring(html)
  *         else:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 546, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 554, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":547
+    /* "lxml/html/clean.py":555
  *         result_type = type(html)
  *         if isinstance(html, basestring):
  *             doc = fromstring(html)             # <<<<<<<<<<<<<<
  *         else:
  *             doc = copy.deepcopy(html)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 555, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -9118,13 +9167,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
     }
     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_html);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_doc = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":546
+    /* "lxml/html/clean.py":554
  *     def clean_html(self, html):
  *         result_type = type(html)
  *         if isinstance(html, basestring):             # <<<<<<<<<<<<<<
@@ -9134,7 +9183,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
     goto __pyx_L3;
   }
 
-  /* "lxml/html/clean.py":549
+  /* "lxml/html/clean.py":557
  *             doc = fromstring(html)
  *         else:
  *             doc = copy.deepcopy(html)             # <<<<<<<<<<<<<<
@@ -9142,9 +9191,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
  *         return _transform_result(result_type, doc)
  */
   /*else*/ {
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 549, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = NULL;
@@ -9159,7 +9208,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
     }
     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_html);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_doc = __pyx_t_1;
@@ -9167,7 +9216,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   }
   __pyx_L3:;
 
-  /* "lxml/html/clean.py":550
+  /* "lxml/html/clean.py":558
  *         else:
  *             doc = copy.deepcopy(html)
  *         self(doc)             # <<<<<<<<<<<<<<
@@ -9187,12 +9236,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   }
   __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_doc) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_doc);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 558, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":551
+  /* "lxml/html/clean.py":559
  *             doc = copy.deepcopy(html)
  *         self(doc)
  *         return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -9200,7 +9249,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
  * clean = Cleaner()
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_4 = NULL;
   __pyx_t_6 = 0;
@@ -9217,7 +9266,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_5)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -9225,13 +9274,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
     PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 559, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -9242,7 +9291,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
     __Pyx_INCREF(__pyx_v_doc);
     __Pyx_GIVEREF(__pyx_v_doc);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_doc);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -9251,7 +9300,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":544
+  /* "lxml/html/clean.py":552
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
@@ -9275,7 +9324,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":576
+/* "lxml/html/clean.py":584
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
@@ -9293,7 +9342,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_16__defaults__(CYTHON_UNUSED PyObje
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__defaults__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_link_regexes);
   __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_link_regexes);
@@ -9307,7 +9356,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_16__defaults__(CYTHON_UNUSED PyObje
   __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
   __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
   PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_avoid_classes);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
@@ -9403,7 +9452,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_3autolink(PyObject *__pyx_self, PyO
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "autolink") < 0)) __PYX_ERR(0, 576, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "autolink") < 0)) __PYX_ERR(0, 584, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9428,7 +9477,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_3autolink(PyObject *__pyx_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("autolink", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("autolink", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 584, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.autolink", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9466,21 +9515,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("autolink", 0);
 
-  /* "lxml/html/clean.py":594
+  /* "lxml/html/clean.py":602
  *     substituted, only the contents of the element.
  *     """
  *     if el.tag in avoid_elements:             # <<<<<<<<<<<<<<
  *         return
  *     class_name = el.get('class')
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_avoid_elements, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 594, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_v_avoid_elements, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 602, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":595
+    /* "lxml/html/clean.py":603
  *     """
  *     if el.tag in avoid_elements:
  *         return             # <<<<<<<<<<<<<<
@@ -9491,7 +9540,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":594
+    /* "lxml/html/clean.py":602
  *     substituted, only the contents of the element.
  *     """
  *     if el.tag in avoid_elements:             # <<<<<<<<<<<<<<
@@ -9500,14 +9549,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":596
+  /* "lxml/html/clean.py":604
  *     if el.tag in avoid_elements:
  *         return
  *     class_name = el.get('class')             # <<<<<<<<<<<<<<
  *     if class_name:
  *         class_name = class_name.split()
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -9521,30 +9570,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   }
   __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_n_s_class) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_n_s_class);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_v_class_name = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":597
+  /* "lxml/html/clean.py":605
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 597, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 605, __pyx_L1_error)
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":598
+    /* "lxml/html/clean.py":606
  *     class_name = el.get('class')
  *     if class_name:
  *         class_name = class_name.split()             # <<<<<<<<<<<<<<
  *         for match_class in avoid_classes:
  *             if match_class in class_name:
  */
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 598, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 606, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -9558,13 +9607,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     }
     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_class_name, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":599
+    /* "lxml/html/clean.py":607
  *     if class_name:
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:             # <<<<<<<<<<<<<<
@@ -9575,26 +9624,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __pyx_t_1 = __pyx_v_avoid_classes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
     } else {
-      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
+      __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
+      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 607, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_7)) {
         if (likely(PyList_CheckExact(__pyx_t_1))) {
           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 599, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 599, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 607, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -9604,7 +9653,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 599, __pyx_L1_error)
+            else __PYX_ERR(0, 607, __pyx_L1_error)
           }
           break;
         }
@@ -9613,18 +9662,18 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __Pyx_XDECREF_SET(__pyx_v_match_class, __pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "lxml/html/clean.py":600
+      /* "lxml/html/clean.py":608
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:
  *             if match_class in class_name:             # <<<<<<<<<<<<<<
  *                 return
  *     for child in list(el):
  */
-      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_match_class, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 600, __pyx_L1_error)
+      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_match_class, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 608, __pyx_L1_error)
       __pyx_t_2 = (__pyx_t_3 != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/html/clean.py":601
+        /* "lxml/html/clean.py":609
  *         for match_class in avoid_classes:
  *             if match_class in class_name:
  *                 return             # <<<<<<<<<<<<<<
@@ -9636,7 +9685,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         goto __pyx_L0;
 
-        /* "lxml/html/clean.py":600
+        /* "lxml/html/clean.py":608
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:
  *             if match_class in class_name:             # <<<<<<<<<<<<<<
@@ -9645,7 +9694,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
       }
 
-      /* "lxml/html/clean.py":599
+      /* "lxml/html/clean.py":607
  *     if class_name:
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:             # <<<<<<<<<<<<<<
@@ -9655,7 +9704,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":597
+    /* "lxml/html/clean.py":605
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
@@ -9664,128 +9713,128 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":602
+  /* "lxml/html/clean.py":610
  *             if match_class in class_name:
  *                 return
  *     for child in list(el):             # <<<<<<<<<<<<<<
  *         autolink(child, link_regexes=link_regexes,
  *                  avoid_elements=avoid_elements,
  */
-  __pyx_t_1 = PySequence_List(__pyx_v_el); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+  __pyx_t_1 = PySequence_List(__pyx_v_el); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
     if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 602, __pyx_L1_error)
+    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
     #else
-    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
+    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":603
+    /* "lxml/html/clean.py":611
  *                 return
  *     for child in list(el):
  *         autolink(child, link_regexes=link_regexes,             # <<<<<<<<<<<<<<
  *                  avoid_elements=avoid_elements,
  *                  avoid_hosts=avoid_hosts,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_child);
     __Pyx_GIVEREF(__pyx_v_child);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_child);
-    __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 611, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":604
+    /* "lxml/html/clean.py":612
  *     for child in list(el):
  *         autolink(child, link_regexes=link_regexes,
  *                  avoid_elements=avoid_elements,             # <<<<<<<<<<<<<<
  *                  avoid_hosts=avoid_hosts,
  *                  avoid_classes=avoid_classes)
  */
-    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":605
+    /* "lxml/html/clean.py":613
  *         autolink(child, link_regexes=link_regexes,
  *                  avoid_elements=avoid_elements,
  *                  avoid_hosts=avoid_hosts,             # <<<<<<<<<<<<<<
  *                  avoid_classes=avoid_classes)
  *         if child.tail:
  */
-    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_hosts, __pyx_v_avoid_hosts) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_hosts, __pyx_v_avoid_hosts) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":606
+    /* "lxml/html/clean.py":614
  *                  avoid_elements=avoid_elements,
  *                  avoid_hosts=avoid_hosts,
  *                  avoid_classes=avoid_classes)             # <<<<<<<<<<<<<<
  *         if child.tail:
  *             text, tail_children = _link_text(
  */
-    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":603
+    /* "lxml/html/clean.py":611
  *                 return
  *     for child in list(el):
  *         autolink(child, link_regexes=link_regexes,             # <<<<<<<<<<<<<<
  *                  avoid_elements=avoid_elements,
  *                  avoid_hosts=avoid_hosts,
  */
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 603, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 611, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "lxml/html/clean.py":607
+    /* "lxml/html/clean.py":615
  *                  avoid_hosts=avoid_hosts,
  *                  avoid_classes=avoid_classes)
  *         if child.tail:             # <<<<<<<<<<<<<<
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  */
-    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 607, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 615, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 615, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_2) {
 
-      /* "lxml/html/clean.py":608
+      /* "lxml/html/clean.py":616
  *                  avoid_classes=avoid_classes)
  *         if child.tail:
  *             text, tail_children = _link_text(             # <<<<<<<<<<<<<<
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_link_text); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_link_text); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "lxml/html/clean.py":609
+      /* "lxml/html/clean.py":617
  *         if child.tail:
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)             # <<<<<<<<<<<<<<
  *             if tail_children:
  *                 child.tail = text
  */
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
 
-      /* "lxml/html/clean.py":608
+      /* "lxml/html/clean.py":616
  *                  avoid_classes=avoid_classes)
  *         if child.tail:
  *             text, tail_children = _link_text(             # <<<<<<<<<<<<<<
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:
  */
-      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_8);
       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
@@ -9797,28 +9846,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_avoid_hosts);
       __pyx_t_8 = 0;
 
-      /* "lxml/html/clean.py":609
+      /* "lxml/html/clean.py":617
  *         if child.tail:
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)             # <<<<<<<<<<<<<<
  *             if tail_children:
  *                 child.tail = text
  */
-      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 617, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 609, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
+      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 617, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":608
+      /* "lxml/html/clean.py":616
  *                  avoid_classes=avoid_classes)
  *         if child.tail:
  *             text, tail_children = _link_text(             # <<<<<<<<<<<<<<
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:
  */
-      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 608, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 616, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -9829,7 +9878,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(0, 608, __pyx_L1_error)
+          __PYX_ERR(0, 616, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -9842,15 +9891,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         __Pyx_INCREF(__pyx_t_8);
         __Pyx_INCREF(__pyx_t_5);
         #else
-        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 616, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
@@ -9858,7 +9907,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         __Pyx_GOTREF(__pyx_t_8);
         index = 1; __pyx_t_5 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_5);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L12_unpacking_done;
@@ -9866,7 +9915,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(0, 608, __pyx_L1_error)
+        __PYX_ERR(0, 616, __pyx_L1_error)
         __pyx_L12_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_8);
@@ -9874,33 +9923,33 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __Pyx_XDECREF_SET(__pyx_v_tail_children, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":610
+      /* "lxml/html/clean.py":618
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:             # <<<<<<<<<<<<<<
  *                 child.tail = text
  *                 index = el.index(child)
  */
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tail_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tail_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 618, __pyx_L1_error)
       if (__pyx_t_2) {
 
-        /* "lxml/html/clean.py":611
+        /* "lxml/html/clean.py":619
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:
  *                 child.tail = text             # <<<<<<<<<<<<<<
  *                 index = el.index(child)
  *                 el[index+1:index+1] = tail_children
  */
-        if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":612
+        /* "lxml/html/clean.py":620
  *             if tail_children:
  *                 child.tail = text
  *                 index = el.index(child)             # <<<<<<<<<<<<<<
  *                 el[index+1:index+1] = tail_children
  *     if el.text:
  */
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 612, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 620, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __pyx_t_8 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -9914,28 +9963,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
         }
         __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_child) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_child);
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __pyx_L1_error)
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_1);
         __pyx_t_1 = 0;
 
-        /* "lxml/html/clean.py":613
+        /* "lxml/html/clean.py":621
  *                 child.tail = text
  *                 index = el.index(child)
  *                 el[index+1:index+1] = tail_children             # <<<<<<<<<<<<<<
  *     if el.text:
  *         text, pre_children = _link_text(
  */
-        __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 621, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 613, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_index, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 621, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_tail_children, 0, 0, &__pyx_t_1, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 613, __pyx_L1_error)
+        if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_tail_children, 0, 0, &__pyx_t_1, &__pyx_t_5, NULL, 0, 0, 1) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":610
+        /* "lxml/html/clean.py":618
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:             # <<<<<<<<<<<<<<
@@ -9944,7 +9993,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
       }
 
-      /* "lxml/html/clean.py":607
+      /* "lxml/html/clean.py":615
  *                  avoid_hosts=avoid_hosts,
  *                  avoid_classes=avoid_classes)
  *         if child.tail:             # <<<<<<<<<<<<<<
@@ -9953,7 +10002,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
     }
 
-    /* "lxml/html/clean.py":602
+    /* "lxml/html/clean.py":610
  *             if match_class in class_name:
  *                 return
  *     for child in list(el):             # <<<<<<<<<<<<<<
@@ -9963,47 +10012,47 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "lxml/html/clean.py":614
+  /* "lxml/html/clean.py":622
  *                 index = el.index(child)
  *                 el[index+1:index+1] = tail_children
  *     if el.text:             # <<<<<<<<<<<<<<
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 614, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 622, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_2) {
 
-    /* "lxml/html/clean.py":615
+    /* "lxml/html/clean.py":623
  *                 el[index+1:index+1] = tail_children
  *     if el.text:
  *         text, pre_children = _link_text(             # <<<<<<<<<<<<<<
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_link_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_link_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "lxml/html/clean.py":616
+    /* "lxml/html/clean.py":624
  *     if el.text:
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)             # <<<<<<<<<<<<<<
  *         if pre_children:
  *             el.text = text
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
 
-    /* "lxml/html/clean.py":615
+    /* "lxml/html/clean.py":623
  *                 el[index+1:index+1] = tail_children
  *     if el.text:
  *         text, pre_children = _link_text(             # <<<<<<<<<<<<<<
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:
  */
-    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
@@ -10015,28 +10064,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_avoid_hosts);
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":616
+    /* "lxml/html/clean.py":624
  *     if el.text:
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)             # <<<<<<<<<<<<<<
  *         if pre_children:
  *             el.text = text
  */
-    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 624, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 616, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_makeelement); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 624, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 624, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-    /* "lxml/html/clean.py":615
+    /* "lxml/html/clean.py":623
  *                 el[index+1:index+1] = tail_children
  *     if el.text:
  *         text, pre_children = _link_text(             # <<<<<<<<<<<<<<
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:
  */
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 615, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 623, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -10047,7 +10096,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(0, 615, __pyx_L1_error)
+        __PYX_ERR(0, 623, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -10060,15 +10109,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __Pyx_INCREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_t_1);
       #else
-      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 623, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
+      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       #endif
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
+      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 623, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext;
@@ -10076,7 +10125,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __Pyx_GOTREF(__pyx_t_5);
       index = 1; __pyx_t_1 = __pyx_t_10(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L15_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_1);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 623, __pyx_L1_error)
       __pyx_t_10 = NULL;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       goto __pyx_L16_unpacking_done;
@@ -10084,7 +10133,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_t_10 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(0, 615, __pyx_L1_error)
+      __PYX_ERR(0, 623, __pyx_L1_error)
       __pyx_L16_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_5);
@@ -10092,35 +10141,35 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
     __pyx_v_pre_children = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":617
+    /* "lxml/html/clean.py":625
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:             # <<<<<<<<<<<<<<
  *             el.text = text
  *             el[:0] = pre_children
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pre_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pre_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 625, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/html/clean.py":618
+      /* "lxml/html/clean.py":626
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:
  *             el.text = text             # <<<<<<<<<<<<<<
  *             el[:0] = pre_children
  * 
  */
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 626, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":619
+      /* "lxml/html/clean.py":627
  *         if pre_children:
  *             el.text = text
  *             el[:0] = pre_children             # <<<<<<<<<<<<<<
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):
  */
-      if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_pre_children, 0, 0, NULL, NULL, &__pyx_slice__14, 0, 1, 1) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
+      if (__Pyx_PyObject_SetSlice(__pyx_v_el, __pyx_v_pre_children, 0, 0, NULL, NULL, &__pyx_slice__14, 0, 1, 1) < 0) __PYX_ERR(0, 627, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":617
+      /* "lxml/html/clean.py":625
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:             # <<<<<<<<<<<<<<
@@ -10129,7 +10178,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
     }
 
-    /* "lxml/html/clean.py":614
+    /* "lxml/html/clean.py":622
  *                 index = el.index(child)
  *                 el[index+1:index+1] = tail_children
  *     if el.text:             # <<<<<<<<<<<<<<
@@ -10138,7 +10187,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":576
+  /* "lxml/html/clean.py":584
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
@@ -10170,7 +10219,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":621
+/* "lxml/html/clean.py":629
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
@@ -10219,23 +10268,23 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_5_link_text(PyObject *__pyx_self, P
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_link_regexes)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 1); __PYX_ERR(0, 621, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 1); __PYX_ERR(0, 629, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_avoid_hosts)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 2); __PYX_ERR(0, 621, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 2); __PYX_ERR(0, 629, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_factory)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 3); __PYX_ERR(0, 621, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 3); __PYX_ERR(0, 629, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_link_text") < 0)) __PYX_ERR(0, 621, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_link_text") < 0)) __PYX_ERR(0, 629, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -10252,7 +10301,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_5_link_text(PyObject *__pyx_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 621, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 629, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._link_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -10303,7 +10352,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
   __Pyx_RefNannySetupContext("_link_text", 0);
   __Pyx_INCREF(__pyx_v_text);
 
-  /* "lxml/html/clean.py":622
+  /* "lxml/html/clean.py":630
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):
  *     leading_text = ''             # <<<<<<<<<<<<<<
@@ -10313,19 +10362,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
   __Pyx_INCREF(__pyx_kp_s__2);
   __pyx_v_leading_text = __pyx_kp_s__2;
 
-  /* "lxml/html/clean.py":623
+  /* "lxml/html/clean.py":631
  * def _link_text(text, link_regexes, avoid_hosts, factory):
  *     leading_text = ''
  *     links = []             # <<<<<<<<<<<<<<
  *     last_pos = 0
  *     while 1:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_links = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":624
+  /* "lxml/html/clean.py":632
  *     leading_text = ''
  *     links = []
  *     last_pos = 0             # <<<<<<<<<<<<<<
@@ -10334,7 +10383,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
   __pyx_v_last_pos = 0;
 
-  /* "lxml/html/clean.py":625
+  /* "lxml/html/clean.py":633
  *     links = []
  *     last_pos = 0
  *     while 1:             # <<<<<<<<<<<<<<
@@ -10343,7 +10392,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
   while (1) {
 
-    /* "lxml/html/clean.py":626
+    /* "lxml/html/clean.py":634
  *     last_pos = 0
  *     while 1:
  *         best_match, best_pos = None, None             # <<<<<<<<<<<<<<
@@ -10359,7 +10408,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     __Pyx_XDECREF_SET(__pyx_v_best_pos, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":627
+    /* "lxml/html/clean.py":635
  *     while 1:
  *         best_match, best_pos = None, None
  *         for regex in link_regexes:             # <<<<<<<<<<<<<<
@@ -10370,26 +10419,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       __pyx_t_2 = __pyx_v_link_regexes; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
       __pyx_t_4 = NULL;
     } else {
-      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_link_regexes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 627, __pyx_L1_error)
+      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_link_regexes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __pyx_L1_error)
+      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_4)) {
         if (likely(PyList_CheckExact(__pyx_t_2))) {
           if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 627, __pyx_L1_error)
+          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         } else {
           if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 627, __pyx_L1_error)
+          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -10399,7 +10448,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 627, __pyx_L1_error)
+            else __PYX_ERR(0, 635, __pyx_L1_error)
           }
           break;
         }
@@ -10408,19 +10457,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       __Pyx_XDECREF_SET(__pyx_v_regex, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":628
+      /* "lxml/html/clean.py":636
  *         best_match, best_pos = None, None
  *         for regex in link_regexes:
  *             regex_pos = last_pos             # <<<<<<<<<<<<<<
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)
  */
-      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_last_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_last_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 636, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_XDECREF_SET(__pyx_v_regex_pos, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":629
+      /* "lxml/html/clean.py":637
  *         for regex in link_regexes:
  *             regex_pos = last_pos
  *             while 1:             # <<<<<<<<<<<<<<
@@ -10429,24 +10478,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       while (1) {
 
-        /* "lxml/html/clean.py":630
+        /* "lxml/html/clean.py":638
  *             regex_pos = last_pos
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)             # <<<<<<<<<<<<<<
  *                 if match is None:
  *                     break
  */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 638, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_INCREF(__pyx_v_text);
         __Pyx_GIVEREF(__pyx_v_text);
         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_text);
-        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 638, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_v_regex_pos) < 0) __PYX_ERR(0, 630, __pyx_L1_error)
-        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 630, __pyx_L1_error)
+        if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_pos, __pyx_v_regex_pos) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 638, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -10454,7 +10503,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         __Pyx_XDECREF_SET(__pyx_v_match, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "lxml/html/clean.py":631
+        /* "lxml/html/clean.py":639
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:             # <<<<<<<<<<<<<<
@@ -10465,7 +10514,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         __pyx_t_9 = (__pyx_t_8 != 0);
         if (__pyx_t_9) {
 
-          /* "lxml/html/clean.py":632
+          /* "lxml/html/clean.py":640
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:
  *                     break             # <<<<<<<<<<<<<<
@@ -10474,7 +10523,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
           goto __pyx_L8_break;
 
-          /* "lxml/html/clean.py":631
+          /* "lxml/html/clean.py":639
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:             # <<<<<<<<<<<<<<
@@ -10483,14 +10532,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
         }
 
-        /* "lxml/html/clean.py":633
+        /* "lxml/html/clean.py":641
  *                 if match is None:
  *                     break
  *                 host = match.group('host')             # <<<<<<<<<<<<<<
  *                 for host_regex in avoid_hosts:
  *                     if host_regex.search(host):
  */
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_group); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 641, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -10504,13 +10553,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         }
         __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_n_s_host) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_n_s_host);
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __pyx_L1_error)
+        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 641, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_XDECREF_SET(__pyx_v_host, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "lxml/html/clean.py":634
+        /* "lxml/html/clean.py":642
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10521,26 +10570,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           __pyx_t_7 = __pyx_v_avoid_hosts; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
           __pyx_t_11 = NULL;
         } else {
-          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_avoid_hosts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 634, __pyx_L1_error)
+          __pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_avoid_hosts); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __pyx_L1_error)
+          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 642, __pyx_L1_error)
         }
         for (;;) {
           if (likely(!__pyx_t_11)) {
             if (likely(PyList_CheckExact(__pyx_t_7))) {
               if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
+              __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
               #else
-              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
+              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_6);
               #endif
             } else {
               if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 634, __pyx_L1_error)
+              __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_6); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
               #else
-              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 634, __pyx_L1_error)
+              __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_6);
               #endif
             }
@@ -10550,7 +10599,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
               PyObject* exc_type = PyErr_Occurred();
               if (exc_type) {
                 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-                else __PYX_ERR(0, 634, __pyx_L1_error)
+                else __PYX_ERR(0, 642, __pyx_L1_error)
               }
               break;
             }
@@ -10559,14 +10608,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           __Pyx_XDECREF_SET(__pyx_v_host_regex, __pyx_t_6);
           __pyx_t_6 = 0;
 
-          /* "lxml/html/clean.py":635
+          /* "lxml/html/clean.py":643
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:
  *                     if host_regex.search(host):             # <<<<<<<<<<<<<<
  *                         regex_pos = match.end()
  *                         break
  */
-          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_host_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
+          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_host_regex, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 643, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __pyx_t_1 = NULL;
           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -10580,21 +10629,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           }
           __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_1, __pyx_v_host) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_host);
           __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __pyx_L1_error)
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 643, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
+          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           if (__pyx_t_9) {
 
-            /* "lxml/html/clean.py":636
+            /* "lxml/html/clean.py":644
  *                 for host_regex in avoid_hosts:
  *                     if host_regex.search(host):
  *                         regex_pos = match.end()             # <<<<<<<<<<<<<<
  *                         break
  *                 else:
  */
-            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 636, __pyx_L1_error)
+            __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 644, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_5);
             __pyx_t_1 = NULL;
             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -10608,13 +10657,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
             }
             __pyx_t_6 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
             __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __pyx_L1_error)
+            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
             __Pyx_DECREF_SET(__pyx_v_regex_pos, __pyx_t_6);
             __pyx_t_6 = 0;
 
-            /* "lxml/html/clean.py":637
+            /* "lxml/html/clean.py":645
  *                     if host_regex.search(host):
  *                         regex_pos = match.end()
  *                         break             # <<<<<<<<<<<<<<
@@ -10623,7 +10672,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
             goto __pyx_L11_break;
 
-            /* "lxml/html/clean.py":635
+            /* "lxml/html/clean.py":643
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:
  *                     if host_regex.search(host):             # <<<<<<<<<<<<<<
@@ -10632,7 +10681,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
           }
 
-          /* "lxml/html/clean.py":634
+          /* "lxml/html/clean.py":642
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10642,7 +10691,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         }
         /*else*/ {
 
-          /* "lxml/html/clean.py":639
+          /* "lxml/html/clean.py":647
  *                         break
  *                 else:
  *                     break             # <<<<<<<<<<<<<<
@@ -10652,7 +10701,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           goto __pyx_L8_break;
         }
 
-        /* "lxml/html/clean.py":634
+        /* "lxml/html/clean.py":642
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10664,19 +10713,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       }
       __pyx_L8_break:;
 
-      /* "lxml/html/clean.py":640
+      /* "lxml/html/clean.py":648
  *                 else:
  *                     break
  *             if match is None:             # <<<<<<<<<<<<<<
  *                 continue
  *             if best_pos is None or match.start() < best_pos:
  */
-      if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 640, __pyx_L1_error) }
+      if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 648, __pyx_L1_error) }
       __pyx_t_9 = (__pyx_v_match == Py_None);
       __pyx_t_8 = (__pyx_t_9 != 0);
       if (__pyx_t_8) {
 
-        /* "lxml/html/clean.py":641
+        /* "lxml/html/clean.py":649
  *                     break
  *             if match is None:
  *                 continue             # <<<<<<<<<<<<<<
@@ -10685,7 +10734,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
         goto __pyx_L5_continue;
 
-        /* "lxml/html/clean.py":640
+        /* "lxml/html/clean.py":648
  *                 else:
  *                     break
  *             if match is None:             # <<<<<<<<<<<<<<
@@ -10694,7 +10743,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":642
+      /* "lxml/html/clean.py":650
  *             if match is None:
  *                 continue
  *             if best_pos is None or match.start() < best_pos:             # <<<<<<<<<<<<<<
@@ -10708,8 +10757,8 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         __pyx_t_8 = __pyx_t_12;
         goto __pyx_L16_bool_binop_done;
       }
-      if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 642, __pyx_L1_error) }
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
+      if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 650, __pyx_L1_error) }
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_5 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -10723,37 +10772,37 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       }
       __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
+      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 650, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_best_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 642, __pyx_L1_error)
+      __pyx_t_6 = PyObject_RichCompare(__pyx_t_7, __pyx_v_best_pos, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 650, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 642, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 650, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_8 = __pyx_t_12;
       __pyx_L16_bool_binop_done:;
       if (__pyx_t_8) {
 
-        /* "lxml/html/clean.py":643
+        /* "lxml/html/clean.py":651
  *                 continue
  *             if best_pos is None or match.start() < best_pos:
  *                 best_match = match             # <<<<<<<<<<<<<<
  *                 best_pos = match.start()
  *         if best_match is None:
  */
-        if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 643, __pyx_L1_error) }
+        if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 651, __pyx_L1_error) }
         __Pyx_INCREF(__pyx_v_match);
         __Pyx_DECREF_SET(__pyx_v_best_match, __pyx_v_match);
 
-        /* "lxml/html/clean.py":644
+        /* "lxml/html/clean.py":652
  *             if best_pos is None or match.start() < best_pos:
  *                 best_match = match
  *                 best_pos = match.start()             # <<<<<<<<<<<<<<
  *         if best_match is None:
  *             # No more matches
  */
-        if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 644, __pyx_L1_error) }
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 644, __pyx_L1_error)
+        if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 652, __pyx_L1_error) }
+        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 652, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -10767,13 +10816,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         }
         __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __pyx_L1_error)
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 652, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF_SET(__pyx_v_best_pos, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":642
+        /* "lxml/html/clean.py":650
  *             if match is None:
  *                 continue
  *             if best_pos is None or match.start() < best_pos:             # <<<<<<<<<<<<<<
@@ -10782,7 +10831,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":627
+      /* "lxml/html/clean.py":635
  *     while 1:
  *         best_match, best_pos = None, None
  *         for regex in link_regexes:             # <<<<<<<<<<<<<<
@@ -10793,7 +10842,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":645
+    /* "lxml/html/clean.py":653
  *                 best_match = match
  *                 best_pos = match.start()
  *         if best_match is None:             # <<<<<<<<<<<<<<
@@ -10804,7 +10853,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     __pyx_t_12 = (__pyx_t_8 != 0);
     if (__pyx_t_12) {
 
-      /* "lxml/html/clean.py":647
+      /* "lxml/html/clean.py":655
  *         if best_match is None:
  *             # No more matches
  *             if links:             # <<<<<<<<<<<<<<
@@ -10814,7 +10863,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       __pyx_t_12 = (PyList_GET_SIZE(__pyx_v_links) != 0);
       if (__pyx_t_12) {
 
-        /* "lxml/html/clean.py":648
+        /* "lxml/html/clean.py":656
  *             # No more matches
  *             if links:
  *                 assert not links[-1].tail             # <<<<<<<<<<<<<<
@@ -10823,33 +10872,33 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
         #ifndef CYTHON_WITHOUT_ASSERTIONS
         if (unlikely(!Py_OptimizeFlag)) {
-          __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
+          __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
-          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
+          __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 648, __pyx_L1_error)
+          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           if (unlikely(!((!__pyx_t_12) != 0))) {
             PyErr_SetNone(PyExc_AssertionError);
-            __PYX_ERR(0, 648, __pyx_L1_error)
+            __PYX_ERR(0, 656, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "lxml/html/clean.py":649
+        /* "lxml/html/clean.py":657
  *             if links:
  *                 assert not links[-1].tail
  *                 links[-1].tail = text             # <<<<<<<<<<<<<<
  *             else:
  *                 assert not leading_text
  */
-        __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 657, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 657, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":647
+        /* "lxml/html/clean.py":655
  *         if best_match is None:
  *             # No more matches
  *             if links:             # <<<<<<<<<<<<<<
@@ -10859,7 +10908,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         goto __pyx_L19;
       }
 
-      /* "lxml/html/clean.py":651
+      /* "lxml/html/clean.py":659
  *                 links[-1].tail = text
  *             else:
  *                 assert not leading_text             # <<<<<<<<<<<<<<
@@ -10869,15 +10918,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       /*else*/ {
         #ifndef CYTHON_WITHOUT_ASSERTIONS
         if (unlikely(!Py_OptimizeFlag)) {
-          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
+          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
           if (unlikely(!((!__pyx_t_12) != 0))) {
             PyErr_SetNone(PyExc_AssertionError);
-            __PYX_ERR(0, 651, __pyx_L1_error)
+            __PYX_ERR(0, 659, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "lxml/html/clean.py":652
+        /* "lxml/html/clean.py":660
  *             else:
  *                 assert not leading_text
  *                 leading_text = text             # <<<<<<<<<<<<<<
@@ -10889,7 +10938,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       }
       __pyx_L19:;
 
-      /* "lxml/html/clean.py":653
+      /* "lxml/html/clean.py":661
  *                 assert not leading_text
  *                 leading_text = text
  *             break             # <<<<<<<<<<<<<<
@@ -10898,7 +10947,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       goto __pyx_L4_break;
 
-      /* "lxml/html/clean.py":645
+      /* "lxml/html/clean.py":653
  *                 best_match = match
  *                 best_pos = match.start()
  *         if best_match is None:             # <<<<<<<<<<<<<<
@@ -10907,14 +10956,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":654
+    /* "lxml/html/clean.py":662
  *                 leading_text = text
  *             break
  *         link = best_match.group(0)             # <<<<<<<<<<<<<<
  *         end = best_match.end()
  *         if link.endswith('.') or link.endswith(','):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10928,20 +10977,20 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_int_0) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_int_0);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":655
+    /* "lxml/html/clean.py":663
  *             break
  *         link = best_match.group(0)
  *         end = best_match.end()             # <<<<<<<<<<<<<<
  *         if link.endswith('.') or link.endswith(','):
  *             # These punctuation marks shouldn't end a link
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 655, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10955,20 +11004,20 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":656
+    /* "lxml/html/clean.py":664
  *         link = best_match.group(0)
  *         end = best_match.end()
  *         if link.endswith('.') or link.endswith(','):             # <<<<<<<<<<<<<<
  *             # These punctuation marks shouldn't end a link
  *             end -= 1
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10982,17 +11031,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__15) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__15);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (!__pyx_t_8) {
     } else {
       __pyx_t_12 = __pyx_t_8;
       goto __pyx_L21_bool_binop_done;
     }
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 656, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11006,40 +11055,40 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_kp_s__16) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__16);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 656, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 664, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_12 = __pyx_t_8;
     __pyx_L21_bool_binop_done:;
     if (__pyx_t_12) {
 
-      /* "lxml/html/clean.py":658
+      /* "lxml/html/clean.py":666
  *         if link.endswith('.') or link.endswith(','):
  *             # These punctuation marks shouldn't end a link
  *             end -= 1             # <<<<<<<<<<<<<<
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]
  */
-      __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_end, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 658, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_end, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 666, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF_SET(__pyx_v_end, __pyx_t_6);
       __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":659
+      /* "lxml/html/clean.py":667
  *             # These punctuation marks shouldn't end a link
  *             end -= 1
  *             link = link[:-1]             # <<<<<<<<<<<<<<
  *         prev_text = text[:best_match.start()]
  *         if links:
  */
-      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_link, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 659, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_link, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF_SET(__pyx_v_link, __pyx_t_6);
       __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":656
+      /* "lxml/html/clean.py":664
  *         link = best_match.group(0)
  *         end = best_match.end()
  *         if link.endswith('.') or link.endswith(','):             # <<<<<<<<<<<<<<
@@ -11048,14 +11097,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":660
+    /* "lxml/html/clean.py":668
  *             end -= 1
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]             # <<<<<<<<<<<<<<
  *         if links:
  *             assert not links[-1].tail
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11069,16 +11118,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, NULL, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 660, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, NULL, &__pyx_t_6, NULL, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_XDECREF_SET(__pyx_v_prev_text, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":661
+    /* "lxml/html/clean.py":669
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]
  *         if links:             # <<<<<<<<<<<<<<
@@ -11088,7 +11137,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     __pyx_t_12 = (PyList_GET_SIZE(__pyx_v_links) != 0);
     if (__pyx_t_12) {
 
-      /* "lxml/html/clean.py":662
+      /* "lxml/html/clean.py":670
  *         prev_text = text[:best_match.start()]
  *         if links:
  *             assert not links[-1].tail             # <<<<<<<<<<<<<<
@@ -11097,33 +11146,33 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       #ifndef CYTHON_WITHOUT_ASSERTIONS
       if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
-        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 662, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_tail); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 670, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 662, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         if (unlikely(!((!__pyx_t_12) != 0))) {
           PyErr_SetNone(PyExc_AssertionError);
-          __PYX_ERR(0, 662, __pyx_L1_error)
+          __PYX_ERR(0, 670, __pyx_L1_error)
         }
       }
       #endif
 
-      /* "lxml/html/clean.py":663
+      /* "lxml/html/clean.py":671
  *         if links:
  *             assert not links[-1].tail
  *             links[-1].tail = prev_text             # <<<<<<<<<<<<<<
  *         else:
  *             assert not leading_text
  */
-      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 663, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 671, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_prev_text) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_prev_text) < 0) __PYX_ERR(0, 671, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":661
+      /* "lxml/html/clean.py":669
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]
  *         if links:             # <<<<<<<<<<<<<<
@@ -11133,7 +11182,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       goto __pyx_L23;
     }
 
-    /* "lxml/html/clean.py":665
+    /* "lxml/html/clean.py":673
  *             links[-1].tail = prev_text
  *         else:
  *             assert not leading_text             # <<<<<<<<<<<<<<
@@ -11143,15 +11192,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     /*else*/ {
       #ifndef CYTHON_WITHOUT_ASSERTIONS
       if (unlikely(!Py_OptimizeFlag)) {
-        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 665, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 673, __pyx_L1_error)
         if (unlikely(!((!__pyx_t_12) != 0))) {
           PyErr_SetNone(PyExc_AssertionError);
-          __PYX_ERR(0, 665, __pyx_L1_error)
+          __PYX_ERR(0, 673, __pyx_L1_error)
         }
       }
       #endif
 
-      /* "lxml/html/clean.py":666
+      /* "lxml/html/clean.py":674
  *         else:
  *             assert not leading_text
  *             leading_text = prev_text             # <<<<<<<<<<<<<<
@@ -11163,7 +11212,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_L23:;
 
-    /* "lxml/html/clean.py":667
+    /* "lxml/html/clean.py":675
  *             assert not leading_text
  *             leading_text = prev_text
  *         anchor = factory('a')             # <<<<<<<<<<<<<<
@@ -11183,20 +11232,20 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_n_s_a) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_a);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 675, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF_SET(__pyx_v_anchor, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":668
+    /* "lxml/html/clean.py":676
  *             leading_text = prev_text
  *         anchor = factory('a')
  *         anchor.set('href', link)             # <<<<<<<<<<<<<<
  *         body = best_match.group('body')
  *         if not body:
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_anchor, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_anchor, __pyx_n_s_set); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 676, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     __pyx_t_13 = 0;
@@ -11213,7 +11262,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_href, __pyx_v_link};
-      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_6);
     } else
@@ -11221,13 +11270,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
       PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_n_s_href, __pyx_v_link};
-      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_13, 2+__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_6);
     } else
     #endif
     {
-      __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 676, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       if (__pyx_t_7) {
         __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7); __pyx_t_7 = NULL;
@@ -11238,21 +11287,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       __Pyx_INCREF(__pyx_v_link);
       __Pyx_GIVEREF(__pyx_v_link);
       PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_13, __pyx_v_link);
-      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 668, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":669
+    /* "lxml/html/clean.py":677
  *         anchor = factory('a')
  *         anchor.set('href', link)
  *         body = best_match.group('body')             # <<<<<<<<<<<<<<
  *         if not body:
  *             body = link
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 669, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_best_match, __pyx_n_s_group); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11266,24 +11315,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_n_s_body) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_n_s_body);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_XDECREF_SET(__pyx_v_body, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":670
+    /* "lxml/html/clean.py":678
  *         anchor.set('href', link)
  *         body = best_match.group('body')
  *         if not body:             # <<<<<<<<<<<<<<
  *             body = link
  *         if body.endswith('.') or body.endswith(','):
  */
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 678, __pyx_L1_error)
     __pyx_t_8 = ((!__pyx_t_12) != 0);
     if (__pyx_t_8) {
 
-      /* "lxml/html/clean.py":671
+      /* "lxml/html/clean.py":679
  *         body = best_match.group('body')
  *         if not body:
  *             body = link             # <<<<<<<<<<<<<<
@@ -11293,7 +11342,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       __Pyx_INCREF(__pyx_v_link);
       __Pyx_DECREF_SET(__pyx_v_body, __pyx_v_link);
 
-      /* "lxml/html/clean.py":670
+      /* "lxml/html/clean.py":678
  *         anchor.set('href', link)
  *         body = best_match.group('body')
  *         if not body:             # <<<<<<<<<<<<<<
@@ -11302,14 +11351,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":672
+    /* "lxml/html/clean.py":680
  *         if not body:
  *             body = link
  *         if body.endswith('.') or body.endswith(','):             # <<<<<<<<<<<<<<
  *             body = body[:-1]
  *         anchor.text = body
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11323,17 +11372,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s__15) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__15);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (!__pyx_t_12) {
     } else {
       __pyx_t_8 = __pyx_t_12;
       goto __pyx_L26_bool_binop_done;
     }
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 672, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_body, __pyx_n_s_endswith); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11347,28 +11396,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_kp_s__16) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s__16);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 680, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_8 = __pyx_t_12;
     __pyx_L26_bool_binop_done:;
     if (__pyx_t_8) {
 
-      /* "lxml/html/clean.py":673
+      /* "lxml/html/clean.py":681
  *             body = link
  *         if body.endswith('.') or body.endswith(','):
  *             body = body[:-1]             # <<<<<<<<<<<<<<
  *         anchor.text = body
  *         links.append(anchor)
  */
-      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_body, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 673, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_body, 0, -1L, NULL, NULL, &__pyx_slice__17, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 681, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF_SET(__pyx_v_body, __pyx_t_6);
       __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":672
+      /* "lxml/html/clean.py":680
  *         if not body:
  *             body = link
  *         if body.endswith('.') or body.endswith(','):             # <<<<<<<<<<<<<<
@@ -11377,39 +11426,39 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":674
+    /* "lxml/html/clean.py":682
  *         if body.endswith('.') or body.endswith(','):
  *             body = body[:-1]
  *         anchor.text = body             # <<<<<<<<<<<<<<
  *         links.append(anchor)
  *         text = text[end:]
  */
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_anchor, __pyx_n_s_text, __pyx_v_body) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_anchor, __pyx_n_s_text, __pyx_v_body) < 0) __PYX_ERR(0, 682, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":675
+    /* "lxml/html/clean.py":683
  *             body = body[:-1]
  *         anchor.text = body
  *         links.append(anchor)             # <<<<<<<<<<<<<<
  *         text = text[end:]
  *     return leading_text, links
  */
-    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 675, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyList_Append(__pyx_v_links, __pyx_v_anchor); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(0, 683, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":676
+    /* "lxml/html/clean.py":684
  *         anchor.text = body
  *         links.append(anchor)
  *         text = text[end:]             # <<<<<<<<<<<<<<
  *     return leading_text, links
  * 
  */
-    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, &__pyx_v_end, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_text, 0, 0, &__pyx_v_end, NULL, NULL, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 684, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_6);
     __pyx_t_6 = 0;
   }
   __pyx_L4_break:;
 
-  /* "lxml/html/clean.py":677
+  /* "lxml/html/clean.py":685
  *         links.append(anchor)
  *         text = text[end:]
  *     return leading_text, links             # <<<<<<<<<<<<<<
@@ -11417,7 +11466,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  * def autolink_html(html, *args, **kw):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 685, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(__pyx_v_leading_text);
   __Pyx_GIVEREF(__pyx_v_leading_text);
@@ -11429,7 +11478,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
   __pyx_t_6 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":621
+  /* "lxml/html/clean.py":629
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
@@ -11467,7 +11516,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":679
+/* "lxml/html/clean.py":687
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -11521,7 +11570,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7autolink_html(PyObject *__pyx_self
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "autolink_html") < 0)) __PYX_ERR(0, 679, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "autolink_html") < 0)) __PYX_ERR(0, 687, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -11532,7 +11581,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7autolink_html(PyObject *__pyx_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("autolink_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 679, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("autolink_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 687, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
@@ -11566,7 +11615,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("autolink_html", 0);
 
-  /* "lxml/html/clean.py":680
+  /* "lxml/html/clean.py":688
  * 
  * def autolink_html(html, *args, **kw):
  *     result_type = type(html)             # <<<<<<<<<<<<<<
@@ -11576,28 +11625,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
   __pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
 
-  /* "lxml/html/clean.py":681
+  /* "lxml/html/clean.py":689
  * def autolink_html(html, *args, **kw):
  *     result_type = type(html)
  *     if isinstance(html, basestring):             # <<<<<<<<<<<<<<
  *         doc = fromstring(html)
  *     else:
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 689, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 681, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsInstance(__pyx_v_html, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":682
+    /* "lxml/html/clean.py":690
  *     result_type = type(html)
  *     if isinstance(html, basestring):
  *         doc = fromstring(html)             # <<<<<<<<<<<<<<
  *     else:
  *         doc = copy.deepcopy(html)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 690, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -11611,13 +11660,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
     }
     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_html);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 690, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_doc = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":681
+    /* "lxml/html/clean.py":689
  * def autolink_html(html, *args, **kw):
  *     result_type = type(html)
  *     if isinstance(html, basestring):             # <<<<<<<<<<<<<<
@@ -11627,7 +11676,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
     goto __pyx_L3;
   }
 
-  /* "lxml/html/clean.py":684
+  /* "lxml/html/clean.py":692
  *         doc = fromstring(html)
  *     else:
  *         doc = copy.deepcopy(html)             # <<<<<<<<<<<<<<
@@ -11635,9 +11684,9 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
  *     return _transform_result(result_type, doc)
  */
   /*else*/ {
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 692, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 684, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_deepcopy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = NULL;
@@ -11652,7 +11701,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
     }
     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_html);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_doc = __pyx_t_1;
@@ -11660,30 +11709,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   }
   __pyx_L3:;
 
-  /* "lxml/html/clean.py":685
+  /* "lxml/html/clean.py":693
  *     else:
  *         doc = copy.deepcopy(html)
  *     autolink(doc, *args, **kw)             # <<<<<<<<<<<<<<
  *     return _transform_result(result_type, doc)
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_doc);
   __Pyx_GIVEREF(__pyx_v_doc);
   PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_doc);
-  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_v_kw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":686
+  /* "lxml/html/clean.py":694
  *         doc = copy.deepcopy(html)
  *     autolink(doc, *args, **kw)
  *     return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -11691,7 +11740,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
  * autolink_html.__doc__ = autolink.__doc__
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 694, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_1 = NULL;
   __pyx_t_6 = 0;
@@ -11708,7 +11757,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
@@ -11716,13 +11765,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 694, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_1) {
       __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
@@ -11733,7 +11782,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
     __Pyx_INCREF(__pyx_v_doc);
     __Pyx_GIVEREF(__pyx_v_doc);
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_doc);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 686, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 694, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -11742,7 +11791,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":679
+  /* "lxml/html/clean.py":687
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -11766,7 +11815,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":697
+/* "lxml/html/clean.py":705
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
@@ -11784,7 +11833,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_18__defaults__(CYTHON_UNUSED PyObje
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__defaults__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_int_40));
   __Pyx_GIVEREF(((PyObject *)__pyx_int_40));
@@ -11798,7 +11847,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_18__defaults__(CYTHON_UNUSED PyObje
   __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
   __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
   PyTuple_SET_ITEM(__pyx_t_1, 3, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_break_character);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 705, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
@@ -11894,7 +11943,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_9word_break(PyObject *__pyx_self, P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "word_break") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "word_break") < 0)) __PYX_ERR(0, 705, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11919,7 +11968,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_9word_break(PyObject *__pyx_self, P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("word_break", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("word_break", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 705, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.word_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11955,24 +12004,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("word_break", 0);
 
-  /* "lxml/html/clean.py":716
+  /* "lxml/html/clean.py":724
  *     # Character suggestion of &#8203 comes from:
  *     #   http://www.cs.tut.fi/~jkorpela/html/nobr.html
  *     if el.tag in _avoid_word_break_elements:             # <<<<<<<<<<<<<<
  *         return
  *     class_name = el.get('class')
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 724, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 716, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_t_2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 724, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (__pyx_t_4) {
 
-    /* "lxml/html/clean.py":717
+    /* "lxml/html/clean.py":725
  *     #   http://www.cs.tut.fi/~jkorpela/html/nobr.html
  *     if el.tag in _avoid_word_break_elements:
  *         return             # <<<<<<<<<<<<<<
@@ -11983,7 +12032,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":716
+    /* "lxml/html/clean.py":724
  *     # Character suggestion of &#8203 comes from:
  *     #   http://www.cs.tut.fi/~jkorpela/html/nobr.html
  *     if el.tag in _avoid_word_break_elements:             # <<<<<<<<<<<<<<
@@ -11992,14 +12041,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":718
+  /* "lxml/html/clean.py":726
  *     if el.tag in _avoid_word_break_elements:
  *         return
  *     class_name = el.get('class')             # <<<<<<<<<<<<<<
  *     if class_name:
  *         dont_break = False
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 726, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -12013,23 +12062,23 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
   }
   __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_n_s_class) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_n_s_class);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 726, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_class_name = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":719
+  /* "lxml/html/clean.py":727
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
  *         dont_break = False
  *         class_name = class_name.split()
  */
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 727, __pyx_L1_error)
   if (__pyx_t_4) {
 
-    /* "lxml/html/clean.py":720
+    /* "lxml/html/clean.py":728
  *     class_name = el.get('class')
  *     if class_name:
  *         dont_break = False             # <<<<<<<<<<<<<<
@@ -12038,14 +12087,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     __pyx_v_dont_break = 0;
 
-    /* "lxml/html/clean.py":721
+    /* "lxml/html/clean.py":729
  *     if class_name:
  *         dont_break = False
  *         class_name = class_name.split()             # <<<<<<<<<<<<<<
  *         for avoid in avoid_classes:
  *             if avoid in class_name:
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 721, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_class_name, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -12059,13 +12108,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     }
     __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF_SET(__pyx_v_class_name, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":722
+    /* "lxml/html/clean.py":730
  *         dont_break = False
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:             # <<<<<<<<<<<<<<
@@ -12076,26 +12125,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       __pyx_t_2 = __pyx_v_avoid_classes; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
     } else {
-      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 722, __pyx_L1_error)
+      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_avoid_classes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __pyx_L1_error)
+      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_7)) {
         if (likely(PyList_CheckExact(__pyx_t_2))) {
           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
+          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         } else {
           if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 722, __pyx_L1_error)
+          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 722, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -12105,7 +12154,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(0, 722, __pyx_L1_error)
+            else __PYX_ERR(0, 730, __pyx_L1_error)
           }
           break;
         }
@@ -12114,18 +12163,18 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       __Pyx_XDECREF_SET(__pyx_v_avoid, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":723
+      /* "lxml/html/clean.py":731
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:
  *             if avoid in class_name:             # <<<<<<<<<<<<<<
  *                 dont_break = True
  *                 break
  */
-      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_avoid, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 723, __pyx_L1_error)
+      __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_v_avoid, __pyx_v_class_name, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 731, __pyx_L1_error)
       __pyx_t_3 = (__pyx_t_4 != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/html/clean.py":724
+        /* "lxml/html/clean.py":732
  *         for avoid in avoid_classes:
  *             if avoid in class_name:
  *                 dont_break = True             # <<<<<<<<<<<<<<
@@ -12134,7 +12183,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
         __pyx_v_dont_break = 1;
 
-        /* "lxml/html/clean.py":725
+        /* "lxml/html/clean.py":733
  *             if avoid in class_name:
  *                 dont_break = True
  *                 break             # <<<<<<<<<<<<<<
@@ -12143,7 +12192,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
         goto __pyx_L6_break;
 
-        /* "lxml/html/clean.py":723
+        /* "lxml/html/clean.py":731
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:
  *             if avoid in class_name:             # <<<<<<<<<<<<<<
@@ -12152,7 +12201,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":722
+      /* "lxml/html/clean.py":730
  *         dont_break = False
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:             # <<<<<<<<<<<<<<
@@ -12163,7 +12212,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __pyx_L6_break:;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":726
+    /* "lxml/html/clean.py":734
  *                 dont_break = True
  *                 break
  *         if dont_break:             # <<<<<<<<<<<<<<
@@ -12173,7 +12222,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __pyx_t_3 = (__pyx_v_dont_break != 0);
     if (__pyx_t_3) {
 
-      /* "lxml/html/clean.py":727
+      /* "lxml/html/clean.py":735
  *                 break
  *         if dont_break:
  *             return             # <<<<<<<<<<<<<<
@@ -12184,7 +12233,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       __pyx_r = Py_None; __Pyx_INCREF(Py_None);
       goto __pyx_L0;
 
-      /* "lxml/html/clean.py":726
+      /* "lxml/html/clean.py":734
  *                 dont_break = True
  *                 break
  *         if dont_break:             # <<<<<<<<<<<<<<
@@ -12193,7 +12242,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":719
+    /* "lxml/html/clean.py":727
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
@@ -12202,29 +12251,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":728
+  /* "lxml/html/clean.py":736
  *         if dont_break:
  *             return
  *     if el.text:             # <<<<<<<<<<<<<<
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 736, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 736, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":729
+    /* "lxml/html/clean.py":737
  *             return
  *     if el.text:
  *         el.text = _break_text(el.text, max_width, break_character)             # <<<<<<<<<<<<<<
  *     for child in el:
  *         word_break(child, max_width=max_width,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_break_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_break_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 737, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 729, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 737, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_8 = NULL;
     __pyx_t_9 = 0;
@@ -12241,7 +12290,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_5, __pyx_v_max_width, __pyx_v_break_character};
-      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -12250,14 +12299,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
       PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_t_5, __pyx_v_max_width, __pyx_v_break_character};
-      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     } else
     #endif
     {
-      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 729, __pyx_L1_error)
+      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 737, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       if (__pyx_t_8) {
         __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -12271,15 +12320,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       __Pyx_GIVEREF(__pyx_v_break_character);
       PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_break_character);
       __pyx_t_5 = 0;
-      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 729, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 737, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_t_2) < 0) __PYX_ERR(0, 737, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":728
+    /* "lxml/html/clean.py":736
  *         if dont_break:
  *             return
  *     if el.text:             # <<<<<<<<<<<<<<
@@ -12288,7 +12337,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":730
+  /* "lxml/html/clean.py":738
  *     if el.text:
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:             # <<<<<<<<<<<<<<
@@ -12299,26 +12348,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __pyx_t_2 = __pyx_v_el; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
     __pyx_t_7 = NULL;
   } else {
-    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_el); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 730, __pyx_L1_error)
+    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_el); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 738, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 730, __pyx_L1_error)
+    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 738, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_7)) {
       if (likely(PyList_CheckExact(__pyx_t_2))) {
         if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
+        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 738, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       } else {
         if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 730, __pyx_L1_error)
+        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 738, __pyx_L1_error)
         #else
-        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 730, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 738, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       }
@@ -12328,7 +12377,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 730, __pyx_L1_error)
+          else __PYX_ERR(0, 738, __pyx_L1_error)
         }
         break;
       }
@@ -12337,88 +12386,88 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
     __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "lxml/html/clean.py":731
+    /* "lxml/html/clean.py":739
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:
  *         word_break(child, max_width=max_width,             # <<<<<<<<<<<<<<
  *                    avoid_elements=avoid_elements,
  *                    avoid_classes=avoid_classes,
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 731, __pyx_L1_error)
+    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     __Pyx_INCREF(__pyx_v_child);
     __Pyx_GIVEREF(__pyx_v_child);
     PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_child);
-    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":732
+    /* "lxml/html/clean.py":740
  *     for child in el:
  *         word_break(child, max_width=max_width,
  *                    avoid_elements=avoid_elements,             # <<<<<<<<<<<<<<
  *                    avoid_classes=avoid_classes,
  *                    break_character=break_character)
  */
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":733
+    /* "lxml/html/clean.py":741
  *         word_break(child, max_width=max_width,
  *                    avoid_elements=avoid_elements,
  *                    avoid_classes=avoid_classes,             # <<<<<<<<<<<<<<
  *                    break_character=break_character)
  *         if child.tail:
  */
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":734
+    /* "lxml/html/clean.py":742
  *                    avoid_elements=avoid_elements,
  *                    avoid_classes=avoid_classes,
  *                    break_character=break_character)             # <<<<<<<<<<<<<<
  *         if child.tail:
  *             child.tail = _break_text(child.tail, max_width, break_character)
  */
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_break_character, __pyx_v_break_character) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_break_character, __pyx_v_break_character) < 0) __PYX_ERR(0, 739, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":731
+    /* "lxml/html/clean.py":739
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:
  *         word_break(child, max_width=max_width,             # <<<<<<<<<<<<<<
  *                    avoid_elements=avoid_elements,
  *                    avoid_classes=avoid_classes,
  */
-    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 731, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-    /* "lxml/html/clean.py":735
+    /* "lxml/html/clean.py":743
  *                    avoid_classes=avoid_classes,
  *                    break_character=break_character)
  *         if child.tail:             # <<<<<<<<<<<<<<
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 735, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 743, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 743, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     if (__pyx_t_3) {
 
-      /* "lxml/html/clean.py":736
+      /* "lxml/html/clean.py":744
  *                    break_character=break_character)
  *         if child.tail:
  *             child.tail = _break_text(child.tail, max_width, break_character)             # <<<<<<<<<<<<<<
  * 
  * def word_break_html(html, *args, **kw):
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_break_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_break_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 736, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_child, __pyx_n_s_tail); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 744, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __pyx_t_1 = NULL;
       __pyx_t_9 = 0;
@@ -12435,7 +12484,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_10, __pyx_v_max_width, __pyx_v_break_character};
-        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
@@ -12444,14 +12493,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[4] = {__pyx_t_1, __pyx_t_10, __pyx_v_max_width, __pyx_v_break_character};
-        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       } else
       #endif
       {
-        __pyx_t_11 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 736, __pyx_L1_error)
+        __pyx_t_11 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 744, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         if (__pyx_t_1) {
           __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_1); __pyx_t_1 = NULL;
@@ -12465,15 +12514,15 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
         __Pyx_GIVEREF(__pyx_v_break_character);
         PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_9, __pyx_v_break_character);
         __pyx_t_10 = 0;
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 736, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 744, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_t_8) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_t_8) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "lxml/html/clean.py":735
+      /* "lxml/html/clean.py":743
  *                    avoid_classes=avoid_classes,
  *                    break_character=break_character)
  *         if child.tail:             # <<<<<<<<<<<<<<
@@ -12482,7 +12531,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":730
+    /* "lxml/html/clean.py":738
  *     if el.text:
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:             # <<<<<<<<<<<<<<
@@ -12492,7 +12541,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":697
+  /* "lxml/html/clean.py":705
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
@@ -12521,7 +12570,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":738
+/* "lxml/html/clean.py":746
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -12575,7 +12624,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_11word_break_html(PyObject *__pyx_s
       }
       if (unlikely(kw_args > 0)) {
         const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "word_break_html") < 0)) __PYX_ERR(0, 738, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, used_pos_args, "word_break_html") < 0)) __PYX_ERR(0, 746, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -12586,7 +12635,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_11word_break_html(PyObject *__pyx_s
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("word_break_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 738, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("word_break_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 746, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
@@ -12618,7 +12667,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("word_break_html", 0);
 
-  /* "lxml/html/clean.py":739
+  /* "lxml/html/clean.py":747
  * 
  * def word_break_html(html, *args, **kw):
  *     result_type = type(html)             # <<<<<<<<<<<<<<
@@ -12628,14 +12677,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_html)));
   __pyx_v_result_type = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_html)));
 
-  /* "lxml/html/clean.py":740
+  /* "lxml/html/clean.py":748
  * def word_break_html(html, *args, **kw):
  *     result_type = type(html)
  *     doc = fromstring(html)             # <<<<<<<<<<<<<<
  *     word_break(doc, *args, **kw)
  *     return _transform_result(result_type, doc)
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -12649,36 +12698,36 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_html) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_html);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 748, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_doc = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":741
+  /* "lxml/html/clean.py":749
  *     result_type = type(html)
  *     doc = fromstring(html)
  *     word_break(doc, *args, **kw)             # <<<<<<<<<<<<<<
  *     return _transform_result(result_type, doc)
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_doc);
   __Pyx_GIVEREF(__pyx_v_doc);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_doc);
-  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":742
+  /* "lxml/html/clean.py":750
  *     doc = fromstring(html)
  *     word_break(doc, *args, **kw)
  *     return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -12686,7 +12735,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
  * def _break_text(text, max_width, break_character):
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 750, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_1 = NULL;
   __pyx_t_4 = 0;
@@ -12703,7 +12752,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -12711,13 +12760,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_result_type), __pyx_v_doc};
-    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 750, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     if (__pyx_t_1) {
       __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); __pyx_t_1 = NULL;
@@ -12728,7 +12777,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
     __Pyx_INCREF(__pyx_v_doc);
     __Pyx_GIVEREF(__pyx_v_doc);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_doc);
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 742, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 750, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -12737,7 +12786,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":738
+  /* "lxml/html/clean.py":746
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -12761,7 +12810,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":744
+/* "lxml/html/clean.py":752
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
@@ -12807,17 +12856,17 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_13_break_text(PyObject *__pyx_self,
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_width)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 1); __PYX_ERR(0, 744, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 1); __PYX_ERR(0, 752, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_break_character)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 2); __PYX_ERR(0, 744, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 2); __PYX_ERR(0, 752, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_break_text") < 0)) __PYX_ERR(0, 744, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_break_text") < 0)) __PYX_ERR(0, 752, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -12832,7 +12881,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_13_break_text(PyObject *__pyx_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 744, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 752, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._break_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -12867,14 +12916,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   __Pyx_RefNannySetupContext("_break_text", 0);
   __Pyx_INCREF(__pyx_v_text);
 
-  /* "lxml/html/clean.py":745
+  /* "lxml/html/clean.py":753
  * 
  * def _break_text(text, max_width, break_character):
  *     words = text.split()             # <<<<<<<<<<<<<<
  *     for word in words:
  *         if len(word) > max_width:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_split); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -12888,13 +12937,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_words = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":746
+  /* "lxml/html/clean.py":754
  * def _break_text(text, max_width, break_character):
  *     words = text.split()
  *     for word in words:             # <<<<<<<<<<<<<<
@@ -12905,26 +12954,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
     __pyx_t_1 = __pyx_v_words; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
     __pyx_t_5 = NULL;
   } else {
-    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 746, __pyx_L1_error)
+    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_words); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 754, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_5)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
+        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
         #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         #endif
       } else {
         if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 746, __pyx_L1_error)
+        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 754, __pyx_L1_error)
         #else
-        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
+        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 754, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         #endif
       }
@@ -12934,7 +12983,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(0, 746, __pyx_L1_error)
+          else __PYX_ERR(0, 754, __pyx_L1_error)
         }
         break;
       }
@@ -12943,30 +12992,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
     __Pyx_XDECREF_SET(__pyx_v_word, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":747
+    /* "lxml/html/clean.py":755
  *     words = text.split()
  *     for word in words:
  *         if len(word) > max_width:             # <<<<<<<<<<<<<<
  *             replacement = _insert_break(word, max_width, break_character)
  *             text = text.replace(word, replacement)
  */
-    __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 747, __pyx_L1_error)
-    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __pyx_t_6 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 755, __pyx_L1_error)
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_max_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 755, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_7) {
 
-      /* "lxml/html/clean.py":748
+      /* "lxml/html/clean.py":756
  *     for word in words:
  *         if len(word) > max_width:
  *             replacement = _insert_break(word, max_width, break_character)             # <<<<<<<<<<<<<<
  *             text = text.replace(word, replacement)
  *     return text
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_insert_break); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_insert_break); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 756, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_8 = NULL;
       __pyx_t_9 = 0;
@@ -12983,7 +13032,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_word, __pyx_v_max_width, __pyx_v_break_character};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -12991,13 +13040,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_word, __pyx_v_max_width, __pyx_v_break_character};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 3+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
       #endif
       {
-        __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 748, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 756, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         if (__pyx_t_8) {
           __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -13011,7 +13060,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
         __Pyx_INCREF(__pyx_v_break_character);
         __Pyx_GIVEREF(__pyx_v_break_character);
         PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_9, __pyx_v_break_character);
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 748, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 756, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -13019,14 +13068,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       __Pyx_XDECREF_SET(__pyx_v_replacement, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/html/clean.py":749
+      /* "lxml/html/clean.py":757
  *         if len(word) > max_width:
  *             replacement = _insert_break(word, max_width, break_character)
  *             text = text.replace(word, replacement)             # <<<<<<<<<<<<<<
  *     return text
  * 
  */
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 749, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_10 = NULL;
       __pyx_t_9 = 0;
@@ -13043,7 +13092,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_word, __pyx_v_replacement};
-        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -13051,13 +13100,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
         PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_v_word, __pyx_v_replacement};
-        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 749, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 757, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         if (__pyx_t_10) {
           __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_10); __pyx_t_10 = NULL;
@@ -13068,7 +13117,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
         __Pyx_INCREF(__pyx_v_replacement);
         __Pyx_GIVEREF(__pyx_v_replacement);
         PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_v_replacement);
-        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -13076,7 +13125,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
       __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_3);
       __pyx_t_3 = 0;
 
-      /* "lxml/html/clean.py":747
+      /* "lxml/html/clean.py":755
  *     words = text.split()
  *     for word in words:
  *         if len(word) > max_width:             # <<<<<<<<<<<<<<
@@ -13085,7 +13134,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
  */
     }
 
-    /* "lxml/html/clean.py":746
+    /* "lxml/html/clean.py":754
  * def _break_text(text, max_width, break_character):
  *     words = text.split()
  *     for word in words:             # <<<<<<<<<<<<<<
@@ -13095,7 +13144,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":750
+  /* "lxml/html/clean.py":758
  *             replacement = _insert_break(word, max_width, break_character)
  *             text = text.replace(word, replacement)
  *     return text             # <<<<<<<<<<<<<<
@@ -13107,7 +13156,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   __pyx_r = __pyx_v_text;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":744
+  /* "lxml/html/clean.py":752
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
@@ -13134,7 +13183,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":754
+/* "lxml/html/clean.py":762
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
@@ -13180,17 +13229,17 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_15_insert_break(PyObject *__pyx_sel
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 1); __PYX_ERR(0, 754, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 1); __PYX_ERR(0, 762, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_break_character)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 2); __PYX_ERR(0, 754, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 2); __PYX_ERR(0, 762, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_insert_break") < 0)) __PYX_ERR(0, 754, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_insert_break") < 0)) __PYX_ERR(0, 762, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -13205,7 +13254,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_15_insert_break(PyObject *__pyx_sel
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 754, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 762, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._insert_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -13237,7 +13286,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
   __Pyx_RefNannySetupContext("_insert_break", 0);
   __Pyx_INCREF(__pyx_v_word);
 
-  /* "lxml/html/clean.py":755
+  /* "lxml/html/clean.py":763
  * 
  * def _insert_break(word, width, break_character):
  *     orig_word = word             # <<<<<<<<<<<<<<
@@ -13247,7 +13296,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
   __Pyx_INCREF(__pyx_v_word);
   __pyx_v_orig_word = __pyx_v_word;
 
-  /* "lxml/html/clean.py":756
+  /* "lxml/html/clean.py":764
  * def _insert_break(word, width, break_character):
  *     orig_word = word
  *     result = ''             # <<<<<<<<<<<<<<
@@ -13257,7 +13306,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
   __Pyx_INCREF(__pyx_kp_s__2);
   __pyx_v_result = __pyx_kp_s__2;
 
-  /* "lxml/html/clean.py":757
+  /* "lxml/html/clean.py":765
  *     orig_word = word
  *     result = ''
  *     while len(word) > width:             # <<<<<<<<<<<<<<
@@ -13265,37 +13314,37 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  *         breaks = list(_break_prefer_re.finditer(start))
  */
   while (1) {
-    __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 757, __pyx_L1_error)
-    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 757, __pyx_L1_error)
+    __pyx_t_1 = PyObject_Length(__pyx_v_word); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 765, __pyx_L1_error)
+    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 757, __pyx_L1_error)
+    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_width, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 765, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 765, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (!__pyx_t_4) break;
 
-    /* "lxml/html/clean.py":758
+    /* "lxml/html/clean.py":766
  *     result = ''
  *     while len(word) > width:
  *         start = word[:width]             # <<<<<<<<<<<<<<
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:
  */
-    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_v_width, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 758, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_v_width, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "lxml/html/clean.py":759
+    /* "lxml/html/clean.py":767
  *     while len(word) > width:
  *         start = word[:width]
  *         breaks = list(_break_prefer_re.finditer(start))             # <<<<<<<<<<<<<<
  *         if breaks:
  *             last_break = breaks[-1]
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_break_prefer_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_break_prefer_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finditer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_finditer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_2 = NULL;
@@ -13310,16 +13359,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
     }
     __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_2, __pyx_v_start) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_start);
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
+    __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF_SET(__pyx_v_breaks, ((PyObject*)__pyx_t_5));
     __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":760
+    /* "lxml/html/clean.py":768
  *         start = word[:width]
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:             # <<<<<<<<<<<<<<
@@ -13329,26 +13378,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
     __pyx_t_4 = (PyList_GET_SIZE(__pyx_v_breaks) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/html/clean.py":761
+      /* "lxml/html/clean.py":769
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:
  *             last_break = breaks[-1]             # <<<<<<<<<<<<<<
  *             # Only walk back up to 10 characters to find a nice break:
  *             if last_break.end() > width-10:
  */
-      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_breaks, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 761, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_breaks, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 769, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_XDECREF_SET(__pyx_v_last_break, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":763
+      /* "lxml/html/clean.py":771
  *             last_break = breaks[-1]
  *             # Only walk back up to 10 characters to find a nice break:
  *             if last_break.end() > width-10:             # <<<<<<<<<<<<<<
  *                 # FIXME: should the break character be at the end of the
  *                 # chunk, or the beginning of the next chunk?
  */
-      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_2 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -13362,26 +13411,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
       }
       __pyx_t_5 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 771, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_width, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 763, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_width, __pyx_int_10, 10, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 771, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 763, __pyx_L1_error)
+      __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_3, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 771, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 763, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 771, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       if (__pyx_t_4) {
 
-        /* "lxml/html/clean.py":766
+        /* "lxml/html/clean.py":774
  *                 # FIXME: should the break character be at the end of the
  *                 # chunk, or the beginning of the next chunk?
  *                 start = word[:last_break.end()]             # <<<<<<<<<<<<<<
  *         result += start + break_character
  *         word = word[len(start):]
  */
-        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_break, __pyx_n_s_end); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -13395,16 +13444,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
         }
         __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __pyx_L1_error)
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 774, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-        __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 766, __pyx_L1_error)
+        __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_word, 0, 0, NULL, &__pyx_t_2, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 774, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_3);
         __pyx_t_3 = 0;
 
-        /* "lxml/html/clean.py":763
+        /* "lxml/html/clean.py":771
  *             last_break = breaks[-1]
  *             # Only walk back up to 10 characters to find a nice break:
  *             if last_break.end() > width-10:             # <<<<<<<<<<<<<<
@@ -13413,7 +13462,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  */
       }
 
-      /* "lxml/html/clean.py":760
+      /* "lxml/html/clean.py":768
  *         start = word[:width]
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:             # <<<<<<<<<<<<<<
@@ -13422,48 +13471,48 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  */
     }
 
-    /* "lxml/html/clean.py":767
+    /* "lxml/html/clean.py":775
  *                 # chunk, or the beginning of the next chunk?
  *                 start = word[:last_break.end()]
  *         result += start + break_character             # <<<<<<<<<<<<<<
  *         word = word[len(start):]
  *     result += word
  */
-    __pyx_t_3 = PyNumber_Add(__pyx_v_start, __pyx_v_break_character); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 767, __pyx_L1_error)
+    __pyx_t_3 = PyNumber_Add(__pyx_v_start, __pyx_v_break_character); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 775, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __pyx_L1_error)
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":768
+    /* "lxml/html/clean.py":776
  *                 start = word[:last_break.end()]
  *         result += start + break_character
  *         word = word[len(start):]             # <<<<<<<<<<<<<<
  *     result += word
  *     return result
  */
-    __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 768, __pyx_L1_error)
-    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_word, __pyx_t_1, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 768, __pyx_L1_error)
+    __pyx_t_1 = PyObject_Length(__pyx_v_start); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 776, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_word, __pyx_t_1, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF_SET(__pyx_v_word, __pyx_t_2);
     __pyx_t_2 = 0;
   }
 
-  /* "lxml/html/clean.py":769
+  /* "lxml/html/clean.py":777
  *         result += start + break_character
  *         word = word[len(start):]
  *     result += word             # <<<<<<<<<<<<<<
  *     return result
  * 
  */
-  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __pyx_L1_error)
+  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 777, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "lxml/html/clean.py":770
+  /* "lxml/html/clean.py":778
  *         word = word[len(start):]
  *     result += word
  *     return result             # <<<<<<<<<<<<<<
@@ -13474,7 +13523,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
   __pyx_r = __pyx_v_result;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":754
+  /* "lxml/html/clean.py":762
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
@@ -13660,6 +13709,7 @@ static struct PyModuleDef __pyx_moduledef = {
 
 static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_s_127_0_0_1, __pyx_k_127_0_0_1, sizeof(__pyx_k_127_0_0_1), 0, 0, 1, 0},
+  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
   {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
   {&__pyx_n_s_Cleaner, __pyx_k_Cleaner, sizeof(__pyx_k_Cleaner), 0, 0, 1, 1},
   {&__pyx_n_s_Cleaner___call, __pyx_k_Cleaner___call, sizeof(__pyx_k_Cleaner___call), 0, 0, 1, 1},
@@ -13693,9 +13743,10 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_kp_s__15, __pyx_k__15, sizeof(__pyx_k__15), 0, 0, 1, 0},
   {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
   {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
-  {&__pyx_kp_s__41, __pyx_k__41, sizeof(__pyx_k__41), 0, 0, 1, 0},
+  {&__pyx_kp_s__42, __pyx_k__42, sizeof(__pyx_k__42), 0, 0, 1, 0},
   {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
   {&__pyx_kp_s_a_z, __pyx_k_a_z, sizeof(__pyx_k_a_z), 0, 0, 1, 0},
+  {&__pyx_kp_s_a_zA_Z_son_a_zA_Z_s, __pyx_k_a_zA_Z_son_a_zA_Z_s, sizeof(__pyx_k_a_zA_Z_son_a_zA_Z_s), 0, 0, 1, 0},
   {&__pyx_n_s_add_nofollow, __pyx_k_add_nofollow, sizeof(__pyx_k_add_nofollow), 0, 0, 1, 1},
   {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
   {&__pyx_n_s_allow_element, __pyx_k_allow_element, sizeof(__pyx_k_allow_element), 0, 0, 1, 1},
@@ -13747,8 +13798,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_condition, __pyx_k_condition, sizeof(__pyx_k_condition), 0, 0, 1, 1},
   {&__pyx_n_s_conditional_comment_re, __pyx_k_conditional_comment_re, sizeof(__pyx_k_conditional_comment_re), 0, 0, 1, 1},
   {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
-  {&__pyx_n_s_css_import_re, __pyx_k_css_import_re, sizeof(__pyx_k_css_import_re), 0, 0, 1, 1},
-  {&__pyx_n_s_css_javascript_re, __pyx_k_css_javascript_re, sizeof(__pyx_k_css_javascript_re), 0, 0, 1, 1},
   {&__pyx_kp_s_data_image_base64, __pyx_k_data_image_base64, sizeof(__pyx_k_data_image_base64), 0, 0, 1, 0},
   {&__pyx_n_s_deepcopy, __pyx_k_deepcopy, sizeof(__pyx_k_deepcopy), 0, 0, 1, 1},
   {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
@@ -13829,6 +13878,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_link_text, __pyx_k_link_text, sizeof(__pyx_k_link_text), 0, 0, 1, 1},
   {&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1},
   {&__pyx_kp_s_localhost, __pyx_k_localhost, sizeof(__pyx_k_localhost), 0, 0, 1, 0},
+  {&__pyx_n_s_looks_like_tag_content, __pyx_k_looks_like_tag_content, sizeof(__pyx_k_looks_like_tag_content), 0, 0, 1, 1},
   {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
   {&__pyx_n_s_lxml, __pyx_k_lxml, sizeof(__pyx_k_lxml), 0, 0, 1, 1},
   {&__pyx_n_s_lxml_html, __pyx_k_lxml_html, sizeof(__pyx_k_lxml_html), 0, 0, 1, 1},
@@ -13881,6 +13931,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_remove_tags, __pyx_k_remove_tags, sizeof(__pyx_k_remove_tags), 0, 0, 1, 1},
   {&__pyx_n_s_remove_unknown_tags, __pyx_k_remove_unknown_tags, sizeof(__pyx_k_remove_unknown_tags), 0, 0, 1, 1},
   {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
+  {&__pyx_n_s_replace_css_import, __pyx_k_replace_css_import, sizeof(__pyx_k_replace_css_import), 0, 0, 1, 1},
+  {&__pyx_n_s_replace_css_javascript, __pyx_k_replace_css_javascript, sizeof(__pyx_k_replace_css_javascript), 0, 0, 1, 1},
   {&__pyx_n_s_replacement, __pyx_k_replacement, sizeof(__pyx_k_replacement), 0, 0, 1, 1},
   {&__pyx_n_s_resolve_base_href, __pyx_k_resolve_base_href, sizeof(__pyx_k_resolve_base_href), 0, 0, 1, 1},
   {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
@@ -13912,6 +13964,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
   {&__pyx_n_s_substitute_comments, __pyx_k_substitute_comments, sizeof(__pyx_k_substitute_comments), 0, 0, 1, 1},
   {&__pyx_n_s_substitute_whitespace, __pyx_k_substitute_whitespace, sizeof(__pyx_k_substitute_whitespace), 0, 0, 1, 1},
+  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
   {&__pyx_n_s_tag, __pyx_k_tag, sizeof(__pyx_k_tag), 0, 0, 1, 1},
   {&__pyx_n_s_tag_link_attrs, __pyx_k_tag_link_attrs, sizeof(__pyx_k_tag_link_attrs), 0, 0, 1, 1},
   {&__pyx_n_s_tags, __pyx_k_tags, sizeof(__pyx_k_tags), 0, 0, 1, 1},
@@ -13934,6 +13987,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_urlparse, __pyx_k_urlparse, sizeof(__pyx_k_urlparse), 0, 0, 1, 1},
   {&__pyx_n_s_urlsplit, __pyx_k_urlsplit, sizeof(__pyx_k_urlsplit), 0, 0, 1, 1},
   {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
   {&__pyx_n_s_whitelist_tags, __pyx_k_whitelist_tags, sizeof(__pyx_k_whitelist_tags), 0, 0, 1, 1},
   {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
   {&__pyx_n_s_word, __pyx_k_word, sizeof(__pyx_k_word), 0, 0, 1, 1},
@@ -13945,13 +13999,13 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {0, 0, 0, 0, 0, 0, 0}
 };
 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
-  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 16, __pyx_L1_error)
-  __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 26, __pyx_L1_error)
-  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 28, __pyx_L1_error)
-  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 99, __pyx_L1_error)
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 223, __pyx_L1_error)
-  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 231, __pyx_L1_error)
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 263, __pyx_L1_error)
+  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 17, __pyx_L1_error)
+  __pyx_builtin_NameError = __Pyx_GetBuiltinName(__pyx_n_s_NameError); if (!__pyx_builtin_NameError) __PYX_ERR(0, 27, __pyx_L1_error)
+  __pyx_builtin_chr = __Pyx_GetBuiltinName(__pyx_n_s_chr); if (!__pyx_builtin_chr) __PYX_ERR(0, 29, __pyx_L1_error)
+  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 104, __pyx_L1_error)
+  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 228, __pyx_L1_error)
+  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 236, __pyx_L1_error)
+  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 268, __pyx_L1_error)
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -13961,422 +14015,433 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
 
-  /* "lxml/html/clean.py":231
+  /* "lxml/html/clean.py":236
  *         if kw.get("allow_tags"):
  *             if kw.get("remove_unknown_tags"):
  *                 raise ValueError("It does not make sense to pass in both "             # <<<<<<<<<<<<<<
  *                                  "allow_tags and remove_unknown_tags")
  *             self.remove_unknown_tags = False
  */
-  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_It_does_not_make_sense_to_pass_i); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 231, __pyx_L1_error)
+  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_It_does_not_make_sense_to_pass_i); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple_);
   __Pyx_GIVEREF(__pyx_tuple_);
 
-  /* "lxml/html/clean.py":316
+  /* "lxml/html/clean.py":321
  *             if not self.style:
  *                 for el in list(doc.iter('style')):
  *                     if el.get('type', '').lower().strip() == 'text/javascript':             # <<<<<<<<<<<<<<
  *                         el.drop_tree()
  *                         continue
  */
-  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 316, __pyx_L1_error)
+  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_type, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 321, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__3);
   __Pyx_GIVEREF(__pyx_tuple__3);
 
-  /* "lxml/html/clean.py":342
+  /* "lxml/html/clean.py":347
  *             # allowed, as you can put Javascript in them
  *             for el in list(doc.iter('link')):
  *                 if 'stylesheet' in el.get('rel', '').lower():             # <<<<<<<<<<<<<<
  *                     # Note this kills alternate stylesheets as well
  *                     if not self.allow_element(el):
  */
-  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_rel, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 342, __pyx_L1_error)
+  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_s_rel, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 347, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__4);
   __Pyx_GIVEREF(__pyx_tuple__4);
 
-  /* "lxml/html/clean.py":349
+  /* "lxml/html/clean.py":354
  *             kill_tags.add('meta')
  *         if self.page_structure:
  *             remove_tags.update(('head', 'html', 'title'))             # <<<<<<<<<<<<<<
  *         if self.embedded:
  *             # FIXME: is <layer> really embedded?
  */
-  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_head, __pyx_n_s_html, __pyx_n_s_title); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 349, __pyx_L1_error)
+  __pyx_tuple__5 = PyTuple_Pack(3, __pyx_n_s_head, __pyx_n_s_html, __pyx_n_s_title); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 354, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__5);
   __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "lxml/html/clean.py":360
+  /* "lxml/html/clean.py":365
  *                 if parent is None:
  *                     el.drop_tree()
  *             kill_tags.update(('applet',))             # <<<<<<<<<<<<<<
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
  */
-  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_applet); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 360, __pyx_L1_error)
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_applet); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 365, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__6);
   __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "lxml/html/clean.py":362
+  /* "lxml/html/clean.py":367
  *             kill_tags.update(('applet',))
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))             # <<<<<<<<<<<<<<
  *         if self.frames:
  *             # FIXME: ideally we should look at the frame links, but
  */
-  __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_iframe, __pyx_n_s_embed, __pyx_n_s_layer, __pyx_n_s_object, __pyx_n_s_param); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 362, __pyx_L1_error)
+  __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_iframe, __pyx_n_s_embed, __pyx_n_s_layer, __pyx_n_s_object, __pyx_n_s_param); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 367, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__7);
   __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "lxml/html/clean.py":370
+  /* "lxml/html/clean.py":375
  *         if self.forms:
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))             # <<<<<<<<<<<<<<
  *         if self.annoying_tags:
  *             remove_tags.update(('blink', 'marquee'))
  */
-  __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_button, __pyx_n_s_input, __pyx_n_s_select, __pyx_n_s_textarea); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 370, __pyx_L1_error)
+  __pyx_tuple__8 = PyTuple_Pack(4, __pyx_n_s_button, __pyx_n_s_input, __pyx_n_s_select, __pyx_n_s_textarea); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 375, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__8);
   __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "lxml/html/clean.py":372
+  /* "lxml/html/clean.py":377
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:
  *             remove_tags.update(('blink', 'marquee'))             # <<<<<<<<<<<<<<
  * 
  *         _remove = []
  */
-  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_blink, __pyx_n_s_marquee); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 372, __pyx_L1_error)
+  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_n_s_blink, __pyx_n_s_marquee); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 377, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__9);
   __Pyx_GIVEREF(__pyx_tuple__9);
 
-  /* "lxml/html/clean.py":484
+  /* "lxml/html/clean.py":489
  *             return False
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]             # <<<<<<<<<<<<<<
  *         if scheme not in ('http', 'https'):
  *             return False
  */
-  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_kp_s__10, __pyx_int_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 484, __pyx_L1_error)
+  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_kp_s__10, __pyx_int_1); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__11);
   __Pyx_GIVEREF(__pyx_tuple__11);
 
-  /* "lxml/html/clean.py":532
+  /* "lxml/html/clean.py":537
  *         """
  *         style = self._substitute_comments('', style)
  *         style = style.replace('\\', '')             # <<<<<<<<<<<<<<
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()
  */
-  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_kp_s__12, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 532, __pyx_L1_error)
+  __pyx_tuple__13 = PyTuple_Pack(2, __pyx_kp_s__12, __pyx_kp_s__2); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 537, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__13);
   __Pyx_GIVEREF(__pyx_tuple__13);
 
-  /* "lxml/html/clean.py":619
+  /* "lxml/html/clean.py":627
  *         if pre_children:
  *             el.text = text
  *             el[:0] = pre_children             # <<<<<<<<<<<<<<
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):
  */
-  __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 619, __pyx_L1_error)
+  __pyx_slice__14 = PySlice_New(Py_None, __pyx_int_0, Py_None); if (unlikely(!__pyx_slice__14)) __PYX_ERR(0, 627, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__14);
   __Pyx_GIVEREF(__pyx_slice__14);
 
-  /* "lxml/html/clean.py":659
+  /* "lxml/html/clean.py":667
  *             # These punctuation marks shouldn't end a link
  *             end -= 1
  *             link = link[:-1]             # <<<<<<<<<<<<<<
  *         prev_text = text[:best_match.start()]
  *         if links:
  */
-  __pyx_slice__17 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 659, __pyx_L1_error)
+  __pyx_slice__17 = PySlice_New(Py_None, __pyx_int_neg_1, Py_None); if (unlikely(!__pyx_slice__17)) __PYX_ERR(0, 667, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__17);
   __Pyx_GIVEREF(__pyx_slice__17);
 
-  /* "lxml/html/clean.py":78
+  /* "lxml/html/clean.py":72
+ *     r'@\s*import', re.I).sub
+ * 
+ * _looks_like_tag_content = re.compile(             # <<<<<<<<<<<<<<
+ *     r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ *     *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_a_zA_Z_son_a_zA_Z_s); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__18);
+  __Pyx_GIVEREF(__pyx_tuple__18);
+
+  /* "lxml/html/clean.py":83
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  * def _is_javascript_scheme(s):             # <<<<<<<<<<<<<<
  *     if _is_image_dataurl(s):
  *         return None
  */
-  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 78, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__18);
-  __Pyx_GIVEREF(__pyx_tuple__18);
-  __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 78, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_s_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__19);
+  __Pyx_GIVEREF(__pyx_tuple__19);
+  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_is_javascript_scheme, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 83, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":83
+  /* "lxml/html/clean.py":88
  *     return _is_possibly_malicious_scheme(s)
  * 
  * _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub             # <<<<<<<<<<<<<<
  * # FIXME: should data: be blocked?
  * 
  */
-  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_s_x00_x08_x0B_x0C_x0E_x19); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__20);
-  __Pyx_GIVEREF(__pyx_tuple__20);
+  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_s_x00_x08_x0B_x0C_x0E_x19); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__21);
+  __Pyx_GIVEREF(__pyx_tuple__21);
 
-  /* "lxml/html/clean.py":90
+  /* "lxml/html/clean.py":95
  *     r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
  * 
  * _find_styled_elements = etree.XPath(             # <<<<<<<<<<<<<<
  *     "descendant-or-self::*[@style]")
  * 
  */
-  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_style); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 90, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__21);
-  __Pyx_GIVEREF(__pyx_tuple__21);
+  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_style); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__22);
+  __Pyx_GIVEREF(__pyx_tuple__22);
 
-  /* "lxml/html/clean.py":93
+  /* "lxml/html/clean.py":98
  *     "descendant-or-self::*[@style]")
  * 
  * _find_external_links = etree.XPath(             # <<<<<<<<<<<<<<
  *     ("descendant-or-self::a  [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
  *      "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
  */
-  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_a_normalize_s); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 93, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__22);
-  __Pyx_GIVEREF(__pyx_tuple__22);
+  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_descendant_or_self_a_normalize_s); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__23);
+  __Pyx_GIVEREF(__pyx_tuple__23);
 
-  /* "lxml/html/clean.py":99
+  /* "lxml/html/clean.py":104
  * 
  * 
  * class Cleaner(object):             # <<<<<<<<<<<<<<
  *     """
  *     Instances cleans the document of each of the possible offending
  */
-  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__23);
-  __Pyx_GIVEREF(__pyx_tuple__23);
+  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_builtin_object); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__24);
+  __Pyx_GIVEREF(__pyx_tuple__24);
 
-  /* "lxml/html/clean.py":217
+  /* "lxml/html/clean.py":222
  *     whitelist_tags = {'iframe', 'embed'}
  * 
  *     def __init__(self, **kw):             # <<<<<<<<<<<<<<
  *         not_an_attribute = object()
  *         for name, value in kw.items():
  */
-  __pyx_tuple__24 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_not_an_attribute, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_default); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__24);
-  __Pyx_GIVEREF(__pyx_tuple__24);
-  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __pyx_tuple__25 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_kw, __pyx_n_s_not_an_attribute, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_default); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__25);
+  __Pyx_GIVEREF(__pyx_tuple__25);
+  __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(1, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_init, 222, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 222, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":257
+  /* "lxml/html/clean.py":262
  *         )
  * 
  *     def __call__(self, doc):             # <<<<<<<<<<<<<<
  *         """
  *         Cleans the document.
  */
-  __pyx_tuple__26 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_getroot, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 257, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__26);
-  __Pyx_GIVEREF(__pyx_tuple__26);
-  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 257, __pyx_L1_error)
+  __pyx_tuple__27 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_getroot, __pyx_n_s_el, __pyx_n_s_kill_tags, __pyx_n_s_remove_tags, __pyx_n_s_allow_tags, __pyx_n_s_safe_attrs, __pyx_n_s_attrib, __pyx_n_s_aname, __pyx_n_s_old, __pyx_n_s_new, __pyx_n_s_parent, __pyx_n_s_remove, __pyx_n_s_kill, __pyx_n_s_bad, __pyx_n_s_rel); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__27);
+  __Pyx_GIVEREF(__pyx_tuple__27);
+  __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(2, 0, 17, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_call, 262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) __PYX_ERR(0, 262, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":442
+  /* "lxml/html/clean.py":447
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
  *         """
  *         Override to suppress rel="nofollow" on some anchors.
  */
-  __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 442, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__28);
-  __Pyx_GIVEREF(__pyx_tuple__28);
-  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 442, __pyx_L1_error)
+  __pyx_tuple__29 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_anchor); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 447, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__29);
+  __Pyx_GIVEREF(__pyx_tuple__29);
+  __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_follow, 447, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__30)) __PYX_ERR(0, 447, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":448
+  /* "lxml/html/clean.py":453
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
  *         """
  *         Decide whether an element is configured to be accepted or rejected.
  */
-  __pyx_tuple__30 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 448, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__30);
-  __Pyx_GIVEREF(__pyx_tuple__30);
-  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 448, __pyx_L1_error)
+  __pyx_tuple__31 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_attr, __pyx_n_s_one_attr, __pyx_n_s_url); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__31);
+  __Pyx_GIVEREF(__pyx_tuple__31);
+  __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_element, 453, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__32)) __PYX_ERR(0, 453, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":472
+  /* "lxml/html/clean.py":477
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
  *         """
  *         Decide whether a URL that was found in an element's attributes or text
  */
-  __pyx_tuple__32 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 472, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__32);
-  __Pyx_GIVEREF(__pyx_tuple__32);
-  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 472, __pyx_L1_error)
+  __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_el, __pyx_n_s_url, __pyx_n_s_scheme, __pyx_n_s_netloc, __pyx_n_s_path, __pyx_n_s_query, __pyx_n_s_fragment); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 477, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__33);
+  __Pyx_GIVEREF(__pyx_tuple__33);
+  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_allow_embedded_url, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(0, 477, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":491
+  /* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
  *         """
  *         IE conditional comments basically embed HTML that the parser
  */
-  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_has_conditional_comment); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__34);
-  __Pyx_GIVEREF(__pyx_tuple__34);
-  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 491, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 491, __pyx_L1_error)
+  __pyx_tuple__35 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_has_conditional_comment); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__35);
+  __Pyx_GIVEREF(__pyx_tuple__35);
+  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_conditional_comments, 496, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 496, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":502
+  /* "lxml/html/clean.py":507
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
  *         bad = []
  *         for el in doc.iter(iterate):
  */
-  __pyx_tuple__36 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 502, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__36);
-  __Pyx_GIVEREF(__pyx_tuple__36);
-  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 502, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 502, __pyx_L1_error)
-  __pyx_tuple__38 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 502, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__38);
-  __Pyx_GIVEREF(__pyx_tuple__38);
+  __pyx_tuple__37 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_doc, __pyx_n_s_condition, __pyx_n_s_iterate, __pyx_n_s_bad, __pyx_n_s_el); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__37);
+  __Pyx_GIVEREF(__pyx_tuple__37);
+  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_kill_elements, 507, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 507, __pyx_L1_error)
+  __pyx_tuple__39 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__39);
+  __Pyx_GIVEREF(__pyx_tuple__39);
 
-  /* "lxml/html/clean.py":510
+  /* "lxml/html/clean.py":515
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', unquote_plus(link))
  */
-  __pyx_tuple__39 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 510, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__39);
-  __Pyx_GIVEREF(__pyx_tuple__39);
-  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 510, __pyx_L1_error)
+  __pyx_tuple__40 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_link, __pyx_n_s_new); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 515, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__40);
+  __Pyx_GIVEREF(__pyx_tuple__40);
+  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_remove_javascript_link, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) __PYX_ERR(0, 515, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":520
+  /* "lxml/html/clean.py":525
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
  * 
  *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
  *         """
  *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
  */
-  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 520, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__42);
-  __Pyx_GIVEREF(__pyx_tuple__42);
-  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 520, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_style); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 525, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__43);
+  __Pyx_GIVEREF(__pyx_tuple__43);
+  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_has_sneaky_javascript, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 525, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":544
+  /* "lxml/html/clean.py":552
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
  *         result_type = type(html)
  *         if isinstance(html, basestring):
  */
-  __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 544, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__44);
-  __Pyx_GIVEREF(__pyx_tuple__44);
-  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 544, __pyx_L1_error)
+  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_html, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 552, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__45);
+  __Pyx_GIVEREF(__pyx_tuple__45);
+  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_clean_html, 552, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 552, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":571
+  /* "lxml/html/clean.py":579
  *     re.compile(r'^localhost', re.I),
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  *     re.compile(r'^127\.0\.0\.1$'),             # <<<<<<<<<<<<<<
  *     ]
  * 
  */
-  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(0, 571, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__46);
-  __Pyx_GIVEREF(__pyx_tuple__46);
+  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_127_0_0_1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__47);
+  __Pyx_GIVEREF(__pyx_tuple__47);
 
-  /* "lxml/html/clean.py":576
+  /* "lxml/html/clean.py":584
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,
  */
-  __pyx_tuple__47 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 576, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__47);
-  __Pyx_GIVEREF(__pyx_tuple__47);
-  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 576, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __pyx_tuple__48 = PyTuple_Pack(12, __pyx_n_s_el, __pyx_n_s_link_regexes, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_hosts, __pyx_n_s_avoid_classes, __pyx_n_s_class_name, __pyx_n_s_match_class, __pyx_n_s_child, __pyx_n_s_text, __pyx_n_s_tail_children, __pyx_n_s_index, __pyx_n_s_pre_children); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 584, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__48);
+  __Pyx_GIVEREF(__pyx_tuple__48);
+  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(5, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink, 584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) __PYX_ERR(0, 584, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":621
+  /* "lxml/html/clean.py":629
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
  *     leading_text = ''
  *     links = []
  */
-  __pyx_tuple__49 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 621, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__49);
-  __Pyx_GIVEREF(__pyx_tuple__49);
-  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 621, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 621, __pyx_L1_error)
+  __pyx_tuple__50 = PyTuple_Pack(19, __pyx_n_s_text, __pyx_n_s_link_regexes, __pyx_n_s_avoid_hosts, __pyx_n_s_factory, __pyx_n_s_leading_text, __pyx_n_s_links, __pyx_n_s_last_pos, __pyx_n_s_best_match, __pyx_n_s_best_pos, __pyx_n_s_regex, __pyx_n_s_regex_pos, __pyx_n_s_match, __pyx_n_s_host, __pyx_n_s_host_regex, __pyx_n_s_link, __pyx_n_s_end, __pyx_n_s_prev_text, __pyx_n_s_anchor, __pyx_n_s_body); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 629, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__50);
+  __Pyx_GIVEREF(__pyx_tuple__50);
+  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(4, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_link_text, 629, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 629, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":679
+  /* "lxml/html/clean.py":687
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
  *     result_type = type(html)
  *     if isinstance(html, basestring):
  */
-  __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 679, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__51);
-  __Pyx_GIVEREF(__pyx_tuple__51);
-  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 679, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 679, __pyx_L1_error)
+  __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__52);
+  __Pyx_GIVEREF(__pyx_tuple__52);
+  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_autolink_html, 687, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 687, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":697
+  /* "lxml/html/clean.py":705
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  */
-  __pyx_tuple__53 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 697, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__53);
-  __Pyx_GIVEREF(__pyx_tuple__53);
-  __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 697, __pyx_L1_error)
+  __pyx_tuple__54 = PyTuple_Pack(9, __pyx_n_s_el, __pyx_n_s_max_width, __pyx_n_s_avoid_elements, __pyx_n_s_avoid_classes, __pyx_n_s_break_character, __pyx_n_s_class_name, __pyx_n_s_dont_break, __pyx_n_s_avoid, __pyx_n_s_child); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 705, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__54);
+  __Pyx_GIVEREF(__pyx_tuple__54);
+  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(5, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break, 705, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 705, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":700
+  /* "lxml/html/clean.py":708
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  *                break_character=unichr(0x200b)):             # <<<<<<<<<<<<<<
  *     """
  *     Breaks any long words found in the body of the text (not attributes).
  */
-  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 700, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__55);
-  __Pyx_GIVEREF(__pyx_tuple__55);
+  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_int_8203); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__56);
+  __Pyx_GIVEREF(__pyx_tuple__56);
 
-  /* "lxml/html/clean.py":738
+  /* "lxml/html/clean.py":746
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
  *     result_type = type(html)
  *     doc = fromstring(html)
  */
-  __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 738, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__56);
-  __Pyx_GIVEREF(__pyx_tuple__56);
-  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 738, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 738, __pyx_L1_error)
+  __pyx_tuple__57 = PyTuple_Pack(5, __pyx_n_s_html, __pyx_n_s_args, __pyx_n_s_kw, __pyx_n_s_result_type, __pyx_n_s_doc); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__57);
+  __Pyx_GIVEREF(__pyx_tuple__57);
+  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_word_break_html, 746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) __PYX_ERR(0, 746, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":744
+  /* "lxml/html/clean.py":752
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
  *     words = text.split()
  *     for word in words:
  */
-  __pyx_tuple__58 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 744, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__58);
-  __Pyx_GIVEREF(__pyx_tuple__58);
-  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 744, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 744, __pyx_L1_error)
+  __pyx_tuple__59 = PyTuple_Pack(6, __pyx_n_s_text, __pyx_n_s_max_width, __pyx_n_s_break_character, __pyx_n_s_words, __pyx_n_s_word, __pyx_n_s_replacement); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__59);
+  __Pyx_GIVEREF(__pyx_tuple__59);
+  __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_break_text, 752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__60)) __PYX_ERR(0, 752, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":754
+  /* "lxml/html/clean.py":762
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
  *     orig_word = word
  *     result = ''
  */
-  __pyx_tuple__60 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 754, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_tuple__60);
-  __Pyx_GIVEREF(__pyx_tuple__60);
-  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 754, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 754, __pyx_L1_error)
+  __pyx_tuple__61 = PyTuple_Pack(8, __pyx_n_s_word, __pyx_n_s_width, __pyx_n_s_break_character, __pyx_n_s_orig_word, __pyx_n_s_result, __pyx_n_s_start, __pyx_n_s_breaks, __pyx_n_s_last_break); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 762, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_tuple__61);
+  __Pyx_GIVEREF(__pyx_tuple__61);
+  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_html_clean_py, __pyx_n_s_insert_break, 762, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 762, __pyx_L1_error)
   __Pyx_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -14390,6 +14455,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
   if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
   __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
   __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
   __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
   __pyx_int_40 = PyInt_FromLong(40); if (unlikely(!__pyx_int_40)) __PYX_ERR(0, 1, __pyx_L1_error)
   __pyx_int_8203 = PyInt_FromLong(8203); if (unlikely(!__pyx_int_8203)) __PYX_ERR(0, 1, __pyx_L1_error)
@@ -14438,7 +14504,7 @@ static int __Pyx_modinit_type_init_code(void) {
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
   /*--- Type init code ---*/
-  if (PyType_Ready(&__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments.tp_print = 0;
   #endif
@@ -14580,8 +14646,9 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_clean(PyObject *__pyx_pyinit_modul
   PyObject *__pyx_t_7 = NULL;
   PyObject *__pyx_t_8 = NULL;
   PyObject *__pyx_t_9 = NULL;
-  PyObject *__pyx_t_10 = NULL;
+  int __pyx_t_10;
   PyObject *__pyx_t_11 = NULL;
+  PyObject *__pyx_t_12 = NULL;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -14692,30 +14759,42 @@ if (!__Pyx_RefNanny) {
   /* "lxml/html/clean.py":11
  * from __future__ import absolute_import
  * 
- * import re             # <<<<<<<<<<<<<<
- * import copy
- * try:
+ * import copy             # <<<<<<<<<<<<<<
+ * import re
+ * import sys
  */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/html/clean.py":12
  * 
+ * import copy
+ * import re             # <<<<<<<<<<<<<<
+ * import sys
+ * try:
+ */
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+  /* "lxml/html/clean.py":13
+ * import copy
  * import re
- * import copy             # <<<<<<<<<<<<<<
+ * import sys             # <<<<<<<<<<<<<<
  * try:
  *     from urlparse import urlsplit
  */
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_copy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":13
+  /* "lxml/html/clean.py":14
  * import re
- * import copy
+ * import sys
  * try:             # <<<<<<<<<<<<<<
  *     from urlparse import urlsplit
  *     from urllib import unquote_plus
@@ -14729,51 +14808,51 @@ if (!__Pyx_RefNanny) {
     __Pyx_XGOTREF(__pyx_t_4);
     /*try:*/ {
 
-      /* "lxml/html/clean.py":14
- * import copy
+      /* "lxml/html/clean.py":15
+ * import sys
  * try:
  *     from urlparse import urlsplit             # <<<<<<<<<<<<<<
  *     from urllib import unquote_plus
  * except ImportError:
  */
-      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
+      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_n_s_urlsplit);
       __Pyx_GIVEREF(__pyx_n_s_urlsplit);
       PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_urlsplit);
-      __pyx_t_5 = __Pyx_Import(__pyx_n_s_urlparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 14, __pyx_L2_error)
+      __pyx_t_5 = __Pyx_Import(__pyx_n_s_urlparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L2_error)
+      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_1);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L2_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L2_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":15
+      /* "lxml/html/clean.py":16
  * try:
  *     from urlparse import urlsplit
  *     from urllib import unquote_plus             # <<<<<<<<<<<<<<
  * except ImportError:
  *     # Python 3
  */
-      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
+      __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 16, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_n_s_unquote_plus);
       __Pyx_GIVEREF(__pyx_n_s_unquote_plus);
       PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_unquote_plus);
-      __pyx_t_1 = __Pyx_Import(__pyx_n_s_urllib, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L2_error)
+      __pyx_t_1 = __Pyx_Import(__pyx_n_s_urllib, __pyx_t_5, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 15, __pyx_L2_error)
+      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 16, __pyx_L2_error)
       __Pyx_GOTREF(__pyx_t_5);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_5) < 0) __PYX_ERR(0, 15, __pyx_L2_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_5) < 0) __PYX_ERR(0, 16, __pyx_L2_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":13
+      /* "lxml/html/clean.py":14
  * import re
- * import copy
+ * import sys
  * try:             # <<<<<<<<<<<<<<
  *     from urlparse import urlsplit
  *     from urllib import unquote_plus
@@ -14787,7 +14866,7 @@ if (!__Pyx_RefNanny) {
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":16
+    /* "lxml/html/clean.py":17
  *     from urlparse import urlsplit
  *     from urllib import unquote_plus
  * except ImportError:             # <<<<<<<<<<<<<<
@@ -14797,19 +14876,19 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 16, __pyx_L4_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 17, __pyx_L4_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_7);
 
-      /* "lxml/html/clean.py":18
+      /* "lxml/html/clean.py":19
  * except ImportError:
  *     # Python 3
  *     from urllib.parse import urlsplit, unquote_plus             # <<<<<<<<<<<<<<
  * from lxml import etree
  * from lxml.html import defs
  */
-      __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      __pyx_t_8 = PyList_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_INCREF(__pyx_n_s_urlsplit);
       __Pyx_GIVEREF(__pyx_n_s_urlsplit);
@@ -14817,16 +14896,16 @@ if (!__Pyx_RefNanny) {
       __Pyx_INCREF(__pyx_n_s_unquote_plus);
       __Pyx_GIVEREF(__pyx_n_s_unquote_plus);
       PyList_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_unquote_plus);
-      __pyx_t_9 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      __pyx_t_9 = __Pyx_Import(__pyx_n_s_urllib_parse, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_GOTREF(__pyx_t_8);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_8) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_urlsplit, __pyx_t_8) < 0) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_GOTREF(__pyx_t_8);
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_8) < 0) __PYX_ERR(0, 18, __pyx_L4_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unquote_plus, __pyx_t_8) < 0) __PYX_ERR(0, 19, __pyx_L4_except_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -14837,9 +14916,9 @@ if (!__Pyx_RefNanny) {
     goto __pyx_L4_except_error;
     __pyx_L4_except_error:;
 
-    /* "lxml/html/clean.py":13
+    /* "lxml/html/clean.py":14
  * import re
- * import copy
+ * import sys
  * try:             # <<<<<<<<<<<<<<
  *     from urlparse import urlsplit
  *     from urllib import unquote_plus
@@ -14857,56 +14936,56 @@ if (!__Pyx_RefNanny) {
     __pyx_L7_try_end:;
   }
 
-  /* "lxml/html/clean.py":19
+  /* "lxml/html/clean.py":20
  *     # Python 3
  *     from urllib.parse import urlsplit, unquote_plus
  * from lxml import etree             # <<<<<<<<<<<<<<
  * from lxml.html import defs
  * from lxml.html import fromstring, XHTML_NAMESPACE
  */
-  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_n_s_etree);
   __Pyx_GIVEREF(__pyx_n_s_etree);
   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_etree);
-  __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 19, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_etree, __pyx_t_7) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_etree, __pyx_t_7) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":20
+  /* "lxml/html/clean.py":21
  *     from urllib.parse import urlsplit, unquote_plus
  * from lxml import etree
  * from lxml.html import defs             # <<<<<<<<<<<<<<
  * from lxml.html import fromstring, XHTML_NAMESPACE
  * from lxml.html import xhtml_to_html, _transform_result
  */
-  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_defs);
   __Pyx_GIVEREF(__pyx_n_s_defs);
   PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_defs);
-  __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 20, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_defs, __pyx_t_5) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_defs, __pyx_t_5) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":21
+  /* "lxml/html/clean.py":22
  * from lxml import etree
  * from lxml.html import defs
  * from lxml.html import fromstring, XHTML_NAMESPACE             # <<<<<<<<<<<<<<
  * from lxml.html import xhtml_to_html, _transform_result
  * 
  */
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_n_s_fromstring);
   __Pyx_GIVEREF(__pyx_n_s_fromstring);
@@ -14914,27 +14993,27 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(__pyx_n_s_XHTML_NAMESPACE);
   __Pyx_GIVEREF(__pyx_n_s_XHTML_NAMESPACE);
   PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_XHTML_NAMESPACE);
-  __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_7, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_7) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fromstring, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 21, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XHTML_NAMESPACE, __pyx_t_7) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XHTML_NAMESPACE, __pyx_t_7) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":22
+  /* "lxml/html/clean.py":23
  * from lxml.html import defs
  * from lxml.html import fromstring, XHTML_NAMESPACE
  * from lxml.html import xhtml_to_html, _transform_result             # <<<<<<<<<<<<<<
  * 
  * try:
  */
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_xhtml_to_html);
   __Pyx_GIVEREF(__pyx_n_s_xhtml_to_html);
@@ -14942,20 +15021,20 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(__pyx_n_s_transform_result);
   __Pyx_GIVEREF(__pyx_n_s_transform_result);
   PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_transform_result);
-  __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_Import(__pyx_n_s_lxml_html, __pyx_t_5, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_xhtml_to_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_xhtml_to_html, __pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_xhtml_to_html, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 22, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_transform_result, __pyx_t_5) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_transform_result, __pyx_t_5) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":24
+  /* "lxml/html/clean.py":25
  * from lxml.html import xhtml_to_html, _transform_result
  * 
  * try:             # <<<<<<<<<<<<<<
@@ -14971,18 +15050,18 @@ if (!__Pyx_RefNanny) {
     __Pyx_XGOTREF(__pyx_t_2);
     /*try:*/ {
 
-      /* "lxml/html/clean.py":25
+      /* "lxml/html/clean.py":26
  * 
  * try:
  *     unichr             # <<<<<<<<<<<<<<
  * except NameError:
  *     # Python 3
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 25, __pyx_L10_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 26, __pyx_L10_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "lxml/html/clean.py":24
+      /* "lxml/html/clean.py":25
  * from lxml.html import xhtml_to_html, _transform_result
  * 
  * try:             # <<<<<<<<<<<<<<
@@ -15001,7 +15080,7 @@ if (!__Pyx_RefNanny) {
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "lxml/html/clean.py":26
+    /* "lxml/html/clean.py":27
  * try:
  *     unichr
  * except NameError:             # <<<<<<<<<<<<<<
@@ -15011,19 +15090,19 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 26, __pyx_L12_except_error)
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 27, __pyx_L12_except_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_1);
 
-      /* "lxml/html/clean.py":28
+      /* "lxml/html/clean.py":29
  * except NameError:
  *     # Python 3
  *     unichr = chr             # <<<<<<<<<<<<<<
  * try:
  *     unicode
  */
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 28, __pyx_L12_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unichr, __pyx_builtin_chr) < 0) __PYX_ERR(0, 29, __pyx_L12_except_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -15032,7 +15111,7 @@ if (!__Pyx_RefNanny) {
     goto __pyx_L12_except_error;
     __pyx_L12_except_error:;
 
-    /* "lxml/html/clean.py":24
+    /* "lxml/html/clean.py":25
  * from lxml.html import xhtml_to_html, _transform_result
  * 
  * try:             # <<<<<<<<<<<<<<
@@ -15052,7 +15131,7 @@ if (!__Pyx_RefNanny) {
     __pyx_L15_try_end:;
   }
 
-  /* "lxml/html/clean.py":29
+  /* "lxml/html/clean.py":30
  *     # Python 3
  *     unichr = chr
  * try:             # <<<<<<<<<<<<<<
@@ -15068,18 +15147,18 @@ if (!__Pyx_RefNanny) {
     __Pyx_XGOTREF(__pyx_t_4);
     /*try:*/ {
 
-      /* "lxml/html/clean.py":30
+      /* "lxml/html/clean.py":31
  *     unichr = chr
  * try:
  *     unicode             # <<<<<<<<<<<<<<
  * except NameError:
  *     # Python 3
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L18_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L18_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":29
+      /* "lxml/html/clean.py":30
  *     # Python 3
  *     unichr = chr
  * try:             # <<<<<<<<<<<<<<
@@ -15098,7 +15177,7 @@ if (!__Pyx_RefNanny) {
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "lxml/html/clean.py":31
+    /* "lxml/html/clean.py":32
  * try:
  *     unicode
  * except NameError:             # <<<<<<<<<<<<<<
@@ -15108,19 +15187,19 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 31, __pyx_L20_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_7) < 0) __PYX_ERR(0, 32, __pyx_L20_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_7);
 
-      /* "lxml/html/clean.py":33
+      /* "lxml/html/clean.py":34
  * except NameError:
  *     # Python 3
  *     unicode = str             # <<<<<<<<<<<<<<
  * try:
  *     basestring
  */
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 33, __pyx_L20_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicode, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(0, 34, __pyx_L20_except_error)
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -15129,7 +15208,7 @@ if (!__Pyx_RefNanny) {
     goto __pyx_L20_except_error;
     __pyx_L20_except_error:;
 
-    /* "lxml/html/clean.py":29
+    /* "lxml/html/clean.py":30
  *     # Python 3
  *     unichr = chr
  * try:             # <<<<<<<<<<<<<<
@@ -15149,7 +15228,7 @@ if (!__Pyx_RefNanny) {
     __pyx_L23_try_end:;
   }
 
-  /* "lxml/html/clean.py":34
+  /* "lxml/html/clean.py":35
  *     # Python 3
  *     unicode = str
  * try:             # <<<<<<<<<<<<<<
@@ -15165,18 +15244,18 @@ if (!__Pyx_RefNanny) {
     __Pyx_XGOTREF(__pyx_t_2);
     /*try:*/ {
 
-      /* "lxml/html/clean.py":35
+      /* "lxml/html/clean.py":36
  *     unicode = str
  * try:
  *     basestring             # <<<<<<<<<<<<<<
  * except NameError:
  *     basestring = (str, bytes)
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_basestring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 35, __pyx_L26_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_basestring); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 36, __pyx_L26_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "lxml/html/clean.py":34
+      /* "lxml/html/clean.py":35
  *     # Python 3
  *     unicode = str
  * try:             # <<<<<<<<<<<<<<
@@ -15195,7 +15274,7 @@ if (!__Pyx_RefNanny) {
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-    /* "lxml/html/clean.py":36
+    /* "lxml/html/clean.py":37
  * try:
  *     basestring
  * except NameError:             # <<<<<<<<<<<<<<
@@ -15205,19 +15284,19 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_NameError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 36, __pyx_L28_except_error)
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 37, __pyx_L28_except_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_1);
 
-      /* "lxml/html/clean.py":37
+      /* "lxml/html/clean.py":38
  *     basestring
  * except NameError:
  *     basestring = (str, bytes)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 37, __pyx_L28_except_error)
+      __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 38, __pyx_L28_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __Pyx_INCREF(((PyObject *)(&PyString_Type)));
       __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
@@ -15225,7 +15304,7 @@ if (!__Pyx_RefNanny) {
       __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
       __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
       PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)(&PyBytes_Type)));
-      if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_9) < 0) __PYX_ERR(0, 37, __pyx_L28_except_error)
+      if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_9) < 0) __PYX_ERR(0, 38, __pyx_L28_except_error)
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -15235,7 +15314,7 @@ if (!__Pyx_RefNanny) {
     goto __pyx_L28_except_error;
     __pyx_L28_except_error:;
 
-    /* "lxml/html/clean.py":34
+    /* "lxml/html/clean.py":35
  *     # Python 3
  *     unicode = str
  * try:             # <<<<<<<<<<<<<<
@@ -15255,14 +15334,14 @@ if (!__Pyx_RefNanny) {
     __pyx_L31_try_end:;
   }
 
-  /* "lxml/html/clean.py":40
+  /* "lxml/html/clean.py":41
  * 
  * 
  * __all__ = ['clean_html', 'clean', 'Cleaner', 'autolink', 'autolink_html',             # <<<<<<<<<<<<<<
  *            'word_break', 'word_break_html']
  * 
  */
-  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_n_s_clean_html);
   __Pyx_GIVEREF(__pyx_n_s_clean_html);
@@ -15285,52 +15364,52 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(__pyx_n_s_word_break_html);
   __Pyx_GIVEREF(__pyx_n_s_word_break_html);
   PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_word_break_html);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":64
+  /* "lxml/html/clean.py":65
  * # This is an IE-specific construct you can have in a stylesheet to
  * # run some Javascript:
- * _css_javascript_re = re.compile(             # <<<<<<<<<<<<<<
- *     r'expression\s*\(.*?\)', re.S|re.I)
+ * _replace_css_javascript = re.compile(             # <<<<<<<<<<<<<<
+ *     r'expression\s*\(.*?\)', re.S|re.I).sub
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 65, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":65
+  /* "lxml/html/clean.py":66
  * # run some Javascript:
- * _css_javascript_re = re.compile(
- *     r'expression\s*\(.*?\)', re.S|re.I)             # <<<<<<<<<<<<<<
+ * _replace_css_javascript = re.compile(
+ *     r'expression\s*\(.*?\)', re.S|re.I).sub             # <<<<<<<<<<<<<<
  * 
  * # Do I have to worry about @\nimport?
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyNumber_Or(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+  __pyx_t_1 = PyNumber_Or(__pyx_t_7, __pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":64
+  /* "lxml/html/clean.py":65
  * # This is an IE-specific construct you can have in a stylesheet to
  * # run some Javascript:
- * _css_javascript_re = re.compile(             # <<<<<<<<<<<<<<
- *     r'expression\s*\(.*?\)', re.S|re.I)
+ * _replace_css_javascript = re.compile(             # <<<<<<<<<<<<<<
+ *     r'expression\s*\(.*?\)', re.S|re.I).sub
  * 
  */
-  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 65, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_INCREF(__pyx_kp_s_expression_s);
   __Pyx_GIVEREF(__pyx_kp_s_expression_s);
@@ -15338,710 +15417,814 @@ if (!__Pyx_RefNanny) {
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_css_javascript_re, __pyx_t_1) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":68
+  /* "lxml/html/clean.py":66
+ * # run some Javascript:
+ * _replace_css_javascript = re.compile(
+ *     r'expression\s*\(.*?\)', re.S|re.I).sub             # <<<<<<<<<<<<<<
  * 
  * # Do I have to worry about @\nimport?
- * _css_import_re = re.compile(             # <<<<<<<<<<<<<<
- *     r'@\s*import', re.I)
- * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 66, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_replace_css_javascript, __pyx_t_9) < 0) __PYX_ERR(0, 65, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
   /* "lxml/html/clean.py":69
+ * 
  * # Do I have to worry about @\nimport?
- * _css_import_re = re.compile(
- *     r'@\s*import', re.I)             # <<<<<<<<<<<<<<
+ * _replace_css_import = re.compile(             # <<<<<<<<<<<<<<
+ *     r'@\s*import', re.I).sub
  * 
- * # All kinds of schemes besides just javascript: that can cause
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+  /* "lxml/html/clean.py":70
+ * # Do I have to worry about @\nimport?
+ * _replace_css_import = re.compile(
+ *     r'@\s*import', re.I).sub             # <<<<<<<<<<<<<<
+ * 
+ * _looks_like_tag_content = re.compile(
+ */
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":68
+  /* "lxml/html/clean.py":69
  * 
  * # Do I have to worry about @\nimport?
- * _css_import_re = re.compile(             # <<<<<<<<<<<<<<
- *     r'@\s*import', re.I)
+ * _replace_css_import = re.compile(             # <<<<<<<<<<<<<<
+ *     r'@\s*import', re.I).sub
  * 
  */
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
   __Pyx_INCREF(__pyx_kp_s_s_import);
   __Pyx_GIVEREF(__pyx_kp_s_s_import);
-  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_s_import);
+  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_s_import);
   __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
   __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 68, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 69, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_css_import_re, __pyx_t_5) < 0) __PYX_ERR(0, 68, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+  /* "lxml/html/clean.py":70
+ * # Do I have to worry about @\nimport?
+ * _replace_css_import = re.compile(
+ *     r'@\s*import', re.I).sub             # <<<<<<<<<<<<<<
+ * 
+ * _looks_like_tag_content = re.compile(
+ */
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 70, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_replace_css_import, __pyx_t_9) < 0) __PYX_ERR(0, 69, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+  /* "lxml/html/clean.py":72
+ *     r'@\s*import', re.I).sub
+ * 
+ * _looks_like_tag_content = re.compile(             # <<<<<<<<<<<<<<
+ *     r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ *     *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+  /* "lxml/html/clean.py":74
+ * _looks_like_tag_content = re.compile(
+ *     r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ *     *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search             # <<<<<<<<<<<<<<
+ * 
+ * # All kinds of schemes besides just javascript: that can cause
+ */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (__pyx_t_10) {
+    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_ASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+    __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_7);
+    __Pyx_GIVEREF(__pyx_t_1);
+    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
+    __pyx_t_1 = 0;
+    __pyx_t_9 = __pyx_t_7;
+    __pyx_t_7 = 0;
+  } else {
+    __Pyx_INCREF(__pyx_empty_tuple);
+    __pyx_t_9 = __pyx_empty_tuple;
+  }
+  if (unlikely(__pyx_t_9 == Py_None)) {
+    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+    __PYX_ERR(0, 74, __pyx_L1_error)
+  }
+
+  /* "lxml/html/clean.py":72
+ *     r'@\s*import', re.I).sub
+ * 
+ * _looks_like_tag_content = re.compile(             # <<<<<<<<<<<<<<
+ *     r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ *     *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
+ */
+  __pyx_t_7 = PyNumber_Add(__pyx_tuple__18, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+  /* "lxml/html/clean.py":74
+ * _looks_like_tag_content = re.compile(
+ *     r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+ *     *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search             # <<<<<<<<<<<<<<
+ * 
+ * # All kinds of schemes besides just javascript: that can cause
+ */
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_looks_like_tag_content, __pyx_t_7) < 0) __PYX_ERR(0, 72, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":73
+  /* "lxml/html/clean.py":78
  * # All kinds of schemes besides just javascript: that can cause
  * # execution:
  * _is_image_dataurl = re.compile(             # <<<<<<<<<<<<<<
  *     r'^data:image/.+;base64', re.I).search
  * _is_possibly_malicious_scheme = re.compile(
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":74
+  /* "lxml/html/clean.py":79
  * # execution:
  * _is_image_dataurl = re.compile(
  *     r'^data:image/.+;base64', re.I).search             # <<<<<<<<<<<<<<
  * _is_possibly_malicious_scheme = re.compile(
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 79, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":73
+  /* "lxml/html/clean.py":78
  * # All kinds of schemes besides just javascript: that can cause
  * # execution:
  * _is_image_dataurl = re.compile(             # <<<<<<<<<<<<<<
  *     r'^data:image/.+;base64', re.I).search
  * _is_possibly_malicious_scheme = re.compile(
  */
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 73, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_data_image_base64);
   __Pyx_GIVEREF(__pyx_kp_s_data_image_base64);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_data_image_base64);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
-  __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 73, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_data_image_base64);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":74
+  /* "lxml/html/clean.py":79
  * # execution:
  * _is_image_dataurl = re.compile(
  *     r'^data:image/.+;base64', re.I).search             # <<<<<<<<<<<<<<
  * _is_possibly_malicious_scheme = re.compile(
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_image_dataurl, __pyx_t_5) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 79, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_image_dataurl, __pyx_t_7) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":75
+  /* "lxml/html/clean.py":80
  * _is_image_dataurl = re.compile(
  *     r'^data:image/.+;base64', re.I).search
  * _is_possibly_malicious_scheme = re.compile(             # <<<<<<<<<<<<<<
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 80, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 75, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":77
+  /* "lxml/html/clean.py":82
  * _is_possibly_malicious_scheme = re.compile(
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search             # <<<<<<<<<<<<<<
  * def _is_javascript_scheme(s):
  *     if _is_image_dataurl(s):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 77, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":75
+  /* "lxml/html/clean.py":80
  * _is_image_dataurl = re.compile(
  *     r'^data:image/.+;base64', re.I).search
  * _is_possibly_malicious_scheme = re.compile(             # <<<<<<<<<<<<<<
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  */
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 75, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_javascript_jscript_livescript_v);
   __Pyx_GIVEREF(__pyx_kp_s_javascript_jscript_livescript_v);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_javascript_jscript_livescript_v);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_javascript_jscript_livescript_v);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
+  __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":77
+  /* "lxml/html/clean.py":82
  * _is_possibly_malicious_scheme = re.compile(
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search             # <<<<<<<<<<<<<<
  * def _is_javascript_scheme(s):
  *     if _is_image_dataurl(s):
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_search); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 77, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possibly_malicious_scheme, __pyx_t_5) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_search); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 82, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_possibly_malicious_scheme, __pyx_t_7) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":78
+  /* "lxml/html/clean.py":83
  *     r'(?:javascript|jscript|livescript|vbscript|data|about|mocha):',
  *     re.I).search
  * def _is_javascript_scheme(s):             # <<<<<<<<<<<<<<
  *     if _is_image_dataurl(s):
  *         return None
  */
-  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_1_is_javascript_scheme, 0, __pyx_n_s_is_javascript_scheme, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 78, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_javascript_scheme, __pyx_t_5) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_1_is_javascript_scheme, 0, __pyx_n_s_is_javascript_scheme, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_is_javascript_scheme, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":83
+  /* "lxml/html/clean.py":88
  *     return _is_possibly_malicious_scheme(s)
  * 
  * _substitute_whitespace = re.compile(r'[\s\x00-\x08\x0B\x0C\x0E-\x19]+').sub             # <<<<<<<<<<<<<<
  * # FIXME: should data: be blocked?
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_substitute_whitespace, __pyx_t_1) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_sub); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_substitute_whitespace, __pyx_t_9) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":87
+  /* "lxml/html/clean.py":92
  * 
  * # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
  * _conditional_comment_re = re.compile(             # <<<<<<<<<<<<<<
  *     r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":88
+  /* "lxml/html/clean.py":93
  * # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
  * _conditional_comment_re = re.compile(
  *     r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)             # <<<<<<<<<<<<<<
  * 
  * _find_styled_elements = etree.XPath(
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = PyNumber_Or(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_S); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_9 = PyNumber_Or(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":87
+  /* "lxml/html/clean.py":92
  * 
  * # FIXME: check against: http://msdn2.microsoft.com/en-us/library/ms537512.aspx
  * _conditional_comment_re = re.compile(             # <<<<<<<<<<<<<<
  *     r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
  * 
  */
-  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 87, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_kp_s_if_s_n_r_s_n_r);
   __Pyx_GIVEREF(__pyx_kp_s_if_s_n_r_s_n_r);
-  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_if_s_n_r_s_n_r);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_if_s_n_r_s_n_r);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_9);
+  __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_conditional_comment_re, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_conditional_comment_re, __pyx_t_9) < 0) __PYX_ERR(0, 92, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":90
+  /* "lxml/html/clean.py":95
  *     r'\[if[\s\n\r]+.*?][\s\n\r]*>', re.I|re.S)
  * 
  * _find_styled_elements = etree.XPath(             # <<<<<<<<<<<<<<
  *     "descendant-or-self::*[@style]")
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_XPath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 90, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_etree); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_XPath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 95, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_styled_elements, __pyx_t_1) < 0) __PYX_ERR(0, 90, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_styled_elements, __pyx_t_9) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":93
+  /* "lxml/html/clean.py":98
  *     "descendant-or-self::*[@style]")
  * 
  * _find_external_links = etree.XPath(             # <<<<<<<<<<<<<<
  *     ("descendant-or-self::a  [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
  *      "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_etree); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_etree); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_XPath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 98, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_XPath); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 93, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":96
+  /* "lxml/html/clean.py":101
  *     ("descendant-or-self::a  [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
  *      "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
  *     namespaces={'x':XHTML_NAMESPACE})             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 96, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 101, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_x, __pyx_t_9) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_namespaces, __pyx_t_5) < 0) __PYX_ERR(0, 96, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_XHTML_NAMESPACE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_x, __pyx_t_5) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_namespaces, __pyx_t_7) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":93
+  /* "lxml/html/clean.py":98
  *     "descendant-or-self::*[@style]")
  * 
  * _find_external_links = etree.XPath(             # <<<<<<<<<<<<<<
  *     ("descendant-or-self::a  [normalize-space(@href) and substring(normalize-space(@href),1,1) != '#'] |"
  *      "descendant-or-self::x:a[normalize-space(@href) and substring(normalize-space(@href),1,1) != '#']"),
  */
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__22, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 93, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__23, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_external_links, __pyx_t_5) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_find_external_links, __pyx_t_7) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":99
+  /* "lxml/html/clean.py":104
  * 
  * 
  * class Cleaner(object):             # <<<<<<<<<<<<<<
  *     """
  *     Instances cleans the document of each of the possible offending
  */
-  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__23); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_tuple__23, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 99, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_tuple__24); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_tuple__24, __pyx_n_s_Cleaner, __pyx_n_s_Cleaner, (PyObject *) NULL, __pyx_n_s_lxml_html_clean, __pyx_kp_s_Instances_cleans_the_document_o); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 104, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
 
-  /* "lxml/html/clean.py":194
+  /* "lxml/html/clean.py":199
  *     """
  * 
  *     scripts = True             # <<<<<<<<<<<<<<
  *     javascript = True
  *     comments = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 194, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_scripts, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":195
+  /* "lxml/html/clean.py":200
  * 
  *     scripts = True
  *     javascript = True             # <<<<<<<<<<<<<<
  *     comments = True
  *     style = False
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_javascript, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":196
+  /* "lxml/html/clean.py":201
  *     scripts = True
  *     javascript = True
  *     comments = True             # <<<<<<<<<<<<<<
  *     style = False
  *     inline_style = None
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 196, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_comments, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":197
+  /* "lxml/html/clean.py":202
  *     javascript = True
  *     comments = True
  *     style = False             # <<<<<<<<<<<<<<
  *     inline_style = None
  *     links = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 197, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_style, Py_False) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":198
+  /* "lxml/html/clean.py":203
  *     comments = True
  *     style = False
  *     inline_style = None             # <<<<<<<<<<<<<<
  *     links = True
  *     meta = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 198, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_inline_style, Py_None) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":199
+  /* "lxml/html/clean.py":204
  *     style = False
  *     inline_style = None
  *     links = True             # <<<<<<<<<<<<<<
  *     meta = True
  *     page_structure = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 199, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_links, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":200
+  /* "lxml/html/clean.py":205
  *     inline_style = None
  *     links = True
  *     meta = True             # <<<<<<<<<<<<<<
  *     page_structure = True
  *     processing_instructions = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_meta, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":201
+  /* "lxml/html/clean.py":206
  *     links = True
  *     meta = True
  *     page_structure = True             # <<<<<<<<<<<<<<
  *     processing_instructions = True
  *     embedded = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 201, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_page_structure, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":202
+  /* "lxml/html/clean.py":207
  *     meta = True
  *     page_structure = True
  *     processing_instructions = True             # <<<<<<<<<<<<<<
  *     embedded = True
  *     frames = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 202, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_processing_instructions, Py_True) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":203
+  /* "lxml/html/clean.py":208
  *     page_structure = True
  *     processing_instructions = True
  *     embedded = True             # <<<<<<<<<<<<<<
  *     frames = True
  *     forms = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 203, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_embedded, Py_True) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":204
+  /* "lxml/html/clean.py":209
  *     processing_instructions = True
  *     embedded = True
  *     frames = True             # <<<<<<<<<<<<<<
  *     forms = True
  *     annoying_tags = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 204, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_frames, Py_True) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":205
+  /* "lxml/html/clean.py":210
  *     embedded = True
  *     frames = True
  *     forms = True             # <<<<<<<<<<<<<<
  *     annoying_tags = True
  *     remove_tags = None
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 205, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_forms, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":206
+  /* "lxml/html/clean.py":211
  *     frames = True
  *     forms = True
  *     annoying_tags = True             # <<<<<<<<<<<<<<
  *     remove_tags = None
  *     allow_tags = None
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_annoying_tags, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":207
+  /* "lxml/html/clean.py":212
  *     forms = True
  *     annoying_tags = True
  *     remove_tags = None             # <<<<<<<<<<<<<<
  *     allow_tags = None
  *     kill_tags = None
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_tags, Py_None) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":208
+  /* "lxml/html/clean.py":213
  *     annoying_tags = True
  *     remove_tags = None
  *     allow_tags = None             # <<<<<<<<<<<<<<
  *     kill_tags = None
  *     remove_unknown_tags = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_tags, Py_None) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":209
+  /* "lxml/html/clean.py":214
  *     remove_tags = None
  *     allow_tags = None
  *     kill_tags = None             # <<<<<<<<<<<<<<
  *     remove_unknown_tags = True
  *     safe_attrs_only = True
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 209, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_tags, Py_None) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":210
+  /* "lxml/html/clean.py":215
  *     allow_tags = None
  *     kill_tags = None
  *     remove_unknown_tags = True             # <<<<<<<<<<<<<<
  *     safe_attrs_only = True
  *     safe_attrs = defs.safe_attrs
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_unknown_tags, Py_True) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":211
+  /* "lxml/html/clean.py":216
  *     kill_tags = None
  *     remove_unknown_tags = True
  *     safe_attrs_only = True             # <<<<<<<<<<<<<<
  *     safe_attrs = defs.safe_attrs
  *     add_nofollow = False
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 211, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_safe_attrs_only, Py_True) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":212
+  /* "lxml/html/clean.py":217
  *     remove_unknown_tags = True
  *     safe_attrs_only = True
  *     safe_attrs = defs.safe_attrs             # <<<<<<<<<<<<<<
  *     add_nofollow = False
  *     host_whitelist = ()
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_defs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 212, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_safe_attrs, __pyx_t_9) < 0) __PYX_ERR(0, 212, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_defs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_safe_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_safe_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":213
+  /* "lxml/html/clean.py":218
  *     safe_attrs_only = True
  *     safe_attrs = defs.safe_attrs
  *     add_nofollow = False             # <<<<<<<<<<<<<<
  *     host_whitelist = ()
  *     whitelist_tags = {'iframe', 'embed'}
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 213, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_add_nofollow, Py_False) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":214
+  /* "lxml/html/clean.py":219
  *     safe_attrs = defs.safe_attrs
  *     add_nofollow = False
  *     host_whitelist = ()             # <<<<<<<<<<<<<<
  *     whitelist_tags = {'iframe', 'embed'}
  * 
  */
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 214, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_host_whitelist, __pyx_empty_tuple) < 0) __PYX_ERR(0, 219, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":215
+  /* "lxml/html/clean.py":220
  *     add_nofollow = False
  *     host_whitelist = ()
  *     whitelist_tags = {'iframe', 'embed'}             # <<<<<<<<<<<<<<
  * 
  *     def __init__(self, **kw):
  */
-  __pyx_t_9 = PySet_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PySet_Add(__pyx_t_9, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  if (PySet_Add(__pyx_t_9, __pyx_n_s_embed) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_whitelist_tags, __pyx_t_9) < 0) __PYX_ERR(0, 215, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = PySet_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PySet_Add(__pyx_t_5, __pyx_n_s_iframe) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_5, __pyx_n_s_embed) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_whitelist_tags, __pyx_t_5) < 0) __PYX_ERR(0, 220, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":217
+  /* "lxml/html/clean.py":222
  *     whitelist_tags = {'iframe', 'embed'}
  * 
  *     def __init__(self, **kw):             # <<<<<<<<<<<<<<
  *         not_an_attribute = object()
  *         for name, value in kw.items():
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_9) < 0) __PYX_ERR(0, 217, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_1__init__, 0, __pyx_n_s_Cleaner___init, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__26)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_5) < 0) __PYX_ERR(0, 222, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":238
+  /* "lxml/html/clean.py":243
  *     # removal:
  *     _tag_link_attrs = dict(
  *         script='src',             # <<<<<<<<<<<<<<
  *         link='href',
  *         # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
  */
-  __pyx_t_9 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 238, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyDict_NewPresized(7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_script, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_link, __pyx_n_s_href) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":242
+  /* "lxml/html/clean.py":247
  *         # From: http://java.sun.com/j2se/1.4.2/docs/guide/misc/applet.html
  *         # From what I can tell, both attributes can contain a link:
  *         applet=['code', 'object'],             # <<<<<<<<<<<<<<
  *         iframe='src',
  *         embed='src',
  */
-  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 242, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 247, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_code);
+  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_code);
   __Pyx_INCREF(__pyx_n_s_object);
   __Pyx_GIVEREF(__pyx_n_s_object);
-  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_object);
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_applet, __pyx_t_7) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_9, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 238, __pyx_L1_error)
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_tag_link_attrs, __pyx_t_9) < 0) __PYX_ERR(0, 237, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
-  /* "lxml/html/clean.py":257
+  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_object);
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_applet, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_iframe, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_embed, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_layer, __pyx_n_s_src) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_a, __pyx_n_s_href) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_tag_link_attrs, __pyx_t_5) < 0) __PYX_ERR(0, 242, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+  /* "lxml/html/clean.py":262
  *         )
  * 
  *     def __call__(self, doc):             # <<<<<<<<<<<<<<
  *         """
  *         Cleans the document.
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 257, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_call, __pyx_t_9) < 0) __PYX_ERR(0, 257, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_3__call__, 0, __pyx_n_s_Cleaner___call, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 262, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_call, __pyx_t_5) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":442
+  /* "lxml/html/clean.py":447
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
  *         """
  *         Override to suppress rel="nofollow" on some anchors.
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 442, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_follow, __pyx_t_9) < 0) __PYX_ERR(0, 442, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_5allow_follow, 0, __pyx_n_s_Cleaner_allow_follow, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_follow, __pyx_t_5) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":448
+  /* "lxml/html/clean.py":453
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
  *         """
  *         Decide whether an element is configured to be accepted or rejected.
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 448, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_element, __pyx_t_9) < 0) __PYX_ERR(0, 448, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_7allow_element, 0, __pyx_n_s_Cleaner_allow_element, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__32)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_element, __pyx_t_5) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":472
+  /* "lxml/html/clean.py":477
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
  *         """
  *         Decide whether a URL that was found in an element's attributes or text
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 472, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_allow_embedded_url, __pyx_t_9) < 0) __PYX_ERR(0, 472, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_9allow_embedded_url, 0, __pyx_n_s_Cleaner_allow_embedded_url, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_allow_embedded_url, __pyx_t_5) < 0) __PYX_ERR(0, 477, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":491
+  /* "lxml/html/clean.py":496
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
  *         """
  *         IE conditional comments basically embed HTML that the parser
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__35)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_conditional_comments, __pyx_t_9) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_11kill_conditional_comments, 0, __pyx_n_s_Cleaner_kill_conditional_comment_2, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_conditional_comments, __pyx_t_5) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":502
+  /* "lxml/html/clean.py":507
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
  *         bad = []
  *         for el in doc.iter(iterate):
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 502, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__38);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_kill_elements, __pyx_t_9) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_13_kill_elements, 0, __pyx_n_s_Cleaner__kill_elements, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_tuple__39);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_kill_elements, __pyx_t_5) < 0) __PYX_ERR(0, 507, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":510
+  /* "lxml/html/clean.py":515
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
  *         # links like "j a v a s c r i p t:" might be interpreted in IE
  *         new = _substitute_whitespace('', unquote_plus(link))
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 510, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_remove_javascript_link, __pyx_t_9) < 0) __PYX_ERR(0, 510, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_15_remove_javascript_link, 0, __pyx_n_s_Cleaner__remove_javascript_link, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__41)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_remove_javascript_link, __pyx_t_5) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":518
+  /* "lxml/html/clean.py":523
  *         return link
  * 
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub             # <<<<<<<<<<<<<<
  * 
  *     def _has_sneaky_javascript(self, style):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_compile); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 518, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_S); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 518, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_10);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = NULL;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_S); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 523, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_11);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_1 = NULL;
   __pyx_t_6 = 0;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
-    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
-    if (likely(__pyx_t_7)) {
+    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
+    if (likely(__pyx_t_1)) {
       PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
-      __Pyx_INCREF(__pyx_t_7);
+      __Pyx_INCREF(__pyx_t_1);
       __Pyx_INCREF(function);
       __Pyx_DECREF_SET(__pyx_t_8, function);
       __pyx_t_6 = 1;
@@ -16049,602 +16232,602 @@ if (!__Pyx_RefNanny) {
   }
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s__41, __pyx_t_10};
-    __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__42, __pyx_t_11};
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   } else
   #endif
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
-    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s__41, __pyx_t_10};
-    __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
-    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s__42, __pyx_t_11};
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
   } else
   #endif
   {
-    __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 518, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_11);
-    if (__pyx_t_7) {
-      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_7); __pyx_t_7 = NULL;
-    }
-    __Pyx_INCREF(__pyx_kp_s__41);
-    __Pyx_GIVEREF(__pyx_kp_s__41);
-    PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_6, __pyx_kp_s__41);
-    __Pyx_GIVEREF(__pyx_t_10);
-    PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_6, __pyx_t_10);
-    __pyx_t_10 = 0;
-    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 518, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_9);
-    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+    __pyx_t_12 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_12);
+    if (__pyx_t_1) {
+      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
+    }
+    __Pyx_INCREF(__pyx_kp_s__42);
+    __Pyx_GIVEREF(__pyx_kp_s__42);
+    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_kp_s__42);
+    __Pyx_GIVEREF(__pyx_t_11);
+    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_11);
+    __pyx_t_11 = 0;
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 523, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
   }
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 518, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sub); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_substitute_comments, __pyx_t_8) < 0) __PYX_ERR(0, 518, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_substitute_comments, __pyx_t_8) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/html/clean.py":520
+  /* "lxml/html/clean.py":525
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
  * 
  *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
  *         """
  *         Depending on the browser, stuff like ``e x p r e s s i o n(...)``
  */
-  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 520, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_17_has_sneaky_javascript, 0, __pyx_n_s_Cleaner__has_sneaky_javascript, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_has_sneaky_javascript, __pyx_t_8) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_has_sneaky_javascript, __pyx_t_8) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/html/clean.py":544
+  /* "lxml/html/clean.py":552
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
  *         result_type = type(html)
  *         if isinstance(html, basestring):
  */
-  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7Cleaner_19clean_html, 0, __pyx_n_s_Cleaner_clean_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 552, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_clean_html, __pyx_t_8) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_clean_html, __pyx_t_8) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/html/clean.py":99
+  /* "lxml/html/clean.py":104
  * 
  * 
  * class Cleaner(object):             # <<<<<<<<<<<<<<
  *     """
  *     Instances cleans the document of each of the possible offending
  */
-  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Cleaner, __pyx_tuple__23, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 99, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_n_s_Cleaner, __pyx_tuple__24, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 104, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_8) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cleaner, __pyx_t_8) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":553
+  /* "lxml/html/clean.py":561
  *         return _transform_result(result_type, doc)
  * 
  * clean = Cleaner()             # <<<<<<<<<<<<<<
  * clean_html = clean.clean_html
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Cleaner); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 553, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean, __pyx_t_1) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_Cleaner); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 561, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 561, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean, __pyx_t_9) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":554
+  /* "lxml/html/clean.py":562
  * 
  * clean = Cleaner()
  * clean_html = clean.clean_html             # <<<<<<<<<<<<<<
  * 
  * ############################################################
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_clean); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 554, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_clean_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_html, __pyx_t_5) < 0) __PYX_ERR(0, 554, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_clean); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 562, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_clean_html); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 562, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_clean_html, __pyx_t_7) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":561
+  /* "lxml/html/clean.py":569
  * 
  * _link_regexes = [
  *     re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),             # <<<<<<<<<<<<<<
  *     # This is conservative, but autolinking can be a bit conservative:
  *     re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z]))', re.I),
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
   __Pyx_GIVEREF(__pyx_kp_s_P_body_https_P_host_a_z0_9);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_P_body_https_P_host_a_z0_9);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_P_body_https_P_host_a_z0_9);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
   __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 561, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":563
+  /* "lxml/html/clean.py":571
  *     re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
  *     # This is conservative, but autolinking can be a bit conservative:
  *     re.compile(r'mailto:(?P<body>[a-z0-9._-]+@(?P<host>[a-z0-9_.-]+[a-z]))', re.I),             # <<<<<<<<<<<<<<
  *     ]
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 563, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
   __Pyx_GIVEREF(__pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
-  __pyx_t_9 = 0;
-  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 563, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_mailto_P_body_a_z0_9___P_host_a);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
+  __pyx_t_5 = 0;
+  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":560
+  /* "lxml/html/clean.py":568
  * ############################################################
  * 
  * _link_regexes = [             # <<<<<<<<<<<<<<
  *     re.compile(r'(?P<body>https?://(?P<host>[a-z0-9._-]+)(?:/[/\-_.,a-z0-9%&?;=~]*)?(?:\([/\-_.,a-z0-9%&?;=~]*\))?)', re.I),
  *     # This is conservative, but autolinking can be a bit conservative:
  */
-  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = PyList_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 568, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_9);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
   __pyx_t_8 = 0;
-  __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_5) < 0) __PYX_ERR(0, 560, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_regexes_2, __pyx_t_7) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":566
+  /* "lxml/html/clean.py":574
  *     ]
  * 
  * _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a']             # <<<<<<<<<<<<<<
  * 
  * _avoid_hosts = [
  */
-  __pyx_t_5 = PyList_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = PyList_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_n_s_textarea);
   __Pyx_GIVEREF(__pyx_n_s_textarea);
-  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_textarea);
+  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_textarea);
   __Pyx_INCREF(__pyx_n_s_pre);
   __Pyx_GIVEREF(__pyx_n_s_pre);
-  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_pre);
+  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_pre);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_code);
+  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_code);
   __Pyx_INCREF(__pyx_n_s_head);
   __Pyx_GIVEREF(__pyx_n_s_head);
-  PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_head);
+  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_n_s_head);
   __Pyx_INCREF(__pyx_n_s_select);
   __Pyx_GIVEREF(__pyx_n_s_select);
-  PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_s_select);
+  PyList_SET_ITEM(__pyx_t_7, 4, __pyx_n_s_select);
   __Pyx_INCREF(__pyx_n_s_a);
   __Pyx_GIVEREF(__pyx_n_s_a);
-  PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_s_a);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_5) < 0) __PYX_ERR(0, 566, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  PyList_SET_ITEM(__pyx_t_7, 5, __pyx_n_s_a);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_elements_2, __pyx_t_7) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":569
+  /* "lxml/html/clean.py":577
  * 
  * _avoid_hosts = [
  *     re.compile(r'^localhost', re.I),             # <<<<<<<<<<<<<<
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  *     re.compile(r'^127\.0\.0\.1$'),
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 569, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_localhost);
   __Pyx_GIVEREF(__pyx_kp_s_localhost);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_localhost);
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_localhost);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_8);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8);
   __pyx_t_8 = 0;
-  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 569, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 577, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":570
+  /* "lxml/html/clean.py":578
  * _avoid_hosts = [
  *     re.compile(r'^localhost', re.I),
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),             # <<<<<<<<<<<<<<
  *     re.compile(r'^127\.0\.0\.1$'),
  *     ]
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_I); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 578, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_kp_s_bexample_com_org_net);
   __Pyx_GIVEREF(__pyx_kp_s_bexample_com_org_net);
-  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_bexample_com_org_net);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 570, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_s_bexample_com_org_net);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_9);
+  __pyx_t_9 = 0;
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 578, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":571
+  /* "lxml/html/clean.py":579
  *     re.compile(r'^localhost', re.I),
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  *     re.compile(r'^127\.0\.0\.1$'),             # <<<<<<<<<<<<<<
  *     ]
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_re); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_compile); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 571, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 579, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":568
+  /* "lxml/html/clean.py":576
  * _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a']
  * 
  * _avoid_hosts = [             # <<<<<<<<<<<<<<
  *     re.compile(r'^localhost', re.I),
  *     re.compile(r'\bexample\.(?:com|org|net)$', re.I),
  */
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_8);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_t_5);
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
+  __Pyx_GIVEREF(__pyx_t_9);
+  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_t_7);
   __pyx_t_8 = 0;
-  __pyx_t_1 = 0;
-  __pyx_t_5 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_9) < 0) __PYX_ERR(0, 568, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_9 = 0;
+  __pyx_t_7 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_hosts_2, __pyx_t_5) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":574
+  /* "lxml/html/clean.py":582
  *     ]
  * 
  * _avoid_classes = ['nolink']             # <<<<<<<<<<<<<<
  * 
  * def autolink(el, link_regexes=_link_regexes,
  */
-  __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_nolink);
   __Pyx_GIVEREF(__pyx_n_s_nolink);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_nolink);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_9) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_nolink);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_classes_2, __pyx_t_5) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":576
+  /* "lxml/html/clean.py":584
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 576, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 576, __pyx_L1_error)
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 576, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_3autolink, 0, __pyx_n_s_autolink, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__49)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_link_regexes = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults), 4)) __PYX_ERR(0, 584, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_link_regexes = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":577
+  /* "lxml/html/clean.py":585
  * 
  * def autolink(el, link_regexes=_link_regexes,
  *              avoid_elements=_avoid_elements,             # <<<<<<<<<<<<<<
  *              avoid_hosts=_avoid_hosts,
  *              avoid_classes=_avoid_classes):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_elements = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_elements_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 585, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_elements = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":578
+  /* "lxml/html/clean.py":586
  * def autolink(el, link_regexes=_link_regexes,
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,             # <<<<<<<<<<<<<<
  *              avoid_classes=_avoid_classes):
  *     """
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_hosts = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_hosts_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 586, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_hosts = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":579
+  /* "lxml/html/clean.py":587
  *              avoid_elements=_avoid_elements,
  *              avoid_hosts=_avoid_hosts,
  *              avoid_classes=_avoid_classes):             # <<<<<<<<<<<<<<
  *     """
  *     Turn any URLs into links.
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_9)->__pyx_arg_avoid_classes = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
-  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_4lxml_4html_5clean_16__defaults__);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_9) < 0) __PYX_ERR(0, 576, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_classes_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 587, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_5)->__pyx_arg_avoid_classes = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_4lxml_4html_5clean_16__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink, __pyx_t_5) < 0) __PYX_ERR(0, 584, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":621
+  /* "lxml/html/clean.py":629
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
  *     leading_text = ''
  *     links = []
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 621, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_9) < 0) __PYX_ERR(0, 621, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_5_link_text, 0, __pyx_n_s_link_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 629, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_link_text, __pyx_t_5) < 0) __PYX_ERR(0, 629, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":679
+  /* "lxml/html/clean.py":687
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
  *     result_type = type(html)
  *     if isinstance(html, basestring):
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 679, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_9) < 0) __PYX_ERR(0, 679, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_7autolink_html, 0, __pyx_n_s_autolink_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__53)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_autolink_html, __pyx_t_5) < 0) __PYX_ERR(0, 687, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":688
+  /* "lxml/html/clean.py":696
  *     return _transform_result(result_type, doc)
  * 
  * autolink_html.__doc__ = autolink.__doc__             # <<<<<<<<<<<<<<
  * 
  * ############################################################
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_autolink); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 688, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_autolink); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_autolink_html); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 688, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_doc_2, __pyx_t_5) < 0) __PYX_ERR(0, 688, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_doc_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 696, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_autolink_html); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 696, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_doc_2, __pyx_t_7) < 0) __PYX_ERR(0, 696, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":694
+  /* "lxml/html/clean.py":702
  * ############################################################
  * 
  * _avoid_word_break_elements = ['pre', 'textarea', 'code']             # <<<<<<<<<<<<<<
  * _avoid_word_break_classes = ['nobreak']
  * 
  */
-  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 694, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = PyList_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_pre);
   __Pyx_GIVEREF(__pyx_n_s_pre);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_pre);
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_pre);
   __Pyx_INCREF(__pyx_n_s_textarea);
   __Pyx_GIVEREF(__pyx_n_s_textarea);
-  PyList_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_textarea);
+  PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_textarea);
   __Pyx_INCREF(__pyx_n_s_code);
   __Pyx_GIVEREF(__pyx_n_s_code);
-  PyList_SET_ITEM(__pyx_t_9, 2, __pyx_n_s_code);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_9) < 0) __PYX_ERR(0, 694, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_code);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_elements, __pyx_t_5) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":695
+  /* "lxml/html/clean.py":703
  * 
  * _avoid_word_break_elements = ['pre', 'textarea', 'code']
  * _avoid_word_break_classes = ['nobreak']             # <<<<<<<<<<<<<<
  * 
  * def word_break(el, max_width=40,
  */
-  __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
+  __pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 703, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_nobreak);
   __Pyx_GIVEREF(__pyx_n_s_nobreak);
-  PyList_SET_ITEM(__pyx_t_9, 0, __pyx_n_s_nobreak);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_9) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_nobreak);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_avoid_word_break_classes, __pyx_t_5) < 0) __PYX_ERR(0, 703, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":697
+  /* "lxml/html/clean.py":705
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__54)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 697, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 697, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_9word_break, 0, __pyx_n_s_word_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 705, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_5, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 705, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":698
+  /* "lxml/html/clean.py":706
  * 
  * def word_break(el, max_width=40,
  *                avoid_elements=_avoid_word_break_elements,             # <<<<<<<<<<<<<<
  *                avoid_classes=_avoid_word_break_classes,
  *                break_character=unichr(0x200b)):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_avoid_elements = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 706, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_avoid_elements = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":699
+  /* "lxml/html/clean.py":707
  * def word_break(el, max_width=40,
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,             # <<<<<<<<<<<<<<
  *                break_character=unichr(0x200b)):
  *     """
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 699, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_avoid_classes = __pyx_t_5;
-  __Pyx_GIVEREF(__pyx_t_5);
-  __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_avoid_word_break_classes); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 707, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_avoid_classes = __pyx_t_7;
+  __Pyx_GIVEREF(__pyx_t_7);
+  __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":700
+  /* "lxml/html/clean.py":708
  *                avoid_elements=_avoid_word_break_elements,
  *                avoid_classes=_avoid_word_break_classes,
  *                break_character=unichr(0x200b)):             # <<<<<<<<<<<<<<
  *     """
  *     Breaks any long words found in the body of the text (not attributes).
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_unichr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_unichr); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 708, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_5)->__pyx_arg_break_character = __pyx_t_9;
+  __Pyx_GIVEREF(__pyx_t_9);
+  __pyx_t_9 = 0;
+  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_5, __pyx_pf_4lxml_4html_5clean_18__defaults__);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_5) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_9)->__pyx_arg_break_character = __pyx_t_1;
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
-  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_9, __pyx_pf_4lxml_4html_5clean_18__defaults__);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break, __pyx_t_9) < 0) __PYX_ERR(0, 697, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-  /* "lxml/html/clean.py":738
+  /* "lxml/html/clean.py":746
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
  *     result_type = type(html)
  *     doc = fromstring(html)
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 738, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_9) < 0) __PYX_ERR(0, 738, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_11word_break_html, 0, __pyx_n_s_word_break_html, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__58)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_word_break_html, __pyx_t_5) < 0) __PYX_ERR(0, 746, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":744
+  /* "lxml/html/clean.py":752
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
  *     words = text.split()
  *     for word in words:
  */
-  __pyx_t_9 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 744, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_9) < 0) __PYX_ERR(0, 744, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_13_break_text, 0, __pyx_n_s_break_text, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__60)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_text, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":752
+  /* "lxml/html/clean.py":760
  *     return text
  * 
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)             # <<<<<<<<<<<<<<
  * 
  * def _insert_break(word, width, break_character):
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 752, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_re); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_9);
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_I); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_kp_s_a_z);
   __Pyx_GIVEREF(__pyx_kp_s_a_z);
-  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_s_a_z);
-  __Pyx_GIVEREF(__pyx_t_5);
-  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_5);
-  __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_s_a_z);
+  __Pyx_GIVEREF(__pyx_t_7);
+  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_7);
+  __pyx_t_7 = 0;
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_5) < 0) __PYX_ERR(0, 752, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_break_prefer_re, __pyx_t_7) < 0) __PYX_ERR(0, 760, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "lxml/html/clean.py":754
+  /* "lxml/html/clean.py":762
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
  *     orig_word = word
  *     result = ''
  */
-  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 754, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_5) < 0) __PYX_ERR(0, 754, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_4html_5clean_15_insert_break, 0, __pyx_n_s_insert_break, NULL, __pyx_n_s_lxml_html_clean, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 762, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_insert_break, __pyx_t_7) < 0) __PYX_ERR(0, 762, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "lxml/html/clean.py":1
  * # cython: language_level=3str             # <<<<<<<<<<<<<<
  * 
  * """A cleanup tool for HTML.
  */
-  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_5);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+  __pyx_t_7 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /*--- Wrapped vars code ---*/
 
@@ -16656,8 +16839,8 @@ if (!__Pyx_RefNanny) {
   __Pyx_XDECREF(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8);
   __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_XDECREF(__pyx_t_10);
   __Pyx_XDECREF(__pyx_t_11);
+  __Pyx_XDECREF(__pyx_t_12);
   if (__pyx_m) {
     if (__pyx_d) {
       __Pyx_AddTraceback("init lxml.html.clean", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -16691,48 +16874,49 @@ static CYTHON_SMALL_CODE void __Pyx_CleanupGlobals(void) {
   Py_CLEAR(__pyx_slice__14);
   Py_CLEAR(__pyx_slice__17);
   Py_CLEAR(__pyx_tuple__18);
-  Py_CLEAR(__pyx_codeobj__19);
-  Py_CLEAR(__pyx_tuple__20);
+  Py_CLEAR(__pyx_tuple__19);
+  Py_CLEAR(__pyx_codeobj__20);
   Py_CLEAR(__pyx_tuple__21);
   Py_CLEAR(__pyx_tuple__22);
   Py_CLEAR(__pyx_tuple__23);
   Py_CLEAR(__pyx_tuple__24);
-  Py_CLEAR(__pyx_codeobj__25);
-  Py_CLEAR(__pyx_tuple__26);
-  Py_CLEAR(__pyx_codeobj__27);
-  Py_CLEAR(__pyx_tuple__28);
-  Py_CLEAR(__pyx_codeobj__29);
-  Py_CLEAR(__pyx_tuple__30);
-  Py_CLEAR(__pyx_codeobj__31);
-  Py_CLEAR(__pyx_tuple__32);
-  Py_CLEAR(__pyx_codeobj__33);
-  Py_CLEAR(__pyx_tuple__34);
-  Py_CLEAR(__pyx_codeobj__35);
-  Py_CLEAR(__pyx_tuple__36);
-  Py_CLEAR(__pyx_codeobj__37);
-  Py_CLEAR(__pyx_tuple__38);
+  Py_CLEAR(__pyx_tuple__25);
+  Py_CLEAR(__pyx_codeobj__26);
+  Py_CLEAR(__pyx_tuple__27);
+  Py_CLEAR(__pyx_codeobj__28);
+  Py_CLEAR(__pyx_tuple__29);
+  Py_CLEAR(__pyx_codeobj__30);
+  Py_CLEAR(__pyx_tuple__31);
+  Py_CLEAR(__pyx_codeobj__32);
+  Py_CLEAR(__pyx_tuple__33);
+  Py_CLEAR(__pyx_codeobj__34);
+  Py_CLEAR(__pyx_tuple__35);
+  Py_CLEAR(__pyx_codeobj__36);
+  Py_CLEAR(__pyx_tuple__37);
+  Py_CLEAR(__pyx_codeobj__38);
   Py_CLEAR(__pyx_tuple__39);
-  Py_CLEAR(__pyx_codeobj__40);
-  Py_CLEAR(__pyx_tuple__42);
-  Py_CLEAR(__pyx_codeobj__43);
-  Py_CLEAR(__pyx_tuple__44);
-  Py_CLEAR(__pyx_codeobj__45);
-  Py_CLEAR(__pyx_tuple__46);
+  Py_CLEAR(__pyx_tuple__40);
+  Py_CLEAR(__pyx_codeobj__41);
+  Py_CLEAR(__pyx_tuple__43);
+  Py_CLEAR(__pyx_codeobj__44);
+  Py_CLEAR(__pyx_tuple__45);
+  Py_CLEAR(__pyx_codeobj__46);
   Py_CLEAR(__pyx_tuple__47);
-  Py_CLEAR(__pyx_codeobj__48);
-  Py_CLEAR(__pyx_tuple__49);
-  Py_CLEAR(__pyx_codeobj__50);
-  Py_CLEAR(__pyx_tuple__51);
-  Py_CLEAR(__pyx_codeobj__52);
-  Py_CLEAR(__pyx_tuple__53);
-  Py_CLEAR(__pyx_codeobj__54);
-  Py_CLEAR(__pyx_tuple__55);
+  Py_CLEAR(__pyx_tuple__48);
+  Py_CLEAR(__pyx_codeobj__49);
+  Py_CLEAR(__pyx_tuple__50);
+  Py_CLEAR(__pyx_codeobj__51);
+  Py_CLEAR(__pyx_tuple__52);
+  Py_CLEAR(__pyx_codeobj__53);
+  Py_CLEAR(__pyx_tuple__54);
+  Py_CLEAR(__pyx_codeobj__55);
   Py_CLEAR(__pyx_tuple__56);
-  Py_CLEAR(__pyx_codeobj__57);
-  Py_CLEAR(__pyx_tuple__58);
-  Py_CLEAR(__pyx_codeobj__59);
-  Py_CLEAR(__pyx_tuple__60);
-  Py_CLEAR(__pyx_codeobj__61);
+  Py_CLEAR(__pyx_tuple__57);
+  Py_CLEAR(__pyx_codeobj__58);
+  Py_CLEAR(__pyx_tuple__59);
+  Py_CLEAR(__pyx_codeobj__60);
+  Py_CLEAR(__pyx_tuple__61);
+  Py_CLEAR(__pyx_codeobj__62);
   /* CodeObjectCache.cleanup */
   if (__pyx_code_cache.entries) {
       __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
index 7b51981d7effc11e173987a27a2b3096c8c0c385..0494357e5b01ab03129de49b58da3ec29f74d1c0 100644 (file)
@@ -8,8 +8,9 @@ details.
 
 from __future__ import absolute_import
 
-import re
 import copy
+import re
+import sys
 try:
     from urlparse import urlsplit
     from urllib import unquote_plus
@@ -61,12 +62,16 @@ __all__ = ['clean_html', 'clean', 'Cleaner', 'autolink', 'autolink_html',
 
 # This is an IE-specific construct you can have in a stylesheet to
 # run some Javascript:
-_css_javascript_re = re.compile(
-    r'expression\s*\(.*?\)', re.S|re.I)
+_replace_css_javascript = re.compile(
+    r'expression\s*\(.*?\)', re.S|re.I).sub
 
 # Do I have to worry about @\nimport?
-_css_import_re = re.compile(
-    r'@\s*import', re.I)
+_replace_css_import = re.compile(
+    r'@\s*import', re.I).sub
+
+_looks_like_tag_content = re.compile(
+    r'</?[a-zA-Z]+|\son[a-zA-Z]+\s*=',
+    *((re.ASCII,) if sys.version_info[0] >= 3 else ())).search
 
 # All kinds of schemes besides just javascript: that can cause
 # execution:
@@ -304,8 +309,8 @@ class Cleaner(object):
             if not self.inline_style:
                 for el in _find_styled_elements(doc):
                     old = el.get('style')
-                    new = _css_javascript_re.sub('', old)
-                    new = _css_import_re.sub('', new)
+                    new = _replace_css_javascript('', old)
+                    new = _replace_css_import('', new)
                     if self._has_sneaky_javascript(new):
                         # Something tricky is going on...
                         del el.attrib['style']
@@ -317,9 +322,9 @@ class Cleaner(object):
                         el.drop_tree()
                         continue
                     old = el.text or ''
-                    new = _css_javascript_re.sub('', old)
+                    new = _replace_css_javascript('', old)
                     # The imported CSS can do anything; we just can't allow:
-                    new = _css_import_re.sub('', old)
+                    new = _replace_css_import('', new)
                     if self._has_sneaky_javascript(new):
                         # Something tricky is going on...
                         el.text = '/* deleted */'
@@ -539,6 +544,9 @@ class Cleaner(object):
         if '</noscript' in style:
             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
             return True
+        if _looks_like_tag_content(style):
+            # e.g. '<math><style><img src=x onerror=alert(1)></style></math>'
+            return True
         return False
 
     def clean_html(self, html):
index 3c8ee252f90a34682e1a54f57d04ce0c4c56f280..0e669f98d37a2f898347998bbe3f4c62792d25c6 100644 (file)
@@ -113,6 +113,16 @@ class CleanerTest(unittest.TestCase):
             b'<noscript><style>/* deleted */</style></noscript>',
             lxml.html.tostring(clean_html(s)))
 
+    def test_sneaky_js_in_math_style(self):
+        # This gets parsed as <math> -> <style>"..."</style>
+        # thus passing any tag/script/whatever content through into the output.
+        html = '<math><style><img src=x onerror=alert(1)></style></math>'
+        s = lxml.html.fragment_fromstring(html)
+
+        self.assertEqual(
+            b'<math><style>/* deleted */</style></math>',
+            lxml.html.tostring(clean_html(s)))
+
 
 def test_suite():
     suite = unittest.TestSuite()
index 275be07c6419315817aad6a57e4475b09c84b0ea..18e6c7e614b5140d5c6e051a01bc10aac5a2ea78 100644 (file)
 >>> print(Cleaner(page_structure=False, comments=False).clean_html(doc))
 <html>
   <head>
-    <style>/* deleted */</style>
+    <style>
+      body {background-image: url()};
+      div {background-image: url()};
+      div {color: };
+    </style>
   </head>
   <body>
     <!-- I am interpreted for EVIL! -->
 >>> print(Cleaner(page_structure=False, safe_attrs_only=False).clean_html(doc))
 <html>
   <head>
-    <style>/* deleted */</style>
+    <style>
+      body {background-image: url()};
+      div {background-image: url()};
+      div {color: };
+    </style>
   </head>
   <body>
     <a href="">a link</a>
     <link rel="alternate" type="text/rss" src="evil-rss">
     <link rel="alternate" type="text/rss" href="http://example.com">
     <link rel="stylesheet" type="text/rss" href="http://example.com">
-    <style>/* deleted */</style>
+    <style>
+      body {background-image: url()};
+      div {background-image: url()};
+      div {color: };
+    </style>
   </head>
   <body>
     <a href="">a link</a>
index 63bdca71a5937af28b017ac1a4fb994fd2b13765..a14d4bcfcc9b1a14bd7a0bb28ff1a8db18988d34 100644 (file)
@@ -1,3 +1,3 @@
 #ifndef LXML_VERSION_STRING
-#define LXML_VERSION_STRING "4.6.1"
+#define LXML_VERSION_STRING "4.6.2"
 #endif