Imported Upstream version 4.6.1 upstream/4.6.1
authorJinWang An <jinwang.an@samsung.com>
Wed, 30 Dec 2020 01:20:58 +0000 (10:20 +0900)
committerJinWang An <jinwang.an@samsung.com>
Wed, 30 Dec 2020 01:20:58 +0000 (10:20 +0900)
76 files changed:
CHANGES.txt
PKG-INFO
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 [moved from doc/html/changes-4.6.0.html with 99% similarity]
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/mklatex.py
doc/pdf/pubkey.asc [new file with mode: 0644]
src/lxml.egg-info/PKG-INFO
src/lxml.egg-info/SOURCES.txt
src/lxml/__init__.py
src/lxml/etree.c
src/lxml/html/clean.c
src/lxml/html/clean.py
src/lxml/html/tests/test_clean.py
src/lxml/includes/lxml-version.h
src/lxml/sax.c

index ca34d68..7afec7e 100644 (file)
@@ -2,6 +2,16 @@
 lxml changelog
 ==============
 
+4.6.1 (2020-10-18)
+==================
+
+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.
+
+
 4.6.0 (2020-10-17)
 ==================
 
index 583ea01..d2d538c 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: lxml
-Version: 4.6.0
+Version: 4.6.1
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: https://lxml.de/
 Author: lxml dev team
@@ -38,32 +38,14 @@ 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.0 (2020-10-17)
+        4.6.1 (2020-10-18)
         ==================
         
-        Features added
-        --------------
-        
-        * GH#310: ``lxml.html.InputGetter`` supports ``__len__()`` to count the number of input fields.
-          Patch by Aidan Woolley.
-        
-        * ``lxml.html.InputGetter`` has a new ``.items()`` method to ease processing all input fields.
-        
-        * ``lxml.html.InputGetter.keys()`` now returns the field names in document order.
-        
-        * GH-309: The API documentation is now generated using ``sphinx-apidoc``.
-          Patch by Chris Mayo.
-        
         Bugs fixed
         ----------
         
-        * LP#1869455: C14N 2.0 serialisation failed for unprefixed attributes
-          when a default namespace was defined.
-        
-        * ``TreeBuilder.close()`` raised ``AssertionError`` in some error cases where it
-          should have raised ``XMLSyntaxError``.  It now raises a combined exception to
-          keep up backwards compatibility, while switching to ``XMLSyntaxError`` as an
-          interface.
+        * 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.
         
         
         
index 5f8a4cc..6efc1d9 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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>
@@ -1021,7 +1021,7 @@ map it to your namespace.  See also the question above.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 89b3af4..531f6c0 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 0b0be33..fbc532a 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 59a2127..b16b0b3 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index ea62484..fcf30ca 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </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.0&quot;</span>
+<span class="n">__version__</span> <span class="o">=</span> <span class="s2">&quot;4.6.1&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 f2468ba..32ae197 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index a54ebe0..49ee57f 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 9941eaa..f84d684 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 3b8db97..e6609d2 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 0f79d9d..c184515 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index d1efc2f..bbdad6f 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index eebf23f..bcec9d3 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index aca3073..949ae18 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 243d826..66f2229 100644 (file)
@@ -62,7 +62,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
 </li>
       <li><a href="lxml.etree.html#lxml.etree.XMLSchemaValidateError">XMLSchemaValidateError</a>
 </li>
+      <li><a href="lxml.etree.html#lxml.etree.XMLSyntaxAssertionError">XMLSyntaxAssertionError</a>
+</li>
       <li><a href="lxml.etree.html#lxml.etree.XMLSyntaxError">XMLSyntaxError</a>
 </li>
       <li><a href="lxml.etree.html#lxml.etree.XMLTreeBuilder">XMLTreeBuilder (in module lxml.etree)</a>
index d3a2a60..fc27068 100644 (file)
@@ -63,7 +63,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index c80d6ba..27a0d21 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index e6cbb23..61b3fa4 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index a24e320..1c00a13 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index dcdf2d7..e58059e 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 2c1c94b..94659d1 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 83b5d26..759780b 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
@@ -355,6 +355,15 @@ this one.</p>
 </dd></dl>
 
 <dl class="py exception">
+<dt id="lxml.etree.XMLSyntaxAssertionError">
+<em class="property">exception </em><code class="sig-prename descclassname">lxml.etree.</code><code class="sig-name descname">XMLSyntaxAssertionError</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">message</span></em>, <em class="sig-param"><span class="n">code</span></em>, <em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">column</span></em>, <em class="sig-param"><span class="n">filename</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.etree.XMLSyntaxAssertionError" title="Permalink to this definition">¶</a></dt>
+<dd><p>Bases: <a class="reference internal" href="#lxml.etree.XMLSyntaxError" title="lxml.etree.XMLSyntaxError"><code class="xref py py-class docutils literal notranslate"><span class="pre">lxml.etree.XMLSyntaxError</span></code></a>, <code class="xref py py-class docutils literal notranslate"><span class="pre">AssertionError</span></code></p>
+<p>An XMLSyntaxError that additionally inherits from AssertionError for
+ElementTree / backwards compatibility reasons.</p>
+<p>This class may get replaced by a plain XMLSyntaxError in a future version.</p>
+</dd></dl>
+
+<dl class="py exception">
 <dt id="lxml.etree.XMLSyntaxError">
 <em class="property">exception </em><code class="sig-prename descclassname">lxml.etree.</code><code class="sig-name descname">XMLSyntaxError</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">message</span></em>, <em class="sig-param"><span class="n">code</span></em>, <em class="sig-param"><span class="n">line</span></em>, <em class="sig-param"><span class="n">column</span></em>, <em class="sig-param"><span class="n">filename</span><span class="o">=</span><span class="default_value">None</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.etree.XMLSyntaxError" title="Permalink to this definition">¶</a></dt>
 <dd><p>Bases: <a class="reference internal" href="#lxml.etree.ParseError" title="lxml.etree.ParseError"><code class="xref py py-class docutils literal notranslate"><span class="pre">lxml.etree.ParseError</span></code></a></p>
@@ -4969,7 +4978,7 @@ the <cite>lookup()</cite> method.</p>
 purely read-only and does not support all features of the normal
 <cite>lxml.etree</cite> API (such as XPath, extended slicing or some
 iteration methods).</p>
-<p>See <a class="reference external" href="http://codespeak.net/lxml/element_classes.html">http://codespeak.net/lxml/element_classes.html</a></p>
+<p>See <a class="reference external" href="https://lxml.de/element_classes.html">https://lxml.de/element_classes.html</a></p>
 <dl class="py method">
 <dt id="lxml.etree.PythonElementClassLookup.lookup">
 <code class="sig-name descname">lookup</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">self</span></em>, <em class="sig-param"><span class="n">doc</span></em>, <em class="sig-param"><span class="n">element</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.etree.PythonElementClassLookup.lookup" title="Permalink to this definition">¶</a></dt>
@@ -5378,7 +5387,7 @@ the tree, but they can be ignored by passing the respective flags.</p>
 <dt id="lxml.etree.TreeBuilder.close">
 <code class="sig-name descname">close</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">self</span></em><span class="sig-paren">)</span><a class="headerlink" href="#lxml.etree.TreeBuilder.close" title="Permalink to this definition">¶</a></dt>
 <dd><p>Flushes the builder buffers, and returns the toplevel document
-element.</p>
+element.  Raises XMLSyntaxError on inconsistencies.</p>
 </dd></dl>
 
 <dl class="py method">
index 1d0d531..01fe120 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index c28fd69..bc54af3 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index b5d904a..4d5b860 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index df2e6f2..d00d0d9 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 60e845d..0d85617 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index b56f86d..3831173 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 3719ec9..9c8bf18 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 1ea7636..b51a1f8 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 2102e2e..933e7cf 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 3ef411c..e55e59a 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index cfe9dc6..38b19bf 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 2d88eee..acf6c84 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index a4499a9..61b08fb 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 48d9647..797b0a3 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index c39b385..2b191f7 100644 (file)
@@ -63,7 +63,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
 SAX events.</p>
 <p>Use the <cite>ElementTreeProducer</cite> class or the <cite>saxify()</cite> function to fire
 the SAX events of an ElementTree against a SAX ContentHandler.</p>
-<p>See <a class="reference external" href="http://codespeak.net/lxml/sax.html">http://codespeak.net/lxml/sax.html</a></p>
+<p>See <a class="reference external" href="https://lxml.de/sax.html">https://lxml.de/sax.html</a></p>
 <dl class="py exception">
 <dt id="lxml.sax.SaxError">
 <em class="property">exception </em><code class="sig-prename descclassname">lxml.sax.</code><code class="sig-name descname">SaxError</code><a class="headerlink" href="#lxml.sax.SaxError" title="Permalink to this definition">¶</a></dt>
index 4f3f097..347a714 100644 (file)
@@ -65,7 +65,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index 0691027..aabfb48 100644 (file)
@@ -64,7 +64,7 @@
             
             
               <div class="version">
-                4.6.0
+                4.6.1
               </div>
             
           
index b1fcedc..f30cc55 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 9525441..9f5161e 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
similarity index 99%
rename from doc/html/changes-4.6.0.html
rename to doc/html/changes-4.6.1.html
index c2c2413..f64c936 100644 (file)
 <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>
@@ -24,7 +34,7 @@ Patch by Aidan Woolley.</li>
 Patch by Chris Mayo.</li>
 </ul>
 </div>
-<div class="section" id="bugs-fixed">
+<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
@@ -36,9 +46,9 @@ interface.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id2">
+<div class="section" id="id4">
 <h1>4.5.2 (2020-07-09)</h1>
-<div class="section" id="id3">
+<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>
@@ -53,9 +63,9 @@ to &quot;--xml2-config&quot; and &quot;--xslt-config&quot; in 4.5.1 and are now
 </ul>
 </div>
 </div>
-<div class="section" id="id4">
+<div class="section" id="id6">
 <h1>4.5.1 (2020-05-19)</h1>
-<div class="section" id="id5">
+<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>
@@ -67,16 +77,16 @@ Patch by Hugh McMaster.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id6">
+<div class="section" id="id8">
 <h1>4.5.0 (2020-01-29)</h1>
-<div class="section" id="id7">
+<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="id8">
+<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
@@ -93,18 +103,18 @@ Set CFLAGS and LDFLAGS explicitly to override it.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id9">
+<div class="section" id="id11">
 <h1>4.4.3 (2020-01-28)</h1>
-<div class="section" id="id10">
+<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="id11">
+<div class="section" id="id13">
 <h1>4.4.2 (2019-11-25)</h1>
-<div class="section" id="id12">
+<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
@@ -113,9 +123,9 @@ Patch by Rainer Hausdorf.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id13">
+<div class="section" id="id15">
 <h1>4.4.1 (2019-08-11)</h1>
-<div class="section" id="id14">
+<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
@@ -124,9 +134,9 @@ attrib mapping during element creation.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id15">
+<div class="section" id="id17">
 <h1>4.4.0 (2019-07-27)</h1>
-<div class="section" id="id16">
+<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
@@ -152,7 +162,7 @@ tree when set to false.</li>
 a <tt class="docutils literal">c14n2</tt> serialisation method.</li>
 </ul>
 </div>
-<div class="section" id="id17">
+<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
@@ -181,7 +191,7 @@ of empty tags in <tt class="docutils literal">lxml.html.defs</tt>.</li>
 It now raises <tt class="docutils literal">IOError</tt>.</li>
 </ul>
 </div>
-<div class="section" id="id18">
+<div class="section" id="id20">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Support for Python 3.4 was removed.</li>
@@ -195,61 +205,61 @@ in a future release.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id19">
+<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="id20">
+<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="id21">
+<div class="section" id="id23">
 <h1>4.3.3 (2019-03-26)</h1>
-<div class="section" id="id22">
+<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="id23">
+<div class="section" id="id25">
 <h1>4.3.2 (2019-02-29)</h1>
-<div class="section" id="id24">
+<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="id25">
+<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="id26">
+<div class="section" id="id28">
 <h1>4.3.1 (2019-02-08)</h1>
-<div class="section" id="id27">
+<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="id28">
+<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="id29">
+<div class="section" id="id31">
 <h1>4.3.0 (2019-01-04)</h1>
-<div class="section" id="id30">
+<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>
@@ -260,7 +270,7 @@ is used.  Patch by Lennart Regebro.</li>
 and the corresponding schema to the 2016 version (with optional &quot;properties&quot;).</li>
 </ul>
 </div>
-<div class="section" id="id31">
+<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.
@@ -271,9 +281,9 @@ which were released in 2014 and 2012 respectively.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id32">
+<div class="section" id="id34">
 <h1>4.2.6 (2019-01-02)</h1>
-<div class="section" id="id33">
+<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>
@@ -281,9 +291,9 @@ which were released in 2014 and 2012 respectively.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id34">
+<div class="section" id="id36">
 <h1>4.2.5 (2018-09-09)</h1>
-<div class="section" id="id35">
+<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.
@@ -291,16 +301,16 @@ Security problem found by Omar Eissa.  (CVE-2018-19787)</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id36">
+<div class="section" id="id38">
 <h1>4.2.4 (2018-08-03)</h1>
-<div class="section" id="id37">
+<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="id38">
+<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
@@ -309,18 +319,18 @@ Patch by Alexander Weggerle.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id39">
+<div class="section" id="id41">
 <h1>4.2.3 (2018-06-27)</h1>
-<div class="section" id="id40">
+<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="id41">
+<div class="section" id="id43">
 <h1>4.2.2 (2018-06-22)</h1>
-<div class="section" id="id42">
+<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
@@ -331,9 +341,9 @@ Patch by Nehal J Wani.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id44">
+<div class="section" id="id46">
 <h1>4.2.1 (2018-03-21)</h1>
-<div class="section" id="id45">
+<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
@@ -343,9 +353,9 @@ element if a tag selector is used.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id46">
+<div class="section" id="id48">
 <h1>4.2.0 (2018-03-13)</h1>
-<div class="section" id="id47">
+<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
@@ -358,7 +368,7 @@ first one).  If no options are present (not standard-compliant)
 Patch by stranac.</li>
 </ul>
 </div>
-<div class="section" id="id48">
+<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>
@@ -366,19 +376,19 @@ Patch by stranac.</li>
 validation.</li>
 </ul>
 </div>
-<div class="section" id="id49">
+<div class="section" id="id51">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id50">
+<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="id51">
+<div class="section" id="id53">
 <h1>4.1.0 (2017-10-13)</h1>
-<div class="section" id="id52">
+<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>
@@ -390,7 +400,7 @@ 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="id53">
+<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
@@ -398,9 +408,9 @@ a tighter compiler integration between lxml and libxml2/libxslt.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id54">
+<div class="section" id="id56">
 <h1>4.0.0 (2017-09-17)</h1>
-<div class="section" id="id55">
+<div class="section" id="id57">
 <h2>Features added</h2>
 <ul class="simple">
 <li>The ElementPath implementation is now compiled using Cython,
@@ -416,7 +426,7 @@ allow relative resource lookups.</li>
 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="id56">
+<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.
@@ -449,7 +459,7 @@ to output end tags even after writing failed with an exception.</p>
 </li>
 </ul>
 </div>
-<div class="section" id="id57">
+<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
@@ -460,9 +470,9 @@ be worth validating that third-party code does not notice this change.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id58">
+<div class="section" id="id60">
 <h1>3.8.0 (2017-06-03)</h1>
-<div class="section" id="id59">
+<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
@@ -478,7 +488,7 @@ responsible for the error. Patch by Bob Kline.</li>
 a default namespace when passing a None prefix.</li>
 </ul>
 </div>
-<div class="section" id="id60">
+<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.
@@ -492,7 +502,7 @@ 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="id62">
+<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>
@@ -500,9 +510,9 @@ produces a deprecation warning and will eventually be removed.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id63">
+<div class="section" id="id65">
 <h1>3.7.4 (2017-??-??)</h1>
-<div class="section" id="id64">
+<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
@@ -511,9 +521,9 @@ multi-threaded XSLT processing.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id68">
+<div class="section" id="id70">
 <h1>3.7.3 (2017-02-18)</h1>
-<div class="section" id="id69">
+<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>
@@ -522,13 +532,13 @@ Patch by Jakub Wilk.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id70">
+<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="id72">
+<div class="section" id="id74">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Work around installation problems in recent Python 2.7 versions
@@ -540,16 +550,16 @@ script/style tags.  Patch by Burak Arslan.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id74">
+<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="id75">
+<div class="section" id="id77">
 <h1>3.7.0 (2016-12-10)</h1>
-<div class="section" id="id76">
+<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>
@@ -567,14 +577,14 @@ serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&
 marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
 </ul>
 </div>
-<div class="section" id="id77">
+<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="id78">
+<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
@@ -583,27 +593,27 @@ and file name.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id79">
+<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="id80">
+<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="id81">
+<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="id83">
+<div class="section" id="id85">
 <h1>3.6.1 (2016-07-24)</h1>
-<div class="section" id="id84">
+<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>
@@ -611,7 +621,7 @@ 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="id85">
+<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).
@@ -624,9 +634,9 @@ Patch by Holger Joukl.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id87">
+<div class="section" id="id89">
 <h1>3.6.0 (2016-03-17)</h1>
-<div class="section" id="id88">
+<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.
@@ -635,7 +645,7 @@ Patch by Armin Rigo.</li>
 is installed.  Patch by Dirkjan Ochtman.</li>
 </ul>
 </div>
-<div class="section" id="id89">
+<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
@@ -647,9 +657,9 @@ Patch by Petr Demin.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id90">
+<div class="section" id="id92">
 <h1>3.5.0 (2015-11-13)</h1>
-<div class="section" id="id91">
+<div class="section" id="id93">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Unicode string results failed XPath queries in PyPy.</li>
@@ -661,7 +671,7 @@ and continued parsing instead.</li>
 </div>
 <div class="section" id="b1-2015-09-18">
 <h1>3.5.0b1 (2015-09-18)</h1>
-<div class="section" id="id92">
+<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>
@@ -693,7 +703,7 @@ Patch by Olli Pottonen.</li>
 of version 3 if available.</li>
 </ul>
 </div>
-<div class="section" id="id93">
+<div class="section" id="id95">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory errors that occur during tree adaptations (e.g. moving subtrees
@@ -720,9 +730,9 @@ with ElementPath to avoid hiding bugs in user code.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id94">
+<div class="section" id="id96">
 <h1>3.4.4 (2015-04-25)</h1>
-<div class="section" id="id95">
+<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
@@ -730,9 +740,9 @@ Python 3.4+ was removed again.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id96">
+<div class="section" id="id98">
 <h1>3.4.3 (2015-04-15)</h1>
-<div class="section" id="id97">
+<div class="section" id="id99">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
@@ -745,9 +755,9 @@ double quotes.  Patch by Olli Pottonen.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id98">
+<div class="section" id="id100">
 <h1>3.4.2 (2015-02-07)</h1>
-<div class="section" id="id99">
+<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
@@ -759,25 +769,25 @@ with pseudo-attributes.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id100">
+<div class="section" id="id102">
 <h1>3.4.1 (2014-11-20)</h1>
-<div class="section" id="id101">
+<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="id102">
+<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="id103">
+<div class="section" id="id105">
 <h1>3.4.0 (2014-09-10)</h1>
-<div class="section" id="id104">
+<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
@@ -802,10 +812,10 @@ if it had opened it internally.</li>
 <li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
 </ul>
 </div>
-<div class="section" id="id105">
+<div class="section" id="id107">
 <h2>Bugs fixed</h2>
 </div>
-<div class="section" id="id106">
+<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.
@@ -819,9 +829,9 @@ use lxml 3.3.x with older versions.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id107">
+<div class="section" id="id109">
 <h1>3.3.6 (2014-08-28)</h1>
-<div class="section" id="id108">
+<div class="section" id="id110">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Prevent tree cycle creation when adding Elements as siblings.</li>
@@ -831,9 +841,9 @@ extension functions.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id109">
+<div class="section" id="id111">
 <h1>3.3.5 (2014-04-18)</h1>
-<div class="section" id="id110">
+<div class="section" id="id112">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>HTML cleaning could fail to strip javascript links that mix control
@@ -841,34 +851,34 @@ characters into the link scheme.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id111">
+<div class="section" id="id113">
 <h1>3.3.4 (2014-04-03)</h1>
-<div class="section" id="id112">
+<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="id113">
+<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="id114">
+<div class="section" id="id116">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id115">
+<div class="section" id="id117">
 <h1>3.3.3 (2014-03-04)</h1>
-<div class="section" id="id116">
+<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="id117">
+<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
@@ -876,9 +886,9 @@ subclassed from Python code.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id118">
+<div class="section" id="id120">
 <h1>3.3.2 (2014-02-26)</h1>
-<div class="section" id="id119">
+<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
@@ -899,12 +909,12 @@ provide the same interface as that returned for Elements.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id120">
+<div class="section" id="id122">
 <h1>3.3.1 (2014-02-12)</h1>
-<div class="section" id="id121">
+<div class="section" id="id123">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id122">
+<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
@@ -916,36 +926,36 @@ 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="id123">
+<div class="section" id="id125">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id124">
+<div class="section" id="id126">
 <h1>3.3.0 (2014-01-26)</h1>
-<div class="section" id="id125">
+<div class="section" id="id127">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id126">
+<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="id127">
+<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="id128">
+<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="id129">
+<div class="section" id="id131">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Several error handling problems were fixed throughout the code base that
@@ -958,7 +968,7 @@ propagate exceptions (its return type is <tt class="docutils literal">void</tt>)
 parsing the string character by character.</li>
 </ul>
 </div>
-<div class="section" id="id130">
+<div class="section" id="id132">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Document cleanup code was simplified using the new GC features in
@@ -968,10 +978,10 @@ Cython 0.20.</li>
 </div>
 <div class="section" id="beta4-2014-01-12">
 <h1>3.3.0beta4 (2014-01-12)</h1>
-<div class="section" id="id131">
+<div class="section" id="id133">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id132">
+<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
@@ -984,7 +994,7 @@ and keyword arguments could modify the mapping passed as <tt class="docutils lit
 the docinfo property) lost their attribute declarations.</li>
 </ul>
 </div>
-<div class="section" id="id133">
+<div class="section" id="id135">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
@@ -994,39 +1004,39 @@ Python 3.4.</li>
 </div>
 <div class="section" id="beta3-2014-01-02">
 <h1>3.3.0beta3 (2014-01-02)</h1>
-<div class="section" id="id134">
+<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="id135">
+<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="id136">
+<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="id137">
+<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="id138">
+<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="id139">
+<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
@@ -1039,7 +1049,7 @@ behaviour.</li>
 </div>
 <div class="section" id="beta1-2013-12-12">
 <h1>3.3.0beta1 (2013-12-12)</h1>
-<div class="section" id="id140">
+<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
@@ -1051,7 +1061,7 @@ incremental parsing, as implemented for ElementTree in Python 3.4.</li>
 (<tt class="docutils literal">html=True</tt>).</li>
 </ul>
 </div>
-<div class="section" id="id141">
+<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.
@@ -1073,7 +1083,7 @@ The textarea used to be cleared before the new content was set,
 which removed the name attribute.</li>
 </ul>
 </div>
-<div class="section" id="id142">
+<div class="section" id="id144">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Some basic API classes use freelists internally for faster
@@ -1084,12 +1094,12 @@ classes internally instead of being a parser itself.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id143">
+<div class="section" id="id145">
 <h1>3.2.5 (2014-01-02)</h1>
-<div class="section" id="id144">
+<div class="section" id="id146">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id145">
+<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>
@@ -1098,16 +1108,16 @@ classes internally instead of being a parser itself.</li>
 comment or PI).</li>
 </ul>
 </div>
-<div class="section" id="id147">
+<div class="section" id="id149">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id148">
+<div class="section" id="id150">
 <h1>3.2.4 (2013-11-07)</h1>
-<div class="section" id="id149">
+<div class="section" id="id151">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id150">
+<div class="section" id="id152">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory leak when creating an XPath evaluator in a thread.</li>
@@ -1118,32 +1128,32 @@ to one of its own descendants.</li>
 <li>Compressed plain-text serialisation to file-like objects was broken.</li>
 </ul>
 </div>
-<div class="section" id="id153">
+<div class="section" id="id155">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id154">
+<div class="section" id="id156">
 <h1>3.2.3 (2013-07-28)</h1>
-<div class="section" id="id155">
+<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="id156">
+<div class="section" id="id158">
 <h1>3.2.2 (2013-07-28)</h1>
-<div class="section" id="id157">
+<div class="section" id="id159">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id158">
+<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="id159">
+<div class="section" id="id161">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Return values of user provided element class lookup methods are now
@@ -1152,9 +1162,9 @@ API class mismatches.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id160">
+<div class="section" id="id162">
 <h1>3.2.1 (2013-05-11)</h1>
-<div class="section" id="id161">
+<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
@@ -1163,7 +1173,7 @@ and <tt class="docutils literal">remove_blank_text</tt> that discard either all
 strings from the result list.</li>
 </ul>
 </div>
-<div class="section" id="id162">
+<div class="section" id="id164">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>When moving Elements to another tree, the namespace cleanup mechanism
@@ -1176,16 +1186,16 @@ to a crash.</li>
 crashed.</li>
 </ul>
 </div>
-<div class="section" id="id163">
+<div class="section" id="id165">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id164">
+<div class="section" id="id166">
 <h1>3.2.0 (2013-04-28)</h1>
-<div class="section" id="id165">
+<div class="section" id="id167">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id166">
+<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
@@ -1204,16 +1214,16 @@ of overwriting the current value.</li>
 allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
 </ul>
 </div>
-<div class="section" id="id167">
+<div class="section" id="id169">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id168">
+<div class="section" id="id170">
 <h1>3.1.2 (2013-04-12)</h1>
-<div class="section" id="id169">
+<div class="section" id="id171">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id170">
+<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
@@ -1225,16 +1235,16 @@ the result tree to a Unicode string.</li>
 by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
 </ul>
 </div>
-<div class="section" id="id171">
+<div class="section" id="id173">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id172">
+<div class="section" id="id174">
 <h1>3.1.1 (2013-03-29)</h1>
-<div class="section" id="id173">
+<div class="section" id="id175">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id174">
+<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
@@ -1242,7 +1252,7 @@ an AttributeError in Py3.</li>
 <li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
 </ul>
 </div>
-<div class="section" id="id175">
+<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
@@ -1250,16 +1260,16 @@ from the module dict.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id176">
+<div class="section" id="id178">
 <h1>3.1.0 (2013-02-10)</h1>
-<div class="section" id="id177">
+<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="id178">
+<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
@@ -1272,13 +1282,13 @@ in for the current run.</li>
 without threading support.  Patch by Ulrich Seidl.</li>
 </ul>
 </div>
-<div class="section" id="id179">
+<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="id180">
+<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
@@ -1289,7 +1299,7 @@ instead of byte strings for plain ASCII content.</li>
 tags with non-identifier names without having to resort to getattr().</li>
 </ul>
 </div>
-<div class="section" id="id181">
+<div class="section" id="id183">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>When starting from a non-namespaced element in lxml.objectify, searching
@@ -1301,7 +1311,7 @@ the search to non-namespaced children.</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="id182">
+<div class="section" id="id184">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
@@ -1311,27 +1321,27 @@ many children.  Patch by Anders Hammarquist.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id183">
+<div class="section" id="id185">
 <h1>3.0.2 (2012-12-14)</h1>
-<div class="section" id="id184">
+<div class="section" id="id186">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id185">
+<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="id186">
+<div class="section" id="id188">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id187">
+<div class="section" id="id189">
 <h1>3.0.1 (2012-10-14)</h1>
-<div class="section" id="id188">
+<div class="section" id="id190">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id189">
+<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
@@ -1340,16 +1350,16 @@ in PyPy without proper cleanup.</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="id190">
+<div class="section" id="id192">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id191">
+<div class="section" id="id193">
 <h1>3.0 (2012-10-08)</h1>
-<div class="section" id="id192">
+<div class="section" id="id194">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id193">
+<div class="section" id="id195">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>End-of-file handling was incorrect in iterparse() when reading from
@@ -1357,7 +1367,7 @@ 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="id194">
+<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
@@ -1370,21 +1380,21 @@ run special setup.py commands that do not actually run a build), pass
 </div>
 <div class="section" id="beta1-2012-09-26">
 <h1>3.0beta1 (2012-09-26)</h1>
-<div class="section" id="id195">
+<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="id196">
+<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="id197">
+<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>
@@ -1393,7 +1403,7 @@ to simplify debugging of memory leaks etc.</li>
 </div>
 <div class="section" id="alpha2-2012-08-23">
 <h1>3.0alpha2 (2012-08-23)</h1>
-<div class="section" id="id198">
+<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
@@ -1412,20 +1422,20 @@ and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutil
 to top-level during exclusive serialisation.</li>
 </ul>
 </div>
-<div class="section" id="id199">
+<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="id200">
+<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="id201">
+<div class="section" id="id203">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Initial support for building in PyPy (through cpyext).</li>
@@ -1441,7 +1451,7 @@ 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="id202">
+<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
@@ -1468,7 +1478,7 @@ constructor would fail with an exception, stating that the text
 cannot be modified.</li>
 </ul>
 </div>
-<div class="section" id="id203">
+<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
@@ -1517,44 +1527,44 @@ _XSLTResultTree, _XSLTProcessingInstruction</tt></li>
 </ul>
 </div>
 </div>
-<div class="section" id="id204">
+<div class="section" id="id206">
 <h1>2.3.6 (2012-09-28)</h1>
-<div class="section" id="id205">
+<div class="section" id="id207">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id206">
+<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="id207">
+<div class="section" id="id209">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id208">
+<div class="section" id="id210">
 <h1>2.3.5 (2012-07-31)</h1>
-<div class="section" id="id209">
+<div class="section" id="id211">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id210">
+<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="id211">
+<div class="section" id="id213">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id212">
+<div class="section" id="id214">
 <h1>2.3.4 (2012-03-26)</h1>
-<div class="section" id="id213">
+<div class="section" id="id215">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id214">
+<div class="section" id="id216">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash when building an nsmap (Element property) with empty
@@ -1564,20 +1574,20 @@ during threaded XSLT processing.</li>
 <li>XSLT stylesheet compilation could ignore compilation errors.</li>
 </ul>
 </div>
-<div class="section" id="id215">
+<div class="section" id="id217">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id216">
+<div class="section" id="id218">
 <h1>2.3.3 (2012-01-04)</h1>
-<div class="section" id="id217">
+<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="id218">
+<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
@@ -1591,13 +1601,13 @@ Patch by Simon Sapin.</li>
 'img' tags without 'src' attribute.</li>
 </ul>
 </div>
-<div class="section" id="id219">
+<div class="section" id="id221">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id220">
+<div class="section" id="id222">
 <h1>2.3.2 (2011-11-11)</h1>
-<div class="section" id="id221">
+<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
@@ -1609,7 +1619,7 @@ copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise
 of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
 </ul>
 </div>
-<div class="section" id="id222">
+<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
@@ -1624,13 +1634,13 @@ a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the sa
 &quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
 </ul>
 </div>
-<div class="section" id="id223">
+<div class="section" id="id225">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id224">
+<div class="section" id="id226">
 <h1>2.3.1 (2011-09-25)</h1>
-<div class="section" id="id225">
+<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
@@ -1648,7 +1658,7 @@ 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="id226">
+<div class="section" id="id228">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>HTML cleaning didn't remove 'data:' links.</li>
@@ -1676,7 +1686,7 @@ collected form values.</li>
 field properly selects them and unselects them.</li>
 </ul>
 </div>
-<div class="section" id="id227">
+<div class="section" id="id229">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Static builds can specify the download directory with the
@@ -1684,16 +1694,16 @@ field properly selects them and unselects them.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id228">
+<div class="section" id="id230">
 <h1>2.3 (2011-02-06)</h1>
-<div class="section" id="id229">
+<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="id230">
+<div class="section" id="id232">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>When finished reading from a file-like object, the parser
@@ -1706,7 +1716,7 @@ 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="id231">
+<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
@@ -1716,10 +1726,10 @@ return types.</li>
 </div>
 <div class="section" id="beta1-2010-09-06">
 <h1>2.3beta1 (2010-09-06)</h1>
-<div class="section" id="id232">
+<div class="section" id="id234">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id233">
+<div class="section" id="id235">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash in newer libxml2 versions when moving elements between
@@ -1731,23 +1741,23 @@ documents that had attributes on replaced XInclude nodes.</li>
 use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
 </ul>
 </div>
-<div class="section" id="id234">
+<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="id235">
+<div class="section" id="id237">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id236">
+<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="id237">
+<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
@@ -1757,7 +1767,7 @@ stylesheet created in a different thread.</li>
 </div>
 <div class="section" id="alpha1-2010-06-19">
 <h1>2.3alpha1 (2010-06-19)</h1>
-<div class="section" id="id238">
+<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>
@@ -1808,7 +1818,7 @@ the document on submit.</li>
 (compatible with ElementTree).</li>
 </ul>
 </div>
-<div class="section" id="id239">
+<div class="section" id="id241">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>API is hardened against invalid proxy instances to prevent crashes
@@ -1842,7 +1852,7 @@ parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()
 called after parsing, regardless of the outcome.</li>
 </ul>
 </div>
-<div class="section" id="id240">
+<div class="section" id="id242">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Official support for Python 3.1.2 and later.</li>
@@ -1855,9 +1865,9 @@ collector to clean up.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id241">
+<div class="section" id="id243">
 <h1>2.2.8 (2010-09-02)</h1>
-<div class="section" id="id242">
+<div class="section" id="id244">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash in newer libxml2 versions when moving elements between
@@ -1866,9 +1876,9 @@ documents that had attributes on replaced XInclude nodes.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id243">
+<div class="section" id="id245">
 <h1>2.2.7 (2010-07-24)</h1>
-<div class="section" id="id244">
+<div class="section" id="id246">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash in XSLT when generating text-only result documents with a
@@ -1876,25 +1886,25 @@ stylesheet created in a different thread.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id245">
+<div class="section" id="id247">
 <h1>2.2.6 (2010-03-02)</h1>
-<div class="section" id="id246">
+<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="id247">
+<div class="section" id="id249">
 <h1>2.2.5 (2010-02-28)</h1>
-<div class="section" id="id248">
+<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="id249">
+<div class="section" id="id251">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash in XPath evaluation when reading smart strings from a document
@@ -1913,21 +1923,21 @@ an element.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id250">
+<div class="section" id="id252">
 <h1>2.2.4 (2009-11-11)</h1>
-<div class="section" id="id251">
+<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="id252">
+<div class="section" id="id254">
 <h1>2.2.3 (2009-10-30)</h1>
-<div class="section" id="id253">
+<div class="section" id="id255">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id254">
+<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
@@ -1960,13 +1970,13 @@ namespaces when annotation is disabled.</li>
 <li>Diverting the error logging to Python's logging system was broken.</li>
 </ul>
 </div>
-<div class="section" id="id255">
+<div class="section" id="id257">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id256">
+<div class="section" id="id258">
 <h1>2.2.2 (2009-06-21)</h1>
-<div class="section" id="id257">
+<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>,
@@ -1974,7 +1984,7 @@ namespaces when annotation is disabled.</li>
 from a subtree.</li>
 </ul>
 </div>
-<div class="section" id="id258">
+<div class="section" id="id260">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Namespace cleanup on subtree insertions could result in missing
@@ -1988,13 +1998,13 @@ BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
 behaviour.</li>
 </ul>
 </div>
-<div class="section" id="id259">
+<div class="section" id="id261">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id260">
+<div class="section" id="id262">
 <h1>2.2.1 (2009-06-02)</h1>
-<div class="section" id="id261">
+<div class="section" id="id263">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Injecting default attributes into a document during XML Schema
@@ -2003,7 +2013,7 @@ validation (also at parse time).</li>
 restrictions imposed by libxml2 2.7.</li>
 </ul>
 </div>
-<div class="section" id="id262">
+<div class="section" id="id264">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>The script for statically building libxml2 and libxslt didn't work
@@ -2012,13 +2022,13 @@ in Py3.</li>
 for parsing (which could lead to a crash before release 2.6.24).</li>
 </ul>
 </div>
-<div class="section" id="id263">
+<div class="section" id="id265">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id264">
+<div class="section" id="id266">
 <h1>2.2 (2009-03-21)</h1>
-<div class="section" id="id265">
+<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
@@ -2026,7 +2036,7 @@ for parsing (which could lead to a crash before release 2.6.24).</li>
 on serialisation.</li>
 </ul>
 </div>
-<div class="section" id="id266">
+<div class="section" id="id268">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash when parsing an XML Schema with external imports from a
@@ -2036,7 +2046,7 @@ filename.</li>
 </div>
 <div class="section" id="beta4-2009-02-27">
 <h1>2.2beta4 (2009-02-27)</h1>
-<div class="section" id="id267">
+<div class="section" id="id269">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Support strings and instantiable Element classes as child arguments
@@ -2045,7 +2055,7 @@ to the constructor of custom Element classes.</li>
 objects.</li>
 </ul>
 </div>
-<div class="section" id="id268">
+<div class="section" id="id270">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Deep-copying an ElementTree copied neither its sibling PIs and
@@ -2060,7 +2070,7 @@ to a problem in Cython, not lxml itself.</li>
 was evaluated incorrectly.</li>
 </ul>
 </div>
-<div class="section" id="id269">
+<div class="section" id="id271">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Official support for Python 3.0.1.</li>
@@ -2071,14 +2081,14 @@ for Elements without text content.</li>
 </div>
 <div class="section" id="beta3-2009-02-17">
 <h1>2.2beta3 (2009-02-17)</h1>
-<div class="section" id="id270">
+<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="id271">
+<div class="section" id="id273">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory leak in XPath evaluators.</li>
@@ -2090,7 +2100,7 @@ string failed.</li>
 <li>Minor fixes for Python 3.</li>
 </ul>
 </div>
-<div class="section" id="id272">
+<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
@@ -2101,7 +2111,7 @@ local to a thread, which fixes some race conditions.</li>
 </div>
 <div class="section" id="beta2-2009-01-25">
 <h1>2.2beta2 (2009-01-25)</h1>
-<div class="section" id="id273">
+<div class="section" id="id275">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Potential memory leak on exception handling.  This was due to a
@@ -2113,9 +2123,9 @@ problem in Cython, not lxml itself.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id274">
+<div class="section" id="id276">
 <h1>2.1.5 (2009-01-06)</h1>
-<div class="section" id="id275">
+<div class="section" id="id277">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Potential memory leak on exception handling.  This was due to a
@@ -2126,39 +2136,39 @@ problem in Cython, not lxml itself.</li>
 </div>
 <div class="section" id="beta1-2008-12-12">
 <h1>2.2beta1 (2008-12-12)</h1>
-<div class="section" id="id276">
+<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="id277">
+<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="id278">
+<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="id279">
+<div class="section" id="id281">
 <h1>2.1.4 (2008-12-12)</h1>
-<div class="section" id="id280">
+<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="id281">
+<div class="section" id="id283">
 <h1>2.0.11 (2008-12-12)</h1>
-<div class="section" id="id282">
+<div class="section" id="id284">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash when using an XPath evaluator in multiple threads.</li>
@@ -2167,7 +2177,7 @@ just HTML strings.</li>
 </div>
 <div class="section" id="alpha1-2008-11-23">
 <h1>2.2alpha1 (2008-11-23)</h1>
-<div class="section" id="id283">
+<div class="section" id="id285">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Support for XSLT result tree fragments in XPath/XSLT extension
@@ -2177,7 +2187,7 @@ functions.</li>
 <li>Instantiating a custom Element classes creates a new Element.</li>
 </ul>
 </div>
-<div class="section" id="id284">
+<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>
@@ -2188,16 +2198,16 @@ that end in a parenthesis, will be linked in their entirety (typical
 with Wikipedia links).</li>
 </ul>
 </div>
-<div class="section" id="id285">
+<div class="section" id="id287">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id286">
+<div class="section" id="id288">
 <h1>2.1.3 (2008-11-17)</h1>
-<div class="section" id="id287">
+<div class="section" id="id289">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id288">
+<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
@@ -2216,13 +2226,13 @@ ElementTrees.</li>
 <li>Overriding the parser encoding didn't work for many encodings.</li>
 </ul>
 </div>
-<div class="section" id="id289">
+<div class="section" id="id291">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id290">
+<div class="section" id="id292">
 <h1>2.0.10 (2008-11-17)</h1>
-<div class="section" id="id291">
+<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
@@ -2231,9 +2241,9 @@ Cython, not lxml itself.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id292">
+<div class="section" id="id294">
 <h1>2.1.2 (2008-09-05)</h1>
-<div class="section" id="id293">
+<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
@@ -2242,7 +2252,7 @@ resolving relative URLs, as lixbml2 can prepend them with the path
 of the source document.</li>
 </ul>
 </div>
-<div class="section" id="id294">
+<div class="section" id="id296">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory problem when passing documents between threads.</li>
@@ -2250,13 +2260,13 @@ of the source document.</li>
 exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
 </ul>
 </div>
-<div class="section" id="id295">
+<div class="section" id="id297">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id296">
+<div class="section" id="id298">
 <h1>2.0.9 (2008-09-05)</h1>
-<div class="section" id="id297">
+<div class="section" id="id299">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory problem when passing documents between threads.</li>
@@ -2265,12 +2275,12 @@ exception instead of calling <tt class="docutils literal">.close()</tt> on the t
 </ul>
 </div>
 </div>
-<div class="section" id="id298">
+<div class="section" id="id300">
 <h1>2.1.1 (2008-07-24)</h1>
-<div class="section" id="id299">
+<div class="section" id="id301">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id300">
+<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
@@ -2279,20 +2289,20 @@ another.</li>
 Python 3.</li>
 </ul>
 </div>
-<div class="section" id="id301">
+<div class="section" id="id303">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id302">
+<div class="section" id="id304">
 <h1>2.0.8 (2008-07-24)</h1>
-<div class="section" id="id303">
+<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="id304">
+<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
@@ -2301,13 +2311,13 @@ another.</li>
 with parameters.</li>
 </ul>
 </div>
-<div class="section" id="id305">
+<div class="section" id="id307">
 <h2>Other changes</h2>
 </div>
 </div>
-<div class="section" id="id306">
+<div class="section" id="id308">
 <h1>2.1 (2008-07-09)</h1>
-<div class="section" id="id307">
+<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>
@@ -2316,7 +2326,7 @@ keyword option).</li>
 with whitespace in URL attributes.</li>
 </ul>
 </div>
-<div class="section" id="id308">
+<div class="section" id="id310">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Custom resolvers were not used for XMLSchema includes/imports and
@@ -2325,7 +2335,7 @@ XInclude processing.</li>
 with parameters.</li>
 </ul>
 </div>
-<div class="section" id="id309">
+<div class="section" id="id311">
 <h2>Other changes</h2>
 <ul class="simple">
 <li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
@@ -2334,15 +2344,15 @@ with parameters.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id310">
+<div class="section" id="id312">
 <h1>2.0.7 (2008-06-20)</h1>
-<div class="section" id="id311">
+<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="id312">
+<div class="section" id="id314">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Descending dot-separated classes in CSS selectors were not resolved
@@ -2353,7 +2363,7 @@ correctly.</li>
 the super class is not called from Python subclasses.</li>
 </ul>
 </div>
-<div class="section" id="id313">
+<div class="section" id="id315">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Non-ASCII characters in attribute values are no longer escaped on
@@ -2363,7 +2373,7 @@ serialisation.</li>
 </div>
 <div class="section" id="beta3-2008-06-19">
 <h1>2.1beta3 (2008-06-19)</h1>
-<div class="section" id="id314">
+<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>
@@ -2389,7 +2399,7 @@ lxml.html (experimental).</li>
 (experimental).</li>
 </ul>
 </div>
-<div class="section" id="id315">
+<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>
@@ -2404,7 +2414,7 @@ platform.</li>
 <li>Rare crash when serialising to a file object with certain encodings.</li>
 </ul>
 </div>
-<div class="section" id="id316">
+<div class="section" id="id318">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Non-ASCII characters in attribute values are no longer escaped on
@@ -2417,12 +2427,12 @@ lxml.objectify.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id317">
+<div class="section" id="id319">
 <h1>2.0.6 (2008-05-31)</h1>
-<div class="section" id="id318">
+<div class="section" id="id320">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id319">
+<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>
@@ -2433,7 +2443,7 @@ 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="id320">
+<div class="section" id="id322">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>lxml should now build without problems on MacOS-X.</li>
@@ -2442,7 +2452,7 @@ document is deleted while the subtree is still in use.</li>
 </div>
 <div class="section" id="beta2-2008-05-02">
 <h1>2.1beta2 (2008-05-02)</h1>
-<div class="section" id="id321">
+<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>
@@ -2451,7 +2461,7 @@ attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parser
 pre-configured for the lxml.html package.</li>
 </ul>
 </div>
-<div class="section" id="id322">
+<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
@@ -2462,7 +2472,7 @@ 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="id323">
+<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
@@ -2474,12 +2484,12 @@ namespace (i.e. they would end up in the wrong namespace).</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id324">
+<div class="section" id="id326">
 <h1>2.0.5 (2008-05-01)</h1>
-<div class="section" id="id325">
+<div class="section" id="id327">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id326">
+<div class="section" id="id328">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Resolving to a filename in custom resolvers didn't work.</li>
@@ -2488,13 +2498,13 @@ 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="id327">
+<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="id328">
+<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>
@@ -2504,7 +2514,7 @@ 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="id329">
+<div class="section" id="id331">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Resolving to a filename in custom resolvers didn't work.</li>
@@ -2514,7 +2524,7 @@ let some XSLT errors pass silently.</li>
 <li>lxml.etree accepted non well-formed namespace prefix names.</li>
 </ul>
 </div>
-<div class="section" id="id330">
+<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
@@ -2528,12 +2538,12 @@ context.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id331">
+<div class="section" id="id333">
 <h1>2.0.4 (2008-04-13)</h1>
-<div class="section" id="id332">
+<div class="section" id="id334">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id333">
+<div class="section" id="id335">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Hanging thread in conjunction with GTK threading.</li>
@@ -2542,13 +2552,13 @@ context.</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="id334">
+<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="id335">
+<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>
@@ -2562,14 +2572,14 @@ an Element.</li>
 <li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
 </ul>
 </div>
-<div class="section" id="id336">
+<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="id337">
+<div class="section" id="id339">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>Minor API speed-ups.</li>
@@ -2613,9 +2623,9 @@ instead.</p>
 </ul>
 </div>
 </div>
-<div class="section" id="id338">
+<div class="section" id="id340">
 <h1>2.0.3 (2008-03-26)</h1>
-<div class="section" id="id339">
+<div class="section" id="id341">
 <h2>Features added</h2>
 <ul class="simple">
 <li>soupparser.parse() allows passing keyword arguments on to
@@ -2623,7 +2633,7 @@ 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="id340">
+<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.,
@@ -2636,7 +2646,7 @@ which made them turn up in text content.</li>
 correctly serialise the value to a string.</li>
 </ul>
 </div>
-<div class="section" id="id341">
+<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
@@ -2652,16 +2662,16 @@ option.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id342">
+<div class="section" id="id344">
 <h1>2.0.2 (2008-02-22)</h1>
-<div class="section" id="id343">
+<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="id344">
+<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
@@ -2671,7 +2681,7 @@ of default prefixes.</li>
 <li>Slice deletion bug fixed in objectify.</li>
 </ul>
 </div>
-<div class="section" id="id345">
+<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>
@@ -2682,9 +2692,9 @@ of default prefixes.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id346">
+<div class="section" id="id348">
 <h1>2.0.1 (2008-02-13)</h1>
-<div class="section" id="id347">
+<div class="section" id="id349">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
@@ -2692,7 +2702,7 @@ of default prefixes.</li>
 methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
 </ul>
 </div>
-<div class="section" id="id348">
+<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
@@ -2704,7 +2714,7 @@ ignored.</li>
 elements at the wrong position.</li>
 </ul>
 </div>
-<div class="section" id="id349">
+<div class="section" id="id351">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>The generated API documentation was cleaned up and disburdened from
@@ -2719,9 +2729,9 @@ compiler options.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id350">
+<div class="section" id="id352">
 <h1>2.0 (2008-02-01)</h1>
-<div class="section" id="id351">
+<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
@@ -2826,7 +2836,7 @@ instead of a string</li>
 <li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
 </ul>
 </div>
-<div class="section" id="id352">
+<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>
@@ -2863,7 +2873,7 @@ evaluators now reports the first error that occurred instead of the last</li>
 <li>Thread safety in XPath evaluators</li>
 </ul>
 </div>
-<div class="section" id="id353">
+<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
@@ -2921,16 +2931,16 @@ generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
 </ul>
 </div>
 </div>
-<div class="section" id="id354">
+<div class="section" id="id356">
 <h1>1.3.6 (2007-10-29)</h1>
-<div class="section" id="id355">
+<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="id356">
+<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>
@@ -2940,12 +2950,12 @@ problems that would otherwise appear in later tests.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id357">
+<div class="section" id="id359">
 <h1>1.3.5 (2007-10-22)</h1>
-<div class="section" id="id358">
+<div class="section" id="id360">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id359">
+<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
@@ -2955,9 +2965,9 @@ than the root node of a tree</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id360">
+<div class="section" id="id362">
 <h1>1.3.4 (2007-08-30)</h1>
-<div class="section" id="id361">
+<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
@@ -2971,13 +2981,13 @@ part of the document, as well as comments and PIs that are siblings of the
 root node.</li>
 </ul>
 </div>
-<div class="section" id="id362">
+<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="id363">
+<div class="section" id="id365">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>lxml now raises a TagNameWarning about tag names containing ':' instead of
@@ -2993,9 +3003,9 @@ ElementTree serialisation includes them).</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id364">
+<div class="section" id="id366">
 <h1>1.3.3 (2007-07-26)</h1>
-<div class="section" id="id365">
+<div class="section" id="id367">
 <h2>Features added</h2>
 <ul class="simple">
 <li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
@@ -3006,7 +3016,7 @@ 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="id366">
+<div class="section" id="id368">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Parsing from Python Unicode strings failed on some platforms</li>
@@ -3016,21 +3026,21 @@ the parser you pass.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id367">
+<div class="section" id="id369">
 <h1>1.3.2 (2007-07-03)</h1>
-<div class="section" id="id368">
+<div class="section" id="id370">
 <h2>Features added</h2>
 </div>
-<div class="section" id="id369">
+<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="id370">
+<div class="section" id="id372">
 <h1>1.3.1 (2007-07-02)</h1>
-<div class="section" id="id371">
+<div class="section" id="id373">
 <h2>Features added</h2>
 <ul class="simple">
 <li>objectify.DataElement now supports setting values from existing data
@@ -3038,7 +3048,7 @@ 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="id372">
+<div class="section" id="id374">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Better way to prevent crashes in Element proxy cleanup code</li>
@@ -3048,9 +3058,9 @@ elements (not just plain Python types) and reuses defined namespaces etc.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id373">
+<div class="section" id="id375">
 <h1>1.3 (2007-06-24)</h1>
-<div class="section" id="id374">
+<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
@@ -3079,7 +3089,7 @@ keys/values/items for a libxml2 node</li>
 a better handling of namespaces when moving elements between documents.</li>
 </ul>
 </div>
-<div class="section" id="id375">
+<div class="section" id="id377">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Removing Elements from a tree could make them lose their namespace
@@ -3103,16 +3113,16 @@ PIs are copied.</li>
 documents</li>
 </ul>
 </div>
-<div class="section" id="id376">
+<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="id377">
+<div class="section" id="id379">
 <h1>1.2.1 (2007-02-27)</h1>
-<div class="section" id="id378">
+<div class="section" id="id380">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Build fixes for MS compiler</li>
@@ -3123,9 +3133,9 @@ to access</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id379">
+<div class="section" id="id381">
 <h1>1.2 (2007-02-20)</h1>
-<div class="section" id="id380">
+<div class="section" id="id382">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Rich comparison of QName objects</li>
@@ -3141,7 +3151,7 @@ possible to pass an --rpath directly to distutils; previously this was being
 shadowed.</li>
 </ul>
 </div>
-<div class="section" id="id381">
+<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>
@@ -3151,7 +3161,7 @@ support in these environments</li>
 <li>Element.find*() did not accept QName objects as path</li>
 </ul>
 </div>
-<div class="section" id="id382">
+<div class="section" id="id384">
 <h2>Other changes</h2>
 <ul class="simple">
 <li>code cleanup: redundant _NodeBase super class merged into _Element class
@@ -3160,9 +3170,9 @@ the compatibility of the public C-API</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id383">
+<div class="section" id="id385">
 <h1>1.1.2 (2006-10-30)</h1>
-<div class="section" id="id384">
+<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>
@@ -3173,7 +3183,7 @@ tail, attributes and namespaces</li>
 <li>Simplified support for handling XSLT processing instructions</li>
 </ul>
 </div>
-<div class="section" id="id385">
+<div class="section" id="id387">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Parser resources were not freed before the next parser run</li>
@@ -3189,9 +3199,9 @@ closed/freed</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id386">
+<div class="section" id="id388">
 <h1>1.1.1 (2006-09-21)</h1>
-<div class="section" id="id387">
+<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>
@@ -3199,7 +3209,7 @@ closed/freed</li>
 <li>Support custom elements for tree nodes in lxml.objectify</li>
 </ul>
 </div>
-<div class="section" id="id388">
+<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>
@@ -3214,9 +3224,9 @@ elements)</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id389">
+<div class="section" id="id391">
 <h1>1.1 (2006-09-13)</h1>
-<div class="section" id="id390">
+<div class="section" id="id392">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
@@ -3269,7 +3279,7 @@ generated elements</li>
 element</li>
 </ul>
 </div>
-<div class="section" id="id391">
+<div class="section" id="id393">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>filenames with local 8-bit encoding were not supported</li>
@@ -3293,30 +3303,30 @@ change from 1.0.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id392">
+<div class="section" id="id394">
 <h1>1.0.4 (2006-09-09)</h1>
-<div class="section" id="id393">
+<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="id394">
+<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="id395">
+<div class="section" id="id397">
 <h1>1.0.3 (2006-08-08)</h1>
-<div class="section" id="id396">
+<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="id397">
+<div class="section" id="id399">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Crash when mixing elements from XSLT results into other trees</li>
@@ -3326,16 +3336,16 @@ change from 1.0.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id398">
+<div class="section" id="id400">
 <h1>1.0.2 (2006-06-27)</h1>
-<div class="section" id="id399">
+<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="id400">
+<div class="section" id="id402">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Rare exceptions in Python list functions were not handled</li>
@@ -3347,15 +3357,15 @@ cases</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id401">
+<div class="section" id="id403">
 <h1>1.0.1 (2006-06-09)</h1>
-<div class="section" id="id402">
+<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="id403">
+<div class="section" id="id405">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Document deallocation could crash in certain garbage collection scenarios</li>
@@ -3371,9 +3381,9 @@ stylesheet and crash on repeated calls</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id404">
+<div class="section" id="id406">
 <h1>1.0 (2006-06-01)</h1>
-<div class="section" id="id405">
+<div class="section" id="id407">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Element.getiterator() and the findall() methods support finding arbitrary
@@ -3420,7 +3430,7 @@ enabled by default, can be switched off with 'regexp=False' keyword argument</li
 implementation of libxml2 (as opposed to ET compatible XMLID)</li>
 </ul>
 </div>
-<div class="section" id="id406">
+<div class="section" id="id408">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Memory leak in Element.__setitem__</li>
@@ -3462,9 +3472,9 @@ ElementTree root node as reference point</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id407">
+<div class="section" id="id409">
 <h1>0.9.2 (2006-05-10)</h1>
-<div class="section" id="id408">
+<div class="section" id="id410">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Speedup for Element.makeelement(): the new element reuses the original
@@ -3474,7 +3484,7 @@ libxml2 document instead of creating a new empty one</li>
 <li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
 </ul>
 </div>
-<div class="section" id="id409">
+<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>
@@ -3484,9 +3494,9 @@ libxml2 document instead of creating a new empty one</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id410">
+<div class="section" id="id412">
 <h1>0.9.1 (2006-03-30)</h1>
-<div class="section" id="id411">
+<div class="section" id="id413">
 <h2>Features added</h2>
 <ul class="simple">
 <li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
@@ -3498,7 +3508,7 @@ argument)</li>
 <li>Minor API performance improvements</li>
 </ul>
 </div>
-<div class="section" id="id412">
+<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>
@@ -3507,9 +3517,9 @@ argument)</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id413">
+<div class="section" id="id415">
 <h1>0.9 (2006-03-20)</h1>
-<div class="section" id="id414">
+<div class="section" id="id416">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Error logging API for libxml2 error messages</li>
@@ -3534,7 +3544,7 @@ parent element.</li>
 doc/sax.txt for more information.</li>
 </ul>
 </div>
-<div class="section" id="id415">
+<div class="section" id="id417">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Segfaults and memory leaks in various API functions of Element</li>
@@ -3546,9 +3556,9 @@ cannot support this due to libxslt deficiencies)</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id416">
+<div class="section" id="id418">
 <h1>0.8 (2005-11-03)</h1>
-<div class="section" id="id417">
+<div class="section" id="id419">
 <h2>Features added</h2>
 <ul class="simple">
 <li>Support for copy.deepcopy() on elements. copy.copy() works also, but
@@ -3562,7 +3572,7 @@ supported and parsing of gzipped XML files works.</li>
 SubElement.</li>
 </ul>
 </div>
-<div class="section" id="id418">
+<div class="section" id="id420">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Use xslt-config instead of xml2-config to find out libxml2
@@ -3585,9 +3595,9 @@ fixed.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id419">
+<div class="section" id="id421">
 <h1>0.7 (2005-06-15)</h1>
-<div class="section" id="id420">
+<div class="section" id="id422">
 <h2>Features added</h2>
 <ul class="simple">
 <li>parameters (XPath expressions) can be passed to XSLT using keyword
@@ -3617,7 +3627,7 @@ prefix declarations on these elements and these prefixes will show up
 in XML serialization.</li>
 </ul>
 </div>
-<div class="section" id="id421">
+<div class="section" id="id423">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Killed yet another memory management related bug: trees created
@@ -3638,9 +3648,9 @@ test both serializing to StringIO as well as serializing to a real file.</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id422">
+<div class="section" id="id424">
 <h1>0.6 (2005-05-14)</h1>
-<div class="section" id="id423">
+<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
@@ -3649,7 +3659,7 @@ 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="id424">
+<div class="section" id="id426">
 <h2>Bugs fixed</h2>
 <ul class="simple">
 <li>Do the right thing when handling namespaced attributes.</li>
@@ -3658,7 +3668,7 @@ had very nasty side-effects before this fix, sorry!</li>
 </ul>
 </div>
 </div>
-<div class="section" id="id425">
+<div class="section" id="id427">
 <h1>0.5.1 (2005-04-09)</h1>
 <ul class="simple">
 <li>Python 2.2 compatibility fixes.</li>
@@ -3666,14 +3676,14 @@ had very nasty side-effects before this fix, sorry!</li>
 input wasn't properly being UTF-8 encoded.</li>
 </ul>
 </div>
-<div class="section" id="id426">
+<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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 28bb6ad..a2c0e52 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 7da1c1c..3523339 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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="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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 04f0c87..161d465 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index fadb432..2aba74c 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index ad35c7c..979244f 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index a6341d8..83c0236 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 7f29ac3..5404511 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 5470999..cd93d94 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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="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>
@@ -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.0.pdf">PDF
+<p>The complete lxml documentation is available for download as <a class="reference external" href="lxmldoc-4.6.1.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">
@@ -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.0.pdf">PDF documentation</a>.</p>
+<a class="reference external" href="lxmldoc-4.6.1.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.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>
 <li><a class="reference external" href="/files/lxml-4.5.1.tgz">lxml 4.5.1</a>, released 2020-05-19 (<a class="reference external" href="/changes-4.5.1.html">changes for 4.5.1</a>)</li>
@@ -257,7 +258,7 @@ donation is non-refundable.</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index c6b5fcc..721361d 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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="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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 1b35c63..816d777 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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="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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 3437e40..72308b1 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 159685d..23b33c4 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 2183078..c9827f8 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index ca60fd2..f9d9fcb 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index fc9a94a..b017c9e 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 994901b..f005007 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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="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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index b396fd6..dcdf773 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index ddb10df..9fd936f 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 </html>
\ No newline at end of file
index 0a6c809..18ccc4c 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 0e9123a..32bb4d8 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <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-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index eec6d41..5edd59c 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 0-menu"><li class="menu title"><a href="changes-4.6.0.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 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>
 
 <p>lxml supports XPath 1.0, XSLT 1.0 and the EXSLT extensions through
 libxml2 and libxslt in a standards compliant way.</p>
@@ -632,7 +632,7 @@ If you want to free it from memory, just do:</p>
 </div>
 <div class="footer">
 <hr class="footer" />
-Generated on: 2020-10-17.
+Generated on: 2020-10-18.
 
 </div>
 </body>
index 9844b92..fa1dfba 100644 (file)
@@ -256,7 +256,9 @@ See the websites of lxml
 ..
    and the `latest in-development version <http://lxml.de/dev/>`_.
 
-.. _`PDF documentation`: lxmldoc-4.6.0.pdf
+.. _`PDF documentation`: lxmldoc-4.6.1.pdf
+
+* `lxml 4.6.1`_, released 2020-10-18 (`changes for 4.6.1`_)
 
 * `lxml 4.6.0`_, released 2020-10-17 (`changes for 4.6.0`_)
 
@@ -276,6 +278,7 @@ See the websites of lxml
 
 * `older releases <http://lxml.de/4.3/#old-versions>`_
 
+.. _`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
 .. _`lxml 4.5.1`: /files/lxml-4.5.1.tgz
@@ -285,6 +288,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.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
 .. _`changes for 4.5.1`: /changes-4.5.1.html
index cf726ba..4151dc8 100644 (file)
@@ -63,10 +63,6 @@ PYGMENTS_IMPORT = r"""
 \input{_part_pygments.tex}
 """
 
-EPYDOC_IMPORT = r"""
-\input{_part_epydoc.tex}
-"""
-
 def write_chapter(master, title, filename):
     filename = os.path.join(os.path.dirname(filename),
                             "_part_%s" % os.path.basename(filename))
@@ -179,6 +175,7 @@ def tex_postprocess(src_path, dest_path, want_header=False, process_line=noop):
         raise Exception("Bueee, no title in %s" % src_path)
     return title, header
 
+
 def publish(dirname, lxml_path, release):
     if not os.path.exists(dirname):
         os.mkdir(dirname)
@@ -220,7 +217,7 @@ def publish(dirname, lxml_path, release):
         if r'\href' not in line:
             return line
         line = replace_interdoc_hyperrefs(build_hyperref, line)
-        return replace_docinternal_hyperrefs(r'\hyperref[\1]', line)
+        return replace_docinternal_hyperrefs(r'\\hyperref[\1]', line)
 
     # Building pages
     for section, text_files in SITE_STRUCTURE:
@@ -253,12 +250,12 @@ def publish(dirname, lxml_path, release):
     # integrate generated API docs
 
     print("Integrating API docs")
-    apidocsname = 'api.tex'
-    apipath = os.path.join(dirname, apidocsname)
+    apidocsname = 'lxml.tex'
+    apipath = os.path.join(dirname, "..", "api", "_build", "latex", apidocsname)
     tex_postprocess(apipath, os.path.join(dirname, "_part_%s" % apidocsname),
                     process_line=fix_relative_hyperrefs)
-    copy_epydoc_macros(apipath, os.path.join(dirname, '_part_epydoc.tex'),
-                       set(header))
+    #copy_epydoc_macros(apipath, os.path.join(dirname, '_part_epydoc.tex'),
+    #                   set(header))
 
     # convert CHANGES.txt
 
@@ -287,9 +284,9 @@ def publish(dirname, lxml_path, release):
     for hln in header:
         if hln.startswith(r"\documentclass"):
             #hln = hln.replace('article', 'book')
-            hln = DOCUMENT_CLASS + EPYDOC_IMPORT
+            hln = DOCUMENT_CLASS
         elif hln.startswith(r"\begin{document}"):
-            # pygments and epydoc support
+            # pygments support
             master.write(PYGMENTS_IMPORT)
         elif hln.startswith(r"\title{"):
             hln = replace_content(
diff --git a/doc/pdf/pubkey.asc b/doc/pdf/pubkey.asc
new file mode 100644 (file)
index 0000000..f72804c
--- /dev/null
@@ -0,0 +1,36 @@
+-----BEGIN PGP PUBLIC KEY BLOCK-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+mQGiBEQf3JQRBACciSqxoX0q3VurkRENVVtG/pVqtFh/d2CohbVJlLCrO4s7nnPj
+CTfZFt6tmykZjsLJl24XpEJt0O/C0jLcaBqvXVgVvRXHz4DjEYYuQF4LPthhI4MA
+4T7ExptX4lU5g3BVJ46vPU8uRBbbxarBRas9rYewgnrYKWpZZCa7yMq+9wCgnyyR
+Si4E3viLwi77jda135nA6vcD/iqu8zIl9/dFuUcOvxJrhrm+UdY72puZ1TVczSAH
+GOqMjrKkfyHlaJh/ZzWENpTZIfOdVhy7Chvva18vH4Wz7jKj5UeIpRrBvjAD28r3
+Y3W5bfsnpPkvDOyU1vqBsw4q+/250GXEX0JqV2Rbf5yLVgEZPdGrswO460dr4UVS
+8RS0BACYTmyrz57AugHc5tRkqNw6o7ux2deOT0c3AbUcOWtOocGumCsUf+M1nOrc
+VWkeBWTv4HIIiecWYY/KwIemTthQGjxywaZDxOlBT0BOL/+vfYTq/plZULXr+g90
+rSe82+kLl9N5onkBDJKeDIcJDzRoxIRPV1i0Om/5JBI4jmUnv7QnU3RlZmFuIEJl
+aG5lbCA8c2NvZGVyQHVzZXJzLmJlcmxpb3MuZGU+iF8EExECACAFAkQiqKYCGwMG
+CwkIBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRANPVNpCNOgHi+2AJ0a0JH8iP3RqrOL
+JefvHz1dSl3MxACYo7Ma6CeIgsGnyaSSdNOmNVXn+IhGBBARAgAGBQJEIqk0AAoJ
+ELO5mMzzmgZbmCcAoKZ2En1IlsxBpaPPxgWYrUOWfc6hAKCBWODMMOYptCBkSrjg
+m3gsrjHgYbQsU3RlZmFuIEJlaG5lbCA8c2NvZGVyQHVzZXJzLnNvdXJjZWZvcmdl
+Lm5ldD6IYAQTEQIAIAUCRB/clAIbAwYLCQgHAwIEFQIIAwQWAgMBAh4BAheAAAoJ
+EA09U2kI06Aen2YAn0hvuDs+Gslq9vPRFFbsFNJI40PmAJ0chjiiEy0xV5C+n6YX
+XFuldRDILYhGBBARAgAGBQJEIp4AAAoJELO5mMzzmgZbgKQAn3pWrmFdj8YaEyuR
+tEjKVZJDQ6ZVAJ0Y1igwADT40BPra+G/xiLa3YbCrrkCDQREH9ynEAgAiR4/0r0d
+doViNECfSLClllu5K0Bo1SEiMtvVNC3sJYgVzBddD8Xn8UAdjyAgmaL5FC2FsNQu
+RxxKkNlHNYCq8ZSWtZaL2MQ+SyMUyHv6VXVCGuSW0COpzbx58u+SZpjyESJ1kaZc
+73SaIw6kv/dVQHjurwmlo1lg3dLZ3PG08WGCYUMqkkv2K+J7+puzE2Cjo31gTq4s
+LYDCV26wjVQ6BqT2EcHQhVEjh0xq5ugc908cr/2FQAKkTifEbF+OVBGWiFMGgri+
+6+G54/BV/RakpvNCFYBiZHn/M9mQaWt7XoTmnEQ1ldq5KNlRhkqnQRF/NK5VpGcQ
+29As28aqpZTECwADBgf/WlRvBRI1Q1eIv2falEv7C6sOxqc3kr5z1uUBTRG5v9t6
+ff9k/J4oC6cnQx00GK3ZR8ija6bl8zwu+0m0M3rW49Krb1rsiT7r4ahOZ7p9RRro
+oG3NbUJYgMG10D1nxpaioYqa/m+PpILJM0wfYZZEuX0xkZcOB24yb+J7EIcGR09T
+mMd5sXtdTU+w/p7Xi2cP61uQ8qixyHBH8E06qgW2JtVFV9rGn7CNUOvkNaUBRnY5
+QxhdkvKJRx7voOLYWZFUBIWgto+6vmTgKmc2Ho6qddzME9UgwUNcknRgm0cf6Cxr
+6zPtxZl8a6KemjQcK7kARSmMNCDkqp/Pohe519A5vYhJBBgRAgAJBQJEH9ynAhsM
+AAoJEA09U2kI06Aesv4AnjiVQVLzqnNS/64vvMMP1UARY3HtAJ90YxNGhRNIhWYL
+UU16oJlGD/9M1Q==
+=gWy2
+-----END PGP PUBLIC KEY BLOCK-----
index 583ea01..d2d538c 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: lxml
-Version: 4.6.0
+Version: 4.6.1
 Summary: Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.
 Home-page: https://lxml.de/
 Author: lxml dev team
@@ -38,32 +38,14 @@ 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.0 (2020-10-17)
+        4.6.1 (2020-10-18)
         ==================
         
-        Features added
-        --------------
-        
-        * GH#310: ``lxml.html.InputGetter`` supports ``__len__()`` to count the number of input fields.
-          Patch by Aidan Woolley.
-        
-        * ``lxml.html.InputGetter`` has a new ``.items()`` method to ease processing all input fields.
-        
-        * ``lxml.html.InputGetter.keys()`` now returns the field names in document order.
-        
-        * GH-309: The API documentation is now generated using ``sphinx-apidoc``.
-          Patch by Chris Mayo.
-        
         Bugs fixed
         ----------
         
-        * LP#1869455: C14N 2.0 serialisation failed for unprefixed attributes
-          when a default namespace was defined.
-        
-        * ``TreeBuilder.close()`` raised ``AssertionError`` in some error cases where it
-          should have raised ``XMLSyntaxError``.  It now raises a combined exception to
-          keep up backwards compatibility, while switching to ``XMLSyntaxError`` as an
-          interface.
+        * 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.
         
         
         
index fc899a0..0eafa85 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.0.html
+doc/html/changes-4.6.1.html
 doc/html/compatibility.html
 doc/html/credits.html
 doc/html/cssselect.html
@@ -153,6 +153,7 @@ doc/licenses/BSD.txt
 doc/licenses/GPL.txt
 doc/licenses/ZopePublicLicense.txt
 doc/licenses/elementtree.txt
+doc/pdf/pubkey.asc
 doc/s5/Makefile
 doc/s5/lxml-ep2008.html
 doc/s5/lxml-ep2008.txt
index fc7c5bf..5950601 100644 (file)
@@ -1,6 +1,6 @@
 # this is a package
 
-__version__ = "4.6.0"
+__version__ = "4.6.1"
 
 
 def get_include():
index f6a8b5b..4574b4b 100644 (file)
@@ -956,12 +956,12 @@ static const char *__pyx_f[] = {
   "src/lxml/etree.pyx",
   "src/lxml/xmlerror.pxi",
   "src/lxml/parser.pxi",
+  "src/lxml/saxparser.pxi",
   "src/lxml/xslt.pxi",
   "src/lxml/proxy.pxi",
   "src/lxml/apihelpers.pxi",
   "src/lxml/readonlytree.pxi",
   "src/lxml/classlookup.pxi",
-  "src/lxml/saxparser.pxi",
   "src/lxml/serializer.pxi",
   "src/lxml/extensions.pxi",
   "src/lxml/nsclasses.pxi",
@@ -1205,8 +1205,8 @@ enum __pyx_t_4lxml_5etree__InputDocumentDataType {
 };
 typedef enum __pyx_t_4lxml_5etree__InputDocumentDataType __pyx_t_4lxml_5etree__InputDocumentDataType;
 
-/* "src/lxml/saxparser.pxi":3
- * # SAX-like interfaces
+/* "src/lxml/saxparser.pxi":12
+ * 
  * 
  * ctypedef enum _SaxParserEvents:             # <<<<<<<<<<<<<<
  *     SAX_EVENT_START    = 1 << 0
@@ -1214,7 +1214,7 @@ typedef enum __pyx_t_4lxml_5etree__InputDocumentDataType __pyx_t_4lxml_5etree__I
  */
 enum __pyx_t_4lxml_5etree__SaxParserEvents {
 
-  /* "src/lxml/saxparser.pxi":11
+  /* "src/lxml/saxparser.pxi":20
  *     SAX_EVENT_COMMENT  = 1 << 5
  *     SAX_EVENT_START_NS = 1 << 6
  *     SAX_EVENT_END_NS   = 1 << 7             # <<<<<<<<<<<<<<
@@ -1232,7 +1232,7 @@ enum __pyx_t_4lxml_5etree__SaxParserEvents {
 };
 typedef enum __pyx_t_4lxml_5etree__SaxParserEvents __pyx_t_4lxml_5etree__SaxParserEvents;
 
-/* "src/lxml/saxparser.pxi":13
+/* "src/lxml/saxparser.pxi":22
  *     SAX_EVENT_END_NS   = 1 << 7
  * 
  * ctypedef enum _ParseEventFilter:             # <<<<<<<<<<<<<<
@@ -1241,7 +1241,7 @@ typedef enum __pyx_t_4lxml_5etree__SaxParserEvents __pyx_t_4lxml_5etree__SaxPars
  */
 enum __pyx_t_4lxml_5etree__ParseEventFilter {
 
-  /* "src/lxml/saxparser.pxi":19
+  /* "src/lxml/saxparser.pxi":28
  *     PARSE_EVENT_FILTER_END_NS    = 1 << 3
  *     PARSE_EVENT_FILTER_COMMENT   = 1 << 4
  *     PARSE_EVENT_FILTER_PI        = 1 << 5             # <<<<<<<<<<<<<<
@@ -1270,7 +1270,7 @@ enum __pyx_t_4lxml_5etree__OutputMethods {
   __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT
 };
 
-/* "src/lxml/serializer.pxi":1384
+/* "src/lxml/serializer.pxi":1389
  * 
  * 
  * cdef enum _IncrementalFileWriterStatus:             # <<<<<<<<<<<<<<
@@ -1439,7 +1439,7 @@ struct __pyx_opt_args_4lxml_5etree_16C14NWriterTarget__qname {
   PyObject *uri;
 };
 
-/* "src/lxml/serializer.pxi":1126
+/* "src/lxml/serializer.pxi":1131
  *         self._start(tag, attrs, new_namespaces)
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):             # <<<<<<<<<<<<<<
@@ -2543,7 +2543,7 @@ struct __pyx_obj_4lxml_5etree_HTMLPullParser {
 };
 
 
-/* "src/lxml/saxparser.pxi":43
+/* "src/lxml/saxparser.pxi":52
  * 
  * 
  * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<<
@@ -2557,7 +2557,7 @@ struct __pyx_obj_4lxml_5etree__SaxParserTarget {
 };
 
 
-/* "src/lxml/saxparser.pxi":69
+/* "src/lxml/saxparser.pxi":78
  * @cython.internal
  * @cython.no_gc_clear  # Required because parent class uses it - Cython bug.
  * cdef class _SaxParserContext(_ParserContext):             # <<<<<<<<<<<<<<
@@ -2587,7 +2587,7 @@ struct __pyx_obj_4lxml_5etree__SaxParserContext {
 };
 
 
-/* "src/lxml/saxparser.pxi":245
+/* "src/lxml/saxparser.pxi":254
  * @cython.final
  * @cython.internal
  * cdef class _ParseEventsIterator:             # <<<<<<<<<<<<<<
@@ -2601,7 +2601,7 @@ struct __pyx_obj_4lxml_5etree__ParseEventsIterator {
 };
 
 
-/* "src/lxml/saxparser.pxi":691
+/* "src/lxml/saxparser.pxi":700
  * ############################################################
  * 
  * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<<
@@ -2717,7 +2717,7 @@ struct __pyx_obj_4lxml_5etree_C14NWriterTarget {
 };
 
 
-/* "src/lxml/serializer.pxi":1284
+/* "src/lxml/serializer.pxi":1289
  * # incremental serialisation
  * 
  * cdef class xmlfile:             # <<<<<<<<<<<<<<
@@ -2737,7 +2737,7 @@ struct __pyx_obj_4lxml_5etree_xmlfile {
 };
 
 
-/* "src/lxml/serializer.pxi":1373
+/* "src/lxml/serializer.pxi":1378
  * 
  * 
  * cdef class htmlfile(xmlfile):             # <<<<<<<<<<<<<<
@@ -2749,7 +2749,7 @@ struct __pyx_obj_4lxml_5etree_htmlfile {
 };
 
 
-/* "src/lxml/serializer.pxi":1394
+/* "src/lxml/serializer.pxi":1399
  * @cython.final
  * @cython.internal
  * cdef class _IncrementalFileWriter:             # <<<<<<<<<<<<<<
@@ -2770,7 +2770,7 @@ struct __pyx_obj_4lxml_5etree__IncrementalFileWriter {
 };
 
 
-/* "src/lxml/serializer.pxi":1698
+/* "src/lxml/serializer.pxi":1703
  * @cython.final
  * @cython.internal
  * cdef class _AsyncDataWriter:             # <<<<<<<<<<<<<<
@@ -2784,7 +2784,7 @@ struct __pyx_obj_4lxml_5etree__AsyncDataWriter {
 };
 
 
-/* "src/lxml/serializer.pxi":1717
+/* "src/lxml/serializer.pxi":1722
  * @cython.final
  * @cython.internal
  * cdef class _AsyncIncrementalFileWriter:             # <<<<<<<<<<<<<<
@@ -2803,7 +2803,7 @@ struct __pyx_obj_4lxml_5etree__AsyncIncrementalFileWriter {
 };
 
 
-/* "src/lxml/serializer.pxi":1782
+/* "src/lxml/serializer.pxi":1787
  * @cython.final
  * @cython.internal
  * cdef class _AsyncFileWriterElement:             # <<<<<<<<<<<<<<
@@ -2817,7 +2817,7 @@ struct __pyx_obj_4lxml_5etree__AsyncFileWriterElement {
 };
 
 
-/* "src/lxml/serializer.pxi":1807
+/* "src/lxml/serializer.pxi":1812
  * @cython.internal
  * @cython.freelist(8)
  * cdef class _FileWriterElement:             # <<<<<<<<<<<<<<
@@ -2833,7 +2833,7 @@ struct __pyx_obj_4lxml_5etree__FileWriterElement {
 };
 
 
-/* "src/lxml/serializer.pxi":1831
+/* "src/lxml/serializer.pxi":1836
  * @cython.internal
  * @cython.freelist(8)
  * cdef class _MethodChanger:             # <<<<<<<<<<<<<<
@@ -3632,7 +3632,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_1__iter_namespaces {
 };
 
 
-/* "src/lxml/serializer.pxi":1353
+/* "src/lxml/serializer.pxi":1358
  *                 self.output_file = None
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -3645,7 +3645,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2___aenter__ {
 };
 
 
-/* "src/lxml/serializer.pxi":1364
+/* "src/lxml/serializer.pxi":1369
  *         return self.async_writer
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -3663,7 +3663,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3___aexit__ {
 };
 
 
-/* "src/lxml/serializer.pxi":1740
+/* "src/lxml/serializer.pxi":1745
  *         return None
  * 
  *     async def flush(self):             # <<<<<<<<<<<<<<
@@ -3677,7 +3677,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_flush {
 };
 
 
-/* "src/lxml/serializer.pxi":1746
+/* "src/lxml/serializer.pxi":1751
  *             await self._async_outfile.write(data)
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
@@ -3694,7 +3694,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write_declaration {
 };
 
 
-/* "src/lxml/serializer.pxi":1752
+/* "src/lxml/serializer.pxi":1757
  *             await self._async_outfile.write(data)
  * 
  *     async def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
@@ -3709,7 +3709,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6_write_doctype {
 };
 
 
-/* "src/lxml/serializer.pxi":1758
+/* "src/lxml/serializer.pxi":1763
  *             await self._async_outfile.write(data)
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):             # <<<<<<<<<<<<<<
@@ -3727,7 +3727,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7_write {
 };
 
 
-/* "src/lxml/serializer.pxi":1771
+/* "src/lxml/serializer.pxi":1776
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  *     async def _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
@@ -3742,7 +3742,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8__close {
 };
 
 
-/* "src/lxml/serializer.pxi":1791
+/* "src/lxml/serializer.pxi":1796
  *         self._writer = writer
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -3756,7 +3756,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ {
 };
 
 
-/* "src/lxml/serializer.pxi":1797
+/* "src/lxml/serializer.pxi":1802
  *             await self._writer._async_outfile.write(data)
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -3771,7 +3771,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ {
 };
 
 
-/* "src/lxml/serializer.pxi":1859
+/* "src/lxml/serializer.pxi":1864
  *         self._exited = True
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -3784,7 +3784,7 @@ struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11___aenter__ {
 };
 
 
-/* "src/lxml/serializer.pxi":1863
+/* "src/lxml/serializer.pxi":1868
  *         return self.__enter__()
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -4831,7 +4831,7 @@ struct __pyx_vtabstruct_4lxml_5etree_HTMLPullParser {
 static struct __pyx_vtabstruct_4lxml_5etree_HTMLPullParser *__pyx_vtabptr_4lxml_5etree_HTMLPullParser;
 
 
-/* "src/lxml/saxparser.pxi":43
+/* "src/lxml/saxparser.pxi":52
  * 
  * 
  * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<<
@@ -4852,7 +4852,7 @@ struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget {
 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
 
 
-/* "src/lxml/saxparser.pxi":69
+/* "src/lxml/saxparser.pxi":78
  * @cython.internal
  * @cython.no_gc_clear  # Required because parent class uses it - Cython bug.
  * cdef class _SaxParserContext(_ParserContext):             # <<<<<<<<<<<<<<
@@ -4874,7 +4874,7 @@ struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext {
 static struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *__pyx_vtabptr_4lxml_5etree__SaxParserContext;
 
 
-/* "src/lxml/saxparser.pxi":691
+/* "src/lxml/saxparser.pxi":700
  * ############################################################
  * 
  * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<<
@@ -4958,7 +4958,7 @@ struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget {
 static struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *__pyx_vtabptr_4lxml_5etree_C14NWriterTarget;
 
 
-/* "src/lxml/serializer.pxi":1394
+/* "src/lxml/serializer.pxi":1399
  * @cython.final
  * @cython.internal
  * cdef class _IncrementalFileWriter:             # <<<<<<<<<<<<<<
@@ -4989,7 +4989,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
 static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *, int);
 
 
-/* "src/lxml/serializer.pxi":1698
+/* "src/lxml/serializer.pxi":1703
  * @cython.final
  * @cython.internal
  * cdef class _AsyncDataWriter:             # <<<<<<<<<<<<<<
@@ -5004,7 +5004,7 @@ static struct __pyx_vtabstruct_4lxml_5etree__AsyncDataWriter *__pyx_vtabptr_4lxm
 static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_obj_4lxml_5etree__AsyncDataWriter *);
 
 
-/* "src/lxml/serializer.pxi":1717
+/* "src/lxml/serializer.pxi":1722
  * @cython.final
  * @cython.internal
  * cdef class _AsyncIncrementalFileWriter:             # <<<<<<<<<<<<<<
@@ -7402,6 +7402,7 @@ static PyObject *__pyx_builtin_ImportError;
 static PyObject *__pyx_builtin_SyntaxError;
 static PyObject *__pyx_builtin_object;
 static PyObject *__pyx_builtin_property;
+static PyObject *__pyx_builtin_AssertionError;
 static PyObject *__pyx_builtin_staticmethod;
 static PyObject *__pyx_builtin_KeyError;
 static PyObject *__pyx_builtin_ValueError;
@@ -7427,7 +7428,6 @@ static PyObject *__pyx_builtin_LookupError;
 static PyObject *__pyx_builtin_reversed;
 static PyObject *__pyx_builtin_sorted;
 static PyObject *__pyx_builtin_NotImplementedError;
-static PyObject *__pyx_builtin_AssertionError;
 static const char __pyx_k_1[] = "[1]";
 static const char __pyx_k_A[] = "A";
 static const char __pyx_k_U[] = "U";
@@ -7827,6 +7827,7 @@ static const char __pyx_k_message[] = "message";
 static const char __pyx_k_new_doc[] = "new_doc";
 static const char __pyx_k_new_pos[] = "new_pos";
 static const char __pyx_k_nmtoken[] = "nmtoken";
+static const char __pyx_k_of_name[] = "\" of name \"";
 static const char __pyx_k_options[] = "options";
 static const char __pyx_k_os_path[] = "os.path";
 static const char __pyx_k_outfile[] = "outfile";
@@ -8560,6 +8561,7 @@ static const char __pyx_k_RelaxNG_from_rnc_string[] = "RelaxNG.from_rnc_string";
 static const char __pyx_k_ResolverRegistry_remove[] = "_ResolverRegistry.remove";
 static const char __pyx_k_Resolver_resolve_string[] = "Resolver.resolve_string";
 static const char __pyx_k_SchematronValidateError[] = "SchematronValidateError";
+static const char __pyx_k_XMLSyntaxAssertionError[] = "XMLSyntaxAssertionError";
 static const char __pyx_k_adopt_external_document[] = "adopt_external_document";
 static const char __pyx_k_input_is_not_an_Element[] = "input is not an Element";
 static const char __pyx_k_list_index_out_of_range[] = "list index out of range";
@@ -8694,6 +8696,7 @@ static const char __pyx_k_XSLTExtension_process_children[] = "XSLTExtension.proc
 static const char __pyx_k_cannot_append_parent_to_itself[] = "cannot append parent to itself";
 static const char __pyx_k_http_www_w3_org_2001_XMLSchema[] = "http://www.w3.org/2001/XMLSchema";
 static const char __pyx_k_s_s_object_name_r_type_r_occur[] = "<%s.%s object name=%r type=%r occur=%r at 0x%x>";
+static const char __pyx_k_An_XMLSyntaxError_that_addition[] = "\n    An XMLSyntaxError that additionally inherits from AssertionError for\n    ElementTree / backwards compatibility reasons.\n\n    This class may get replaced by a plain XMLSyntaxError in a future version.\n    ";
 static const char __pyx_k_AsyncFileWriterElement___aenter[] = "_AsyncFileWriterElement.__aenter__";
 static const char __pyx_k_AsyncIncrementalFileWriter__clo[] = "_AsyncIncrementalFileWriter._close";
 static const char __pyx_k_AsyncIncrementalFileWriter_elem[] = "_AsyncIncrementalFileWriter.element";
@@ -8845,6 +8848,7 @@ static PyObject *__pyx_n_b_ASCII;
 static PyObject *__pyx_n_s_ASCII;
 static PyObject *__pyx_n_u_ASCII;
 static PyObject *__pyx_kp_s_All_strings_must_be_XML_compatib;
+static PyObject *__pyx_kp_s_An_XMLSyntaxError_that_addition;
 static PyObject *__pyx_n_s_AncestorsIterator;
 static PyObject *__pyx_n_s_AppendOnlyElementProxy_append;
 static PyObject *__pyx_n_s_AppendOnlyElementProxy_extend;
@@ -9387,6 +9391,7 @@ static PyObject *__pyx_n_s_XMLSchema;
 static PyObject *__pyx_n_s_XMLSchemaError;
 static PyObject *__pyx_n_s_XMLSchemaParseError;
 static PyObject *__pyx_n_s_XMLSchemaValidateError;
+static PyObject *__pyx_n_s_XMLSyntaxAssertionError;
 static PyObject *__pyx_n_s_XMLSyntaxError;
 static PyObject *__pyx_n_s_XMLTreeBuilder;
 static PyObject *__pyx_kp_s_XML_declaration_already_written;
@@ -9947,8 +9952,8 @@ static PyObject *__pyx_kp_b_memorylist;
 static PyObject *__pyx_n_s_message;
 static PyObject *__pyx_n_s_metaclass;
 static PyObject *__pyx_n_s_method;
-static PyObject *__pyx_kp_u_missing_end_tags;
-static PyObject *__pyx_kp_u_missing_toplevel_element;
+static PyObject *__pyx_kp_s_missing_end_tags;
+static PyObject *__pyx_kp_s_missing_toplevel_element;
 static PyObject *__pyx_n_s_mixed;
 static PyObject *__pyx_n_s_mode;
 static PyObject *__pyx_n_s_module;
@@ -9991,6 +9996,7 @@ static PyObject *__pyx_n_s_obj;
 static PyObject *__pyx_n_s_object;
 static PyObject *__pyx_n_s_occur;
 static PyObject *__pyx_kp_u_of_QName;
+static PyObject *__pyx_kp_u_of_name;
 static PyObject *__pyx_n_s_offset;
 static PyObject *__pyx_n_s_old;
 static PyObject *__pyx_n_s_old_element;
@@ -14499,7 +14505,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__registerProxy(struct LxmlElement
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((!(__pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node) != 0)) != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_double_registering_proxy);
-      __PYX_ERR(4, 34, __pyx_L1_error)
+      __PYX_ERR(5, 34, __pyx_L1_error)
     }
   }
   #endif
@@ -14601,7 +14607,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__unregisterProxy(struct LxmlElemen
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_c_node->_private == ((void *)__pyx_v_proxy)) != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Tried_to_unregister_unknown_prox);
-      __PYX_ERR(4, 47, __pyx_L1_error)
+      __PYX_ERR(5, 47, __pyx_L1_error)
     }
   }
   #endif
@@ -14666,7 +14672,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *__pyx_v_c_base_doc, xml
  * 
  * cdef xmlDoc* _plainFakeRootDoc(xmlDoc* c_base_doc, xmlNode* c_node,
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_c_base_doc, __pyx_v_c_node, 1); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(4, 56, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__plainFakeRootDoc(__pyx_v_c_base_doc, __pyx_v_c_node, 1); if (unlikely(__pyx_t_1 == ((xmlDoc *)NULL))) __PYX_ERR(5, 56, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -14789,7 +14795,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__plainFakeRootDoc(xmlDoc *__pyx_v_c_base_doc
  *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
  *     tree.xmlDocSetRootElement(c_doc, c_new_root)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc, 0); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(4, 73, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc, 0); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 73, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_3;
 
   /* "src/lxml/proxy.pxi":74
@@ -15163,7 +15169,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__fakeDocElementFactory(struct Lx
  * ################################################################################
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_element)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 128, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_element)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 128, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct LxmlElement *)__pyx_t_2);
   __pyx_t_2 = 0;
@@ -15992,7 +15998,7 @@ static int __pyx_f_4lxml_5etree__growNsCache(__pyx_t_4lxml_5etree__nscache *__py
  *     c_ns_cache.ns_map = ns_map_ptr
  *     return 0
  */
-    PyErr_NoMemory(); __PYX_ERR(4, 238, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(5, 238, __pyx_L1_error)
 
     /* "src/lxml/proxy.pxi":235
  *     ns_map_ptr = <_ns_update_map*> python.lxml_realloc(
@@ -16075,7 +16081,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__appendToNsCache(__pyx_t_4lxml_5et
  *     c_ns_cache.ns_map[c_ns_cache.last] = _ns_update_map(old=c_old_ns, new=c_new_ns)
  *     c_ns_cache.last += 1
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__growNsCache(__pyx_v_c_ns_cache); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 246, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__growNsCache(__pyx_v_c_ns_cache); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 246, __pyx_L1_error)
 
     /* "src/lxml/proxy.pxi":245
  * cdef inline int _appendToNsCache(_nscache* c_ns_cache,
@@ -16193,7 +16199,7 @@ static int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *__
  *             c_nsdef = &c_nsdef[0].next
  *         else:
  */
-      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), (__pyx_v_c_nsdef[0])); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 267, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), (__pyx_v_c_nsdef[0])); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 267, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":268
  *             # new namespace href => keep and cache the ns declaration
@@ -16222,7 +16228,7 @@ static int __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(xmlNode *__
  *             c_ns_next = c_nsdef[0].next
  */
     /*else*/ {
-      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), __pyx_v_c_ns); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(4, 271, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, (__pyx_v_c_nsdef[0]), __pyx_v_c_ns); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 271, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":273
  *             _appendToNsCache(c_ns_cache, c_nsdef[0], c_ns)
@@ -16589,7 +16595,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  * 
  *         # 1) cut out namespaces defined here that are already known by
  */
-      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_proxy_count, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 346, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_proxy_count, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 346, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF_SET(__pyx_v_proxy_count, __pyx_t_4);
       __pyx_t_4 = 0;
@@ -16636,7 +16642,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             except:
  *                 _cleanUpFromNamespaceAdaptation(c_start_node, &c_ns_cache, c_del_ns_list)
  */
-          __pyx_t_8 = __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(__pyx_v_c_element, (&__pyx_v_c_ns_cache), (&__pyx_v_c_del_ns_list)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 352, __pyx_L7_error)
+          __pyx_t_8 = __pyx_f_4lxml_5etree__stripRedundantNamespaceDeclarations(__pyx_v_c_element, (&__pyx_v_c_ns_cache), (&__pyx_v_c_del_ns_list)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 352, __pyx_L7_error)
 
           /* "src/lxml/proxy.pxi":351
  *         #    the ancestors
@@ -16662,7 +16668,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  */
         /*except:*/ {
           __Pyx_AddTraceback("lxml.etree.moveNodeToDocument", __pyx_clineno, __pyx_lineno, __pyx_filename);
-          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(4, 353, __pyx_L9_except_error)
+          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(5, 353, __pyx_L9_except_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_GOTREF(__pyx_t_9);
           __Pyx_GOTREF(__pyx_t_10);
@@ -16688,7 +16694,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
           __Pyx_XGIVEREF(__pyx_t_10);
           __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_9, __pyx_t_10);
           __pyx_t_4 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; 
-          __PYX_ERR(4, 355, __pyx_L9_except_error)
+          __PYX_ERR(5, 355, __pyx_L9_except_error)
         }
         __pyx_L9_except_error:;
 
@@ -16733,7 +16739,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  * 
  *         c_node = <xmlNode*>c_element.properties
  */
-      __pyx_t_8 = __pyx_f_4lxml_5etree__fixCNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_element, (&__pyx_v_c_ns_cache), __pyx_v_c_del_ns_list); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 360, __pyx_L1_error)
+      __pyx_t_8 = __pyx_f_4lxml_5etree__fixCNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_element, (&__pyx_v_c_ns_cache), __pyx_v_c_del_ns_list); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 360, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":359
  *         # 2) make sure the namespaces of an element and its attributes
@@ -16781,7 +16787,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             c_node = c_node.next
  * 
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__fixCNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node, (&__pyx_v_c_ns_cache), __pyx_v_c_del_ns_list); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 365, __pyx_L1_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__fixCNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node, (&__pyx_v_c_ns_cache), __pyx_v_c_del_ns_list); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 365, __pyx_L1_error)
 
         /* "src/lxml/proxy.pxi":364
  *         c_node = <xmlNode*>c_element.properties
@@ -16912,8 +16918,8 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *         if proxy_count == 1 and c_start_node._private is not NULL:
  *             proxy = getProxy(c_start_node)
  */
-  __pyx_t_10 = PyObject_RichCompare(__pyx_v_proxy_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 384, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 384, __pyx_L1_error)
+  __pyx_t_10 = PyObject_RichCompare(__pyx_v_proxy_count, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 384, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 384, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
   if (__pyx_t_3) {
 
@@ -16924,9 +16930,9 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             proxy = getProxy(c_start_node)
  *             if proxy is not None:
  */
-    __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_v_proxy_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 385, __pyx_L1_error)
+    __pyx_t_10 = __Pyx_PyInt_EqObjC(__pyx_v_proxy_count, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 385, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
-    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(4, 385, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(5, 385, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     if (__pyx_t_12) {
     } else {
@@ -16945,7 +16951,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             if proxy is not None:
  *                 if proxy._doc is not doc:
  */
-      __pyx_t_10 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_start_node)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 386, __pyx_L1_error)
+      __pyx_t_10 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_start_node)); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 386, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __pyx_v_proxy = ((struct LxmlElement *)__pyx_t_10);
       __pyx_t_10 = 0;
@@ -17012,7 +17018,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *             fixElementDocument(c_start_node, doc, proxy_count)
  */
       /*else*/ {
-        __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_v_proxy_count); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 391, __pyx_L1_error)
+        __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_v_proxy_count); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 391, __pyx_L1_error)
         __pyx_f_4lxml_5etree_fixElementDocument(__pyx_v_c_start_node, __pyx_v_doc, __pyx_t_13);
       }
       __pyx_L26:;
@@ -17035,7 +17041,7 @@ static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_
  *     return 0
  */
     /*else*/ {
-      __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_v_proxy_count); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 393, __pyx_L1_error)
+      __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_v_proxy_count); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(5, 393, __pyx_L1_error)
       __pyx_f_4lxml_5etree_fixElementDocument(__pyx_v_c_start_node, __pyx_v_doc, __pyx_t_13);
     }
     __pyx_L23:;
@@ -17517,7 +17523,7 @@ static int __pyx_f_4lxml_5etree__fixCNs(struct LxmlDocument *__pyx_v_doc, xmlNod
  *                 c_start_node, c_node.ns.href, c_node.ns.prefix,
  *                 c_node.type == tree.XML_ATTRIBUTE_NODE)
  */
-        __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node->ns->href, __pyx_v_c_node->ns->prefix, (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE)); if (unlikely(__pyx_t_6 == ((xmlNs *)NULL))) __PYX_ERR(4, 443, __pyx_L12_error)
+        __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_start_node, __pyx_v_c_node->ns->href, __pyx_v_c_node->ns->prefix, (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE)); if (unlikely(__pyx_t_6 == ((xmlNs *)NULL))) __PYX_ERR(5, 443, __pyx_L12_error)
         __pyx_v_c_ns = __pyx_t_6;
 
         /* "src/lxml/proxy.pxi":446
@@ -17536,7 +17542,7 @@ static int __pyx_f_4lxml_5etree__fixCNs(struct LxmlDocument *__pyx_v_doc, xmlNod
  *         except:
  *             _cleanUpFromNamespaceAdaptation(c_start_node, c_ns_cache, c_del_ns_list)
  */
-        __pyx_t_10 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, __pyx_v_c_node->ns, __pyx_v_c_ns); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(4, 447, __pyx_L12_error)
+        __pyx_t_10 = __pyx_f_4lxml_5etree__appendToNsCache(__pyx_v_c_ns_cache, __pyx_v_c_node->ns, __pyx_v_c_ns); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 447, __pyx_L12_error)
 
         /* "src/lxml/proxy.pxi":442
  *         # not in cache or not acceptable
@@ -17561,7 +17567,7 @@ static int __pyx_f_4lxml_5etree__fixCNs(struct LxmlDocument *__pyx_v_doc, xmlNod
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._fixCNs", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0) __PYX_ERR(4, 448, __pyx_L14_except_error)
+        if (__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0) __PYX_ERR(5, 448, __pyx_L14_except_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_GOTREF(__pyx_t_12);
         __Pyx_GOTREF(__pyx_t_13);
@@ -17587,7 +17593,7 @@ static int __pyx_f_4lxml_5etree__fixCNs(struct LxmlDocument *__pyx_v_doc, xmlNod
         __Pyx_XGIVEREF(__pyx_t_13);
         __Pyx_ErrRestoreWithState(__pyx_t_11, __pyx_t_12, __pyx_t_13);
         __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; 
-        __PYX_ERR(4, 450, __pyx_L14_except_error)
+        __PYX_ERR(5, 450, __pyx_L14_except_error)
       }
       __pyx_L14_except_error:;
 
@@ -17703,7 +17709,7 @@ static void __pyx_f_4lxml_5etree_fixElementDocument(xmlNode *__pyx_v_c_element,
  *         if proxy is not None:
  *             if proxy._doc is not doc:
  */
-    __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 460, __pyx_L1_error)
+    __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 460, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF_SET(__pyx_v_proxy, ((struct LxmlElement *)__pyx_t_2));
     __pyx_t_2 = 0;
@@ -18879,11 +18885,11 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__adoptForeignDoc(xmlDoc *__pyx_
  *     if c_doc.type not in (tree.XML_DOCUMENT_NODE, tree.XML_HTML_DOCUMENT_NODE):
  *         doc_type = c_doc.type
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 600, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 600, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(4, 600, __pyx_L1_error)
+    __PYX_ERR(5, 600, __pyx_L1_error)
 
     /* "src/lxml/proxy.pxi":599
  *     dereference into lxml proxy objects.
@@ -18958,17 +18964,17 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__adoptForeignDoc(xmlDoc *__pyx_
  * 
  *     cdef xmlNode* c_node = <xmlNode*>c_doc
  */
-    __pyx_t_2 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_doc_type, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 605, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_doc_type, 0, ' ', 'd'); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 605, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Illegal_document_provided_expect, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 605, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Illegal_document_provided_expect, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 605, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 605, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 605, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(4, 605, __pyx_L1_error)
+    __PYX_ERR(5, 605, __pyx_L1_error)
 
     /* "src/lxml/proxy.pxi":601
  *     if c_doc is NULL:
@@ -19062,7 +19068,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__adoptForeignDoc(xmlDoc *__pyx_
  * 
  *     return _documentFactory(c_doc, parser)
  */
-      PyErr_NoMemory(); __PYX_ERR(4, 617, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(5, 617, __pyx_L1_error)
 
       /* "src/lxml/proxy.pxi":616
  *         # create a fresh copy that lxml owns
@@ -19081,7 +19087,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__adoptForeignDoc(xmlDoc *__pyx_
  *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<<
  */
   __Pyx_XDECREF(((PyObject *)__pyx_r));
-  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 619, __pyx_L1_error)
+  __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 619, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = ((struct LxmlDocument *)__pyx_t_2);
   __pyx_t_2 = 0;
@@ -19150,11 +19156,11 @@ static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *
  *         c_child = c_node.children
  *         while c_child is not NULL:
  */
-    __pyx_t_1 = PyNumber_Multiply(__pyx_v_indent, __pyx_kp_u__11); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L4_error)
+    __pyx_t_1 = PyNumber_Multiply(__pyx_v_indent, __pyx_kp_u__11); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 10, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 10, __pyx_L4_error)
+    __pyx_t_2 = __Pyx_PyInt_From_long(((long)__pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 10, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 10, __pyx_L4_error)
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 10, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
@@ -19162,7 +19168,7 @@ static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
     __pyx_t_1 = 0;
     __pyx_t_2 = 0;
-    if (__Pyx_Print(0, __pyx_t_3, 1) < 0) __PYX_ERR(5, 10, __pyx_L4_error)
+    if (__Pyx_Print(0, __pyx_t_3, 1) < 0) __PYX_ERR(6, 10, __pyx_L4_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
     /* "src/lxml/apihelpers.pxi":11
@@ -19193,7 +19199,7 @@ static void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node, PyObject *
  *             c_child = c_child.next
  *     finally:
  */
-      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_indent, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 13, __pyx_L4_error)
+      __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_indent, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 13, __pyx_L4_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_f_4lxml_5etree_displayNode(__pyx_v_c_child, __pyx_t_3);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -19296,14 +19302,14 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__assertValidNode(struct LxmlElemen
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_element->_c_node != NULL) != 0))) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_element)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 19, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_Element_proxy_at_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 19, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_Element_proxy_at_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 19, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(5, 19, __pyx_L1_error)
+      __PYX_ERR(6, 19, __pyx_L1_error)
     }
   }
   #endif
@@ -19357,14 +19363,14 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__assertValidDoc(struct LxmlDocumen
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_doc->_c_doc != NULL) != 0))) {
-      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_doc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 22, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_doc)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 22, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_Document_proxy_at_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 22, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_invalid_Document_proxy_at_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 22, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(5, 22, __pyx_L1_error)
+      __PYX_ERR(6, 22, __pyx_L1_error)
     }
   }
   #endif
@@ -19555,14 +19561,14 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__py
  */
   /*else*/ {
     __pyx_t_4 = _fqtypename(__pyx_v_input);
-    __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 41, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 41, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_input_object, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 41, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_input_object, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 41, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(5, 41, __pyx_L1_error)
+    __PYX_ERR(6, 41, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -19585,14 +19591,14 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__py
  *     return doc
  */
     __pyx_t_4 = _fqtypename(__pyx_v_input);
-    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 43, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 43, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Input_object_has_no_document, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 43, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Input_object_has_no_document, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 43, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 43, __pyx_L1_error)
+    __PYX_ERR(6, 43, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":42
  *     else:
@@ -19610,7 +19616,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__py
  *     return doc
  * 
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 44, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__assertValidDoc(__pyx_v_doc); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 44, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":45
  *         raise ValueError, f"Input object has no document: {python._fqtypename(input).decode('utf8')}"
@@ -19753,9 +19759,9 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx
  *     else:
  *         raise TypeError, f"Invalid input object: {python._fqtypename(input).decode('utf8')}"
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 59, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 59, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 59, __pyx_L1_error)
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 59, __pyx_L1_error)
     __pyx_v_node = ((struct LxmlElement *)__pyx_t_3);
     __pyx_t_3 = 0;
 
@@ -19778,14 +19784,14 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx
  */
   /*else*/ {
     __pyx_t_4 = _fqtypename(__pyx_v_input);
-    __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 61, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 61, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_input_object, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 61, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_input_object, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 61, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(5, 61, __pyx_L1_error)
+    __PYX_ERR(6, 61, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -19838,14 +19844,14 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx
  *     return node
  */
     __pyx_t_4 = _fqtypename(__pyx_v_input);
-    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 64, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 64, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Input_object_is_not_an_XML_eleme, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 64, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Input_object_is_not_an_XML_eleme, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 64, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 64, __pyx_L1_error)
+    __PYX_ERR(6, 64, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":62
  *     else:
@@ -19863,7 +19869,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx
  *     return node
  * 
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 65, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 65, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":66
  *         raise ValueError, f"Input object is not an XML element: {python._fqtypename(input).decode('utf8')}"
@@ -20057,7 +20063,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     if parser is not None and parser._for_html:
  *         _htmlTagValidOrRaise(name_utf)
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 95, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 95, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   if (likely(__pyx_t_4 != Py_None)) {
     PyObject* sequence = __pyx_t_4;
@@ -20065,7 +20071,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 95, __pyx_L1_error)
+      __PYX_ERR(6, 95, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
@@ -20073,14 +20079,14 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
     __Pyx_INCREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_t_6);
     #else
-    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 95, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 95, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 95, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 95, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     #endif
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 95, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 95, __pyx_L1_error)
   }
   __pyx_v_ns_utf = __pyx_t_5;
   __pyx_t_5 = 0;
@@ -20113,7 +20119,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if c_doc is NULL:
  *             c_doc = _newHTMLDoc()
  */
-    __pyx_t_8 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 97, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 97, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":98
  *     if parser is not None and parser._for_html:
@@ -20132,7 +20138,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 99, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(6, 99, __pyx_L1_error)
       __pyx_v_c_doc = __pyx_t_3;
 
       /* "src/lxml/apihelpers.pxi":98
@@ -20162,7 +20168,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *             c_doc = _newXMLDoc()
  */
   /*else*/ {
-    __pyx_t_8 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 101, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 101, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":102
  *     else:
@@ -20181,7 +20187,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     c_node = _createElement(c_doc, name_utf)
  *     if c_node is NULL:
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 103, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(6, 103, __pyx_L1_error)
       __pyx_v_c_doc = __pyx_t_3;
 
       /* "src/lxml/apihelpers.pxi":102
@@ -20202,7 +20208,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     if c_node is NULL:
  *         if doc is None and c_doc is not NULL:
  */
-  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(5, 104, __pyx_L1_error)
+  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(6, 104, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_9;
 
   /* "src/lxml/apihelpers.pxi":105
@@ -20259,7 +20265,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *     try:
  *         if doc is None:
  */
-    PyErr_NoMemory(); __PYX_ERR(5, 108, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(6, 108, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":105
  *             c_doc = _newXMLDoc()
@@ -20313,7 +20319,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if text is not None:
  *             _setNodeText(c_node, text)
  */
-        __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 112, __pyx_L13_error)
+        __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 112, __pyx_L13_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_doc, ((struct LxmlDocument *)__pyx_t_4));
         __pyx_t_4 = 0;
@@ -20345,7 +20351,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         if tail is not None:
  *             _setTailText(c_node, tail)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 114, __pyx_L13_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 114, __pyx_L13_error)
 
         /* "src/lxml/apihelpers.pxi":113
  *             tree.xmlDocSetRootElement(c_doc, c_node)
@@ -20374,7 +20380,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         # add namespaces to node if necessary
  *         _setNodeNamespaces(c_node, doc, ns_utf, nsmap)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 116, __pyx_L13_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 116, __pyx_L13_error)
 
         /* "src/lxml/apihelpers.pxi":115
  *         if text is not None:
@@ -20392,7 +20398,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
  *         return _elementFactory(doc, c_node)
  */
-      __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(5, 118, __pyx_L13_error)
+      __pyx_t_8 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 118, __pyx_L13_error)
 
       /* "src/lxml/apihelpers.pxi":119
  *         # add namespaces to node if necessary
@@ -20401,7 +20407,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         return _elementFactory(doc, c_node)
  *     except:
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 119, __pyx_L13_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 119, __pyx_L13_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
@@ -20413,7 +20419,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  *         # free allocated c_node/c_doc unless Python does it for us
  */
       __Pyx_XDECREF(((PyObject *)__pyx_r));
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 120, __pyx_L13_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 120, __pyx_L13_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = ((struct LxmlElement *)__pyx_t_4);
       __pyx_t_4 = 0;
@@ -20441,7 +20447,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
  */
     /*except:*/ {
       __Pyx_AddTraceback("lxml.etree._makeElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(5, 121, __pyx_L15_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(6, 121, __pyx_L15_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_5);
@@ -20544,7 +20550,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *__pyx_v_t
       __Pyx_XGIVEREF(__pyx_t_5);
       __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_6, __pyx_t_5);
       __pyx_t_4 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; 
-      __PYX_ERR(5, 131, __pyx_L15_except_error)
+      __PYX_ERR(6, 131, __pyx_L15_except_error)
     }
     __pyx_L15_except_error:;
 
@@ -20635,7 +20641,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *         c_doc = _newHTMLDoc()
  *     else:
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 144, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 144, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":145
  *     if is_html:
@@ -20644,7 +20650,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 145, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__newHTMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(6, 145, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_3;
 
     /* "src/lxml/apihelpers.pxi":143
@@ -20665,7 +20671,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     c_node = _createElement(c_doc, name_utf)
  */
   /*else*/ {
-    __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 147, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 147, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":148
  *     else:
@@ -20674,7 +20680,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     c_node = _createElement(c_doc, name_utf)
  *     if c_node is NULL:
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(5, 148, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_3 == ((xmlDoc *)NULL))) __PYX_ERR(6, 148, __pyx_L1_error)
     __pyx_v_c_doc = __pyx_t_3;
   }
   __pyx_L3:;
@@ -20686,7 +20692,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     if c_node is NULL:
  *         if c_doc is not NULL:
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((xmlNode *)NULL))) __PYX_ERR(5, 149, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((xmlNode *)NULL))) __PYX_ERR(6, 149, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_4;
 
   /* "src/lxml/apihelpers.pxi":150
@@ -20734,7 +20740,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     tree.xmlDocSetRootElement(c_doc, c_node)
  *     doc = _documentFactory(c_doc, parser)
  */
-    PyErr_NoMemory(); __PYX_ERR(5, 153, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(6, 153, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":150
  *         c_doc = _newXMLDoc()
@@ -20761,7 +20767,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     # add namespaces to node if necessary
  *     _setNodeNamespaces(c_node, doc, ns_utf, nsmap)
  */
-  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 155, __pyx_L1_error)
+  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, __pyx_v_parser)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 155, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_5);
   __pyx_t_5 = 0;
@@ -20773,7 +20779,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
  *     _registerProxy(element, doc, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 157, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, __pyx_v_doc, __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 157, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":158
  *     # add namespaces to node if necessary
@@ -20782,7 +20788,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     _registerProxy(element, doc, c_node)
  *     element._init()
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 158, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, __pyx_v_doc, __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 158, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -20793,7 +20799,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     element._init()
  *     return 0
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_element, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(5, 159, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_element, __pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(6, 159, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":160
  *     _initNodeAttributes(c_node, doc, attrib, extra_attrs)
@@ -20802,7 +20808,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
  *     return 0
  * 
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 160, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_element), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_7 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -20816,7 +20822,7 @@ static int __pyx_f_4lxml_5etree__initNewElement(struct LxmlElement *__pyx_v_elem
   }
   __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 160, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -20932,7 +20938,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     ns_utf, name_utf = _getNsTag(tag)
  *     c_doc = parent._doc._c_doc
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 172, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_parent); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 172, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":173
  *         return None
@@ -20941,7 +20947,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     c_doc = parent._doc._c_doc
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 173, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 173, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   if (likely(__pyx_t_5 != Py_None)) {
     PyObject* sequence = __pyx_t_5;
@@ -20949,7 +20955,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 173, __pyx_L1_error)
+      __PYX_ERR(6, 173, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
@@ -20957,14 +20963,14 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
     __Pyx_INCREF(__pyx_t_6);
     __Pyx_INCREF(__pyx_t_7);
     #else
-    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 173, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 173, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 173, __pyx_L1_error)
+    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 173, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     #endif
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 173, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 173, __pyx_L1_error)
   }
   __pyx_v_ns_utf = __pyx_t_6;
   __pyx_t_6 = 0;
@@ -21007,7 +21013,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     else:
  *         _tagValidOrRaise(name_utf)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 177, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 177, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":176
  *     c_doc = parent._doc._c_doc
@@ -21027,7 +21033,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     c_node = _createElement(c_doc, name_utf)
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 179, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 179, __pyx_L1_error)
   }
   __pyx_L6:;
 
@@ -21038,7 +21044,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     if c_node is NULL:
  *         raise MemoryError()
  */
-  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(5, 181, __pyx_L1_error)
+  __pyx_t_9 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc, __pyx_v_name_utf); if (unlikely(__pyx_t_9 == ((xmlNode *)NULL))) __PYX_ERR(6, 181, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_9;
 
   /* "src/lxml/apihelpers.pxi":182
@@ -21058,7 +21064,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *     tree.xmlAddChild(parent._c_node, c_node)
  * 
  */
-    PyErr_NoMemory(); __PYX_ERR(5, 183, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(6, 183, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":182
  * 
@@ -21112,7 +21118,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  *         if tail is not None:
  *             _setTailText(c_node, tail)
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 188, __pyx_L10_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node, __pyx_v_text); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 188, __pyx_L10_error)
 
         /* "src/lxml/apihelpers.pxi":187
  * 
@@ -21141,7 +21147,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  * 
  *         # add namespaces to node if necessary
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 190, __pyx_L10_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node, __pyx_v_tail); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 190, __pyx_L10_error)
 
         /* "src/lxml/apihelpers.pxi":189
  *         if text is not None:
@@ -21161,7 +21167,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 193, __pyx_L10_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__setNodeNamespaces(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_ns_utf, __pyx_v_nsmap); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 193, __pyx_L10_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/apihelpers.pxi":194
@@ -21173,7 +21179,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
       __pyx_t_5 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_7 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 194, __pyx_L10_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node, ((struct LxmlDocument *)__pyx_t_5), __pyx_v_attrib, __pyx_v_extra_attrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 194, __pyx_L10_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -21188,7 +21194,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
       __Pyx_XDECREF(((PyObject *)__pyx_r));
       __pyx_t_7 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_7);
-      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 195, __pyx_L10_error)
+      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 195, __pyx_L10_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __pyx_r = ((struct LxmlElement *)__pyx_t_5);
@@ -21217,7 +21223,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
     /*except:*/ {
       __Pyx_AddTraceback("lxml.etree._makeSubElement", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(5, 196, __pyx_L12_except_error)
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(6, 196, __pyx_L12_except_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_6);
@@ -21231,7 +21237,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
  */
       __pyx_t_13 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_13);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_13), __pyx_v_c_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 198, __pyx_L12_except_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_13), __pyx_v_c_node); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 198, __pyx_L12_except_error)
       __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
       /* "src/lxml/apihelpers.pxi":199
@@ -21246,7 +21252,7 @@ static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlEleme
       __Pyx_XGIVEREF(__pyx_t_6);
       __Pyx_ErrRestoreWithState(__pyx_t_5, __pyx_t_7, __pyx_t_6);
       __pyx_t_5 = 0; __pyx_t_7 = 0; __pyx_t_6 = 0; 
-      __PYX_ERR(5, 199, __pyx_L12_except_error)
+      __PYX_ERR(6, 199, __pyx_L12_except_error)
     }
     __pyx_L12_except_error:;
 
@@ -21336,7 +21342,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *         for prefix, href in _iter_nsmap(nsmap):
  *             href_utf = _utf8(href)
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 212, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 212, __pyx_L1_error)
   if (__pyx_t_1) {
 
     /* "src/lxml/apihelpers.pxi":213
@@ -21346,15 +21352,15 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *             href_utf = _utf8(href)
  *             _uriValidOrRaise(href_utf)
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__iter_nsmap(__pyx_v_nsmap); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 213, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__iter_nsmap(__pyx_v_nsmap); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 213, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
       __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
       __pyx_t_5 = NULL;
     } else {
-      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 213, __pyx_L1_error)
+      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 213, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
-      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 213, __pyx_L1_error)
+      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 213, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     for (;;) {
@@ -21362,17 +21368,17 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         if (likely(PyList_CheckExact(__pyx_t_3))) {
           if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(5, 213, __pyx_L1_error)
+          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 213, __pyx_L1_error)
           #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 213, __pyx_L1_error)
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 213, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           #endif
         } else {
           if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(5, 213, __pyx_L1_error)
+          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 213, __pyx_L1_error)
           #else
-          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 213, __pyx_L1_error)
+          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 213, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_2);
           #endif
         }
@@ -21382,7 +21388,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 213, __pyx_L1_error)
+            else __PYX_ERR(6, 213, __pyx_L1_error)
           }
           break;
         }
@@ -21394,7 +21400,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(5, 213, __pyx_L1_error)
+          __PYX_ERR(6, 213, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -21407,15 +21413,15 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(__pyx_t_7);
         #else
-        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 213, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 213, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 213, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 213, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 213, __pyx_L1_error)
+        __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 213, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
         __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
@@ -21423,7 +21429,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         __Pyx_GOTREF(__pyx_t_6);
         index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_7);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(5, 213, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(6, 213, __pyx_L1_error)
         __pyx_t_9 = NULL;
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
         goto __pyx_L7_unpacking_done;
@@ -21431,7 +21437,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
         __pyx_t_9 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(5, 213, __pyx_L1_error)
+        __PYX_ERR(6, 213, __pyx_L1_error)
         __pyx_L7_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_6);
@@ -21446,7 +21452,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *             _uriValidOrRaise(href_utf)
  *             c_href = _xcstr(href_utf)
  */
-      __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_href); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 214, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_href); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 214, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_XDECREF_SET(__pyx_v_href_utf, ((PyObject*)__pyx_t_2));
       __pyx_t_2 = 0;
@@ -21458,7 +21464,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *             c_href = _xcstr(href_utf)
  *             if prefix is not None:
  */
-      __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_href_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 215, __pyx_L1_error)
+      __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_href_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 215, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":216
  *             href_utf = _utf8(href)
@@ -21487,7 +21493,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *                 _prefixValidOrRaise(prefix_utf)
  *                 c_prefix = _xcstr(prefix_utf)
  */
-        __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 218, __pyx_L1_error)
+        __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 218, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_XDECREF_SET(__pyx_v_prefix_utf, ((PyObject*)__pyx_t_2));
         __pyx_t_2 = 0;
@@ -21499,7 +21505,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *                 c_prefix = _xcstr(prefix_utf)
  *             else:
  */
-        __pyx_t_10 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 219, __pyx_L1_error)
+        __pyx_t_10 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 219, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":220
  *                 prefix_utf = _utf8(prefix)
@@ -21614,7 +21620,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *                 tree.xmlSetNs(c_node, c_ns)
  *                 node_ns_utf = None
  */
-      __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_v_href_utf, __pyx_v_node_ns_utf, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(5, 229, __pyx_L1_error)
+      __pyx_t_11 = (__Pyx_PyBytes_Equals(__pyx_v_href_utf, __pyx_v_node_ns_utf, Py_EQ)); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(6, 229, __pyx_L1_error)
       if (__pyx_t_11) {
 
         /* "src/lxml/apihelpers.pxi":230
@@ -21682,7 +21688,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *         doc._setNodeNs(c_node, _xcstr(node_ns_utf))
  *     return 0
  */
-    __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_node_ns_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 234, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_node_ns_utf); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 234, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":235
  *     if node_ns_utf is not None:
@@ -21691,7 +21697,7 @@ static int __pyx_f_4lxml_5etree__setNodeNamespaces(xmlNode *__pyx_v_c_node, stru
  *     return 0
  * 
  */
-    __pyx_t_10 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(5, 235, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_4lxml_5etree_9_Document__setNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_node_ns_utf)); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(6, 235, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":233
  *                 node_ns_utf = None
@@ -21770,7 +21776,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_nsmap(xmlNode *__pyx_v_c_node) {
  *     while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
  *         c_ns = c_node.nsDef
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 245, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 245, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_nsmap = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -21822,7 +21828,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_nsmap(xmlNode *__pyx_v_c_node) {
  *             if prefix not in nsmap:
  *                 nsmap[prefix] = funicodeOrNone(c_ns.href)
  */
-      __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 249, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 249, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_1);
       __pyx_t_1 = 0;
@@ -21834,7 +21840,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_nsmap(xmlNode *__pyx_v_c_node) {
  *                 nsmap[prefix] = funicodeOrNone(c_ns.href)
  *             c_ns = c_ns.next
  */
-      __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_prefix, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 250, __pyx_L1_error)
+      __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_prefix, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 250, __pyx_L1_error)
       __pyx_t_3 = (__pyx_t_2 != 0);
       if (__pyx_t_3) {
 
@@ -21845,9 +21851,9 @@ static PyObject *__pyx_f_4lxml_5etree__build_nsmap(xmlNode *__pyx_v_c_node) {
  *             c_ns = c_ns.next
  *         c_node = c_node.parent
  */
-        __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 251, __pyx_L1_error)
+        __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_ns->href); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 251, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        if (unlikely(PyDict_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_t_1) < 0)) __PYX_ERR(5, 251, __pyx_L1_error)
+        if (unlikely(PyDict_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_t_1) < 0)) __PYX_ERR(6, 251, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
         /* "src/lxml/apihelpers.pxi":250
@@ -21976,7 +21982,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *         return nsmap.items()
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 268, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 268, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_5 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -21990,7 +21996,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       }
       __pyx_t_3 = (__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_3)) __PYX_ERR(5, 268, __pyx_L1_error)
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 268, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __pyx_r = __pyx_t_3;
@@ -22022,7 +22028,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *         return nsmap.items()
  *     # nsmap will usually be a plain unordered dict => avoid type checking overhead
  */
-  __pyx_t_6 = PyObject_Length(__pyx_v_nsmap); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(5, 269, __pyx_L1_error)
+  __pyx_t_6 = PyObject_Length(__pyx_v_nsmap); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(6, 269, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_6 <= 1) != 0);
   if (__pyx_t_2) {
 
@@ -22034,7 +22040,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     if type(nsmap) is not dict and isinstance(nsmap, OrderedDict):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 270, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -22048,7 +22054,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
     }
     __pyx_t_3 = (__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_3)) __PYX_ERR(5, 270, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 270, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_3;
@@ -22080,7 +22086,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
   }
   __pyx_t_3 = __pyx_v_4lxml_5etree_OrderedDict;
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_7 = PyObject_IsInstance(__pyx_v_nsmap, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 272, __pyx_L1_error)
+  __pyx_t_7 = PyObject_IsInstance(__pyx_v_nsmap, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 272, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_1 = (__pyx_t_7 != 0);
   __pyx_t_2 = __pyx_t_1;
@@ -22095,7 +22101,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *         return sorted(nsmap.items())
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 273, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 273, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -22109,7 +22115,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
     }
     __pyx_t_3 = (__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_3)) __PYX_ERR(5, 273, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 273, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_3;
@@ -22132,7 +22138,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *         return sorted(nsmap.items())
  * 
  */
-  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 274, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PySequence_ContainsTF(Py_None, __pyx_v_nsmap, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 274, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
@@ -22144,7 +22150,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     # Move the default namespace to the end.  This makes sure libxml2
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 275, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 275, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_8 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -22158,15 +22164,15 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
     }
     __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 275, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 275, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 275, __pyx_L1_error)
+    __pyx_t_5 = PySequence_List(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 275, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_3 = ((PyObject*)__pyx_t_5);
     __pyx_t_5 = 0;
-    __pyx_t_9 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 275, __pyx_L1_error)
+    __pyx_t_9 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 275, __pyx_L1_error)
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
@@ -22187,7 +22193,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     nsdefs = [(k, v) for k, v in nsmap.items() if k is not None]
  *     nsdefs.sort()
  */
-  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nsmap, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 283, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nsmap, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 283, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_default_ns = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -22199,9 +22205,9 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     nsdefs.sort()
  *     nsdefs.append((None, default_ns))
  */
-  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 284, __pyx_L1_error)
+  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 284, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 284, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -22215,16 +22221,16 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
   }
   __pyx_t_5 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 284, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 284, __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_6 = 0;
     __pyx_t_10 = NULL;
   } else {
-    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 284, __pyx_L1_error)
+    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 284, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 284, __pyx_L1_error)
+    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 284, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   for (;;) {
@@ -22232,17 +22238,17 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       if (likely(PyList_CheckExact(__pyx_t_4))) {
         if (__pyx_t_6 >= 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_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(5, 284, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 284, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 284, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 284, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_6 >= 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_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(5, 284, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 284, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 284, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 284, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -22252,7 +22258,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(5, 284, __pyx_L1_error)
+          else __PYX_ERR(6, 284, __pyx_L1_error)
         }
         break;
       }
@@ -22264,7 +22270,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(5, 284, __pyx_L1_error)
+        __PYX_ERR(6, 284, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -22277,15 +22283,15 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       __Pyx_INCREF(__pyx_t_8);
       __Pyx_INCREF(__pyx_t_11);
       #else
-      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 284, __pyx_L1_error)
+      __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 284, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 284, __pyx_L1_error)
+      __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 284, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       #endif
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 284, __pyx_L1_error)
+      __pyx_t_12 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(6, 284, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_12);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
@@ -22293,7 +22299,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       __Pyx_GOTREF(__pyx_t_8);
       index = 1; __pyx_t_11 = __pyx_t_13(__pyx_t_12); if (unlikely(!__pyx_t_11)) goto __pyx_L12_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_11);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(5, 284, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 2) < 0) __PYX_ERR(6, 284, __pyx_L1_error)
       __pyx_t_13 = NULL;
       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
       goto __pyx_L13_unpacking_done;
@@ -22301,7 +22307,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
       __pyx_t_13 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(5, 284, __pyx_L1_error)
+      __PYX_ERR(6, 284, __pyx_L1_error)
       __pyx_L13_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_8);
@@ -22311,7 +22317,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
     __pyx_t_1 = (__pyx_v_k != Py_None);
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
-      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 284, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 284, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_v_k);
       __Pyx_GIVEREF(__pyx_v_k);
@@ -22319,7 +22325,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
       __Pyx_INCREF(__pyx_v_v);
       __Pyx_GIVEREF(__pyx_v_v);
       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_v);
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(5, 284, __pyx_L1_error)
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(6, 284, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     }
   }
@@ -22334,7 +22340,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     nsdefs.append((None, default_ns))
  *     return nsdefs
  */
-  __pyx_t_9 = PyList_Sort(__pyx_v_nsdefs); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 285, __pyx_L1_error)
+  __pyx_t_9 = PyList_Sort(__pyx_v_nsdefs); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 285, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":286
  *     nsdefs = [(k, v) for k, v in nsmap.items() if k is not None]
@@ -22343,7 +22349,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
  *     return nsdefs
  * 
  */
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 286, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 286, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(Py_None);
@@ -22351,7 +22357,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_nsmap(PyObject *__pyx_v_nsmap) {
   __Pyx_INCREF(__pyx_v_default_ns);
   __Pyx_GIVEREF(__pyx_v_default_ns);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_default_ns);
-  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_nsdefs, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 286, __pyx_L1_error)
+  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_nsdefs, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 286, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
   /* "src/lxml/apihelpers.pxi":287
@@ -22482,7 +22488,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
  *     return sorted(attrib.items())
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 298, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 298, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -22496,7 +22502,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
     }
     __pyx_t_4 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 298, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 298, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_r = __pyx_t_4;
@@ -22520,7 +22526,7 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 300, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrib, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 300, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -22534,15 +22540,15 @@ static PyObject *__pyx_f_4lxml_5etree__iter_attrib(PyObject *__pyx_v_attrib) {
   }
   __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 300, __pyx_L1_error)
+  if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 300, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 300, __pyx_L1_error)
+  __pyx_t_7 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 300, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_t_4 = ((PyObject*)__pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_9 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 300, __pyx_L1_error)
+  __pyx_t_9 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 300, __pyx_L1_error)
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
@@ -22617,7 +22623,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_attrib, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 308, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_v_attrib, __pyx_n_u_items); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 308, __pyx_L1_error)
   __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
@@ -22631,14 +22637,14 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *         return  # nothing to do
  */
     __pyx_t_4 = _fqtypename(__pyx_v_attrib);
-    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 309, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_c_string(__pyx_t_4, 0, strlen(__pyx_t_4), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 309, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_attribute_dictionary, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 309, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_attribute_dictionary, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 309, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_6, 0, 0);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __PYX_ERR(5, 309, __pyx_L1_error)
+    __PYX_ERR(6, 309, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":308
  *     cdef bint is_html
@@ -22656,14 +22662,14 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *         return  # nothing to do
  *     is_html = doc._parser._for_html
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(5, 310, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 310, __pyx_L1_error)
   __pyx_t_3 = ((!__pyx_t_2) != 0);
   if (__pyx_t_3) {
   } else {
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L7_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 310, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 310, __pyx_L1_error)
   __pyx_t_2 = ((!__pyx_t_3) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L7_bool_binop_done:;
@@ -22706,7 +22712,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *     if extra:
  *         if python.PY_VERSION_HEX >= 0x03060000:
  */
-  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 313, __pyx_L1_error)
+  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 313, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_v_seen = ((PyObject*)__pyx_t_6);
   __pyx_t_6 = 0;
@@ -22718,7 +22724,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *         if python.PY_VERSION_HEX >= 0x03060000:
  *             for name, value in extra.items():
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 314, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_extra); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 314, __pyx_L1_error)
   if (__pyx_t_1) {
 
     /* "src/lxml/apihelpers.pxi":315
@@ -22740,17 +22746,17 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  */
       if (unlikely(__pyx_v_extra == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
-        __PYX_ERR(5, 316, __pyx_L1_error)
+        __PYX_ERR(6, 316, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyDict_Items(__pyx_v_extra); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 316, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyDict_Items(__pyx_v_extra); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 316, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       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_7 = 0;
         __pyx_t_8 = NULL;
       } else {
-        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 316, __pyx_L1_error)
+        __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 316, __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(5, 316, __pyx_L1_error)
+        __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 316, __pyx_L1_error)
       }
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       for (;;) {
@@ -22758,17 +22764,17 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           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_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(5, 316, __pyx_L1_error)
+            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(6, 316, __pyx_L1_error)
             #else
-            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 316, __pyx_L1_error)
+            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 316, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             #endif
           } else {
             if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(5, 316, __pyx_L1_error)
+            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_6); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(6, 316, __pyx_L1_error)
             #else
-            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 316, __pyx_L1_error)
+            __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 316, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             #endif
           }
@@ -22778,7 +22784,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(5, 316, __pyx_L1_error)
+              else __PYX_ERR(6, 316, __pyx_L1_error)
             }
             break;
           }
@@ -22790,7 +22796,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           if (unlikely(size != 2)) {
             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            __PYX_ERR(5, 316, __pyx_L1_error)
+            __PYX_ERR(6, 316, __pyx_L1_error)
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
           if (likely(PyTuple_CheckExact(sequence))) {
@@ -22803,15 +22809,15 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_INCREF(__pyx_t_9);
           __Pyx_INCREF(__pyx_t_10);
           #else
-          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 316, __pyx_L1_error)
+          __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 316, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_9);
-          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 316, __pyx_L1_error)
+          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 316, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         } else {
           Py_ssize_t index = -1;
-          __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 316, __pyx_L1_error)
+          __pyx_t_11 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 316, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -22819,7 +22825,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_GOTREF(__pyx_t_9);
           index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
           __Pyx_GOTREF(__pyx_t_10);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(5, 316, __pyx_L1_error)
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(6, 316, __pyx_L1_error)
           __pyx_t_12 = NULL;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           goto __pyx_L14_unpacking_done;
@@ -22827,7 +22833,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           __pyx_t_12 = NULL;
           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          __PYX_ERR(5, 316, __pyx_L1_error)
+          __PYX_ERR(6, 316, __pyx_L1_error)
           __pyx_L14_unpacking_done:;
         }
         __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9);
@@ -22842,7 +22848,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *         else:
  *             for name, value in sorted(extra.items()):
  */
-        __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(5, 317, __pyx_L1_error)
+        __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(6, 317, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":316
  *     if extra:
@@ -22874,28 +22880,28 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
     /*else*/ {
       if (unlikely(__pyx_v_extra == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
-        __PYX_ERR(5, 319, __pyx_L1_error)
+        __PYX_ERR(6, 319, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyDict_Items(__pyx_v_extra); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 319, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyDict_Items(__pyx_v_extra); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 319, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_10 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 319, __pyx_L1_error)
+      __pyx_t_10 = PySequence_List(__pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 319, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_5 = ((PyObject*)__pyx_t_10);
       __pyx_t_10 = 0;
-      __pyx_t_14 = PyList_Sort(__pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(5, 319, __pyx_L1_error)
+      __pyx_t_14 = PyList_Sort(__pyx_t_5); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(6, 319, __pyx_L1_error)
       if (unlikely(__pyx_t_5 == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(5, 319, __pyx_L1_error)
+        __PYX_ERR(6, 319, __pyx_L1_error)
       }
       __pyx_t_10 = __pyx_t_5; __Pyx_INCREF(__pyx_t_10); __pyx_t_7 = 0;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       for (;;) {
         if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_10)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(5, 319, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(6, 319, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 319, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_10, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 319, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
         if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
@@ -22904,7 +22910,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           if (unlikely(size != 2)) {
             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            __PYX_ERR(5, 319, __pyx_L1_error)
+            __PYX_ERR(6, 319, __pyx_L1_error)
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
           if (likely(PyTuple_CheckExact(sequence))) {
@@ -22917,15 +22923,15 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_INCREF(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_9);
           #else
-          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 319, __pyx_L1_error)
+          __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 319, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
-          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 319, __pyx_L1_error)
+          __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 319, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_9);
           #endif
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         } else {
           Py_ssize_t index = -1;
-          __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 319, __pyx_L1_error)
+          __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 319, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -22933,7 +22939,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_GOTREF(__pyx_t_6);
           index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L17_unpacking_failed;
           __Pyx_GOTREF(__pyx_t_9);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(5, 319, __pyx_L1_error)
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(6, 319, __pyx_L1_error)
           __pyx_t_12 = NULL;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           goto __pyx_L18_unpacking_done;
@@ -22941,7 +22947,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           __pyx_t_12 = NULL;
           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          __PYX_ERR(5, 319, __pyx_L1_error)
+          __PYX_ERR(6, 319, __pyx_L1_error)
           __pyx_L18_unpacking_done:;
         }
         __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
@@ -22956,7 +22962,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *     if attrib:
  *         for name, value in _iter_attrib(attrib):
  */
-        __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(5, 320, __pyx_L1_error)
+        __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(6, 320, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":319
  *                 _addAttributeToNode(c_node, doc, is_html, name, value, seen)
@@ -22986,7 +22992,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *         for name, value in _iter_attrib(attrib):
  *             _addAttributeToNode(c_node, doc, is_html, name, value, seen)
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 321, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 321, __pyx_L1_error)
   if (__pyx_t_1) {
 
     /* "src/lxml/apihelpers.pxi":322
@@ -22996,15 +23002,15 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  *             _addAttributeToNode(c_node, doc, is_html, name, value, seen)
  * 
  */
-    __pyx_t_10 = __pyx_f_4lxml_5etree__iter_attrib(__pyx_v_attrib); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 322, __pyx_L1_error)
+    __pyx_t_10 = __pyx_f_4lxml_5etree__iter_attrib(__pyx_v_attrib); if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 322, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_10);
     if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
       __pyx_t_5 = __pyx_t_10; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 322, __pyx_L1_error)
+      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 322, __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(5, 322, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 322, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     for (;;) {
@@ -23012,17 +23018,17 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         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_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(5, 322, __pyx_L1_error)
+          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(6, 322, __pyx_L1_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 322, __pyx_L1_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 322, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         } else {
           if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(5, 322, __pyx_L1_error)
+          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_10); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(6, 322, __pyx_L1_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 322, __pyx_L1_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_10)) __PYX_ERR(6, 322, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         }
@@ -23032,7 +23038,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 322, __pyx_L1_error)
+            else __PYX_ERR(6, 322, __pyx_L1_error)
           }
           break;
         }
@@ -23044,7 +23050,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(5, 322, __pyx_L1_error)
+          __PYX_ERR(6, 322, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -23057,15 +23063,15 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         __Pyx_INCREF(__pyx_t_9);
         __Pyx_INCREF(__pyx_t_6);
         #else
-        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 322, __pyx_L1_error)
+        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 322, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 322, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 322, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 322, __pyx_L1_error)
+        __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 322, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -23073,7 +23079,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         __Pyx_GOTREF(__pyx_t_9);
         index = 1; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L22_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_6);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(5, 322, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(6, 322, __pyx_L1_error)
         __pyx_t_12 = NULL;
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         goto __pyx_L23_unpacking_done;
@@ -23081,7 +23087,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         __pyx_t_12 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(5, 322, __pyx_L1_error)
+        __PYX_ERR(6, 322, __pyx_L1_error)
         __pyx_L23_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9);
@@ -23096,7 +23102,7 @@ static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *__pyx_v_c_nod
  * 
  * 
  */
-      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(5, 323, __pyx_L1_error)
+      __pyx_t_13 = __pyx_f_4lxml_5etree__addAttributeToNode(__pyx_v_c_node, __pyx_v_doc, __pyx_v_is_html, __pyx_v_name, __pyx_v_value, __pyx_v_seen); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(6, 323, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":322
  *                 _addAttributeToNode(c_node, doc, is_html, name, value, seen)
@@ -23181,7 +23187,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *     if tag in seen_tags:
  *         return 0
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 328, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 328, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -23189,7 +23195,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 328, __pyx_L1_error)
+      __PYX_ERR(6, 328, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -23197,13 +23203,13 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 328, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 328, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 328, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 328, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 328, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 328, __pyx_L1_error)
   }
   __pyx_v_ns_utf = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -23222,9 +23228,9 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  */
   if (unlikely(__pyx_v_seen_tags == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(5, 329, __pyx_L1_error)
+    __PYX_ERR(6, 329, __pyx_L1_error)
   }
-  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_seen_tags, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(5, 329, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_seen_tags, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 329, __pyx_L1_error)
   __pyx_t_5 = (__pyx_t_4 != 0);
   if (__pyx_t_5) {
 
@@ -23256,9 +23262,9 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  */
   if (unlikely(__pyx_v_seen_tags == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "add");
-    __PYX_ERR(5, 331, __pyx_L1_error)
+    __PYX_ERR(6, 331, __pyx_L1_error)
   }
-  __pyx_t_6 = PySet_Add(__pyx_v_seen_tags, __pyx_v_tag); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 331, __pyx_L1_error)
+  __pyx_t_6 = PySet_Add(__pyx_v_seen_tags, __pyx_v_tag); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 331, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":332
  *         return 0
@@ -23277,7 +23283,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *     value_utf = _utf8(value)
  *     if ns_utf is None:
  */
-    __pyx_t_7 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 333, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 333, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":332
  *         return 0
@@ -23295,7 +23301,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *     if ns_utf is None:
  *         tree.xmlNewProp(c_node, _xcstr(name_utf), _xcstr(value_utf))
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 334, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 334, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_value_utf = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -23338,7 +23344,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *         tree.xmlNewNsProp(c_node, c_ns,
  */
   /*else*/ {
-    __pyx_t_7 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_ns_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(5, 338, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__uriValidOrRaise(__pyx_v_ns_utf); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(6, 338, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":339
  *     else:
@@ -23347,7 +23353,7 @@ static int __pyx_f_4lxml_5etree__addAttributeToNode(xmlNode *__pyx_v_c_node, str
  *         tree.xmlNewNsProp(c_node, c_ns,
  *                           _xcstr(name_utf), _xcstr(value_utf))
  */
-    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns_utf), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(5, 339, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_doc, __pyx_v_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns_utf), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(6, 339, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_8;
 
     /* "src/lxml/apihelpers.pxi":340
@@ -23581,7 +23587,7 @@ static int __pyx_f_4lxml_5etree__collectNsDefs(xmlNode *__pyx_v_c_element, __pyx
  *             c_ns_list = c_nsref_ptr
  * 
  */
-        PyErr_NoMemory(); __PYX_ERR(5, 369, __pyx_L1_error)
+        PyErr_NoMemory(); __PYX_ERR(6, 369, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":365
  *             c_nsref_ptr = <_ns_node_ref*> python.lxml_realloc(
@@ -23771,7 +23777,7 @@ static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__py
  * 
  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element->parent, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 396, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element->parent, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 396, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":394
  *     cdef size_t i
@@ -23808,7 +23814,7 @@ static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__py
  * 
  *     # remove all namespace declarations from the list that are referenced
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 401, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__collectNsDefs(__pyx_v_c_element, (&__pyx_v_c_ns_list), (&__pyx_v_c_ns_list_len), (&__pyx_v_c_ns_list_size)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 401, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":400
  *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_element, c_element, 1)
@@ -24070,13 +24076,13 @@ static int __pyx_f_4lxml_5etree__removeUnusedNamespaceDeclarations(xmlNode *__py
         __pyx_t_2 = __pyx_t_1;
         goto __pyx_L24_bool_binop_done;
       }
-      __pyx_t_8 = __Pyx_PyBytes_FromCString((__pyx_v_c_ns_list[__pyx_v_i]).ns->prefix); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 429, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyBytes_FromCString((__pyx_v_c_ns_list[__pyx_v_i]).ns->prefix); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 429, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       if (unlikely(__pyx_v_prefixes_to_keep == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(5, 429, __pyx_L1_error)
+        __PYX_ERR(6, 429, __pyx_L1_error)
       }
-      __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_t_8, __pyx_v_prefixes_to_keep, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 429, __pyx_L1_error)
+      __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_t_8, __pyx_v_prefixes_to_keep, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(6, 429, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       __pyx_t_9 = (__pyx_t_1 != 0);
       __pyx_t_2 = __pyx_t_9;
@@ -25002,7 +25008,7 @@ static int __pyx_f_4lxml_5etree__replaceNodeByChildren(struct LxmlDocument *__py
  *             c_child = c_child.next
  * 
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 523, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_doc->_c_doc, __pyx_v_c_child); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 523, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":524
  *         while c_child is not NULL:
@@ -25241,7 +25247,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *__pyx_v_c_element
  *     finally:
  *         tree.xmlFree(value)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 547, __pyx_L4_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 547, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_result = __pyx_t_1;
     __pyx_t_1 = 0;
@@ -25410,7 +25416,7 @@ static PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *__pyx_v
  *     finally:
  *         tree.xmlFree(c_result)
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 558, __pyx_L5_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 558, __pyx_L5_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_result = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -25537,7 +25543,7 @@ static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_
  *     c_href = <const_xmlChar*>NULL if ns is None else _xcstr(ns)
  *     c_result = tree.xmlGetNsProp(c_node, _xcstr(tag), c_href)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 564, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 564, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -25545,7 +25551,7 @@ static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 564, __pyx_L1_error)
+      __PYX_ERR(6, 564, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -25553,14 +25559,14 @@ static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 564, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 564, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 564, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 564, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 564, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 564, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -25638,7 +25644,7 @@ static PyObject *__pyx_f_4lxml_5etree__getNodeAttributeValue(xmlNode *__pyx_v_c_
  *     finally:
  *         tree.xmlFree(c_result)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 571, __pyx_L5_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 571, __pyx_L5_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_result = __pyx_t_1;
     __pyx_t_1 = 0;
@@ -25754,7 +25760,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__getAttributeValue(struct Lx
  * cdef int _setAttributeValue(_Element element, key, value) except -1:
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNodeAttributeValue(__pyx_v_element->_c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 577, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNodeAttributeValue(__pyx_v_element->_c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 577, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -25817,7 +25823,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     is_html = element._doc._parser._for_html
  *     if not is_html:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 582, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 582, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -25825,7 +25831,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 582, __pyx_L1_error)
+      __PYX_ERR(6, 582, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -25833,14 +25839,14 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 582, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 582, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 582, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 582, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 582, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 582, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -25874,7 +25880,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     c_tag = _xcstr(tag)
  *     if value is None and is_html:
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 585, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 585, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":584
  *     ns, tag = _getNsTag(key)
@@ -25951,7 +25957,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *         else:
  *             value = _utf8(value)
  */
-      __pyx_t_1 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 591, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_element, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 591, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
       __pyx_t_1 = 0;
@@ -25974,7 +25980,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     if ns is None:
  */
     /*else*/ {
-      __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 593, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 593, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
       __pyx_t_1 = 0;
@@ -26030,7 +26036,7 @@ static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_e
  *     return 0
  */
   /*else*/ {
-    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(5, 598, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 1); if (unlikely(__pyx_t_8 == ((xmlNs *)NULL))) __PYX_ERR(6, 598, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_8;
   }
   __pyx_L8:;
@@ -26108,7 +26114,7 @@ static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_elemen
  *     c_href = <const_xmlChar*>NULL if ns is None else _xcstr(ns)
  *     if _delAttributeFromNsName(element._c_node, c_href, _xcstr(tag)):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 603, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 603, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -26116,7 +26122,7 @@ static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_elemen
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 603, __pyx_L1_error)
+      __PYX_ERR(6, 603, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -26124,14 +26130,14 @@ static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_elemen
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 603, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 603, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 603, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 603, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 603, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 603, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -26171,7 +26177,7 @@ static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_elemen
  * 
  */
     __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0, 0);
-    __PYX_ERR(5, 606, __pyx_L1_error)
+    __PYX_ERR(6, 606, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":605
  *     ns, tag = _getNsTag(key)
@@ -26412,7 +26418,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *     attributes = [None] * count
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 630, __pyx_L1_error)
+    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 630, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = ((PyObject*)__pyx_t_3);
     __pyx_t_3 = 0;
@@ -26434,7 +26440,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *     c_attr = c_node.properties
  *     count = 0
  */
-  __pyx_t_3 = PyList_New(1 * ((__pyx_v_count<0) ? 0:__pyx_v_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 632, __pyx_L1_error)
+  __pyx_t_3 = PyList_New(1 * ((__pyx_v_count<0) ? 0:__pyx_v_count)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 632, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   { Py_ssize_t __pyx_temp;
     for (__pyx_temp=0; __pyx_temp < __pyx_v_count; __pyx_temp++) {
@@ -26503,7 +26509,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *             elif collecttype == 2:
  *                 item = _attributeValue(c_node, c_attr)
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 638, __pyx_L1_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 638, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
         __pyx_t_3 = 0;
@@ -26525,7 +26531,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *             else:
  *                 item = (_namespacedName(<xmlNode*>c_attr),
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 640, __pyx_L1_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 640, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
         __pyx_t_3 = 0;
@@ -26547,7 +26553,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *                         _attributeValue(c_node, c_attr))
  *             attributes[count] = item
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 642, __pyx_L1_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 642, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
 
         /* "src/lxml/apihelpers.pxi":643
@@ -26557,7 +26563,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *             attributes[count] = item
  *             count += 1
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 643, __pyx_L1_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node, __pyx_v_c_attr); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 643, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
 
         /* "src/lxml/apihelpers.pxi":642
@@ -26567,7 +26573,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *                         _attributeValue(c_node, c_attr))
  *             attributes[count] = item
  */
-        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 642, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 642, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GIVEREF(__pyx_t_3);
         PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
@@ -26587,7 +26593,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node
  *             count += 1
  *         c_attr = c_attr.next
  */
-      if (unlikely(__Pyx_SetItemInt(__pyx_v_attributes, __pyx_v_count, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(5, 644, __pyx_L1_error)
+      if (unlikely(__Pyx_SetItemInt(__pyx_v_attributes, __pyx_v_count, __pyx_v_item, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1) < 0)) __PYX_ERR(6, 644, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":645
  *                         _attributeValue(c_node, c_attr))
@@ -26698,7 +26704,7 @@ static PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *__pyx_
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_g_1_g_2, __pyx_v_xml_string};
-    __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(5, 657, __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(6, 657, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -26706,13 +26712,13 @@ static PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *__pyx_
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_u_g_1_g_2, __pyx_v_xml_string};
-    __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(5, 657, __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(6, 657, __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(5, 657, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 657, __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;
@@ -26723,7 +26729,7 @@ static PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *__pyx_
     __Pyx_INCREF(__pyx_v_xml_string);
     __Pyx_GIVEREF(__pyx_v_xml_string);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_xml_string);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 657, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 657, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -26794,7 +26800,7 @@ static int __pyx_f_4lxml_5etree__hasEncodingDeclaration(PyObject *__pyx_v_xml_st
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_xml_string) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_xml_string);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 661, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 661, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_4 = (__pyx_t_1 != Py_None);
@@ -27067,9 +27073,9 @@ static int __pyx_f_4lxml_5etree__hasNonWhitespaceText(xmlNode *__pyx_v_c_node, s
       __pyx_t_4 = __pyx_t_5;
       goto __pyx_L9_bool_binop_done;
     }
-    __pyx_t_7 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_text_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 677, __pyx_L1_error)
+    __pyx_t_7 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_text_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 677, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isspace); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 677, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_isspace); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 677, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_t_7 = NULL;
@@ -27084,10 +27090,10 @@ static int __pyx_f_4lxml_5etree__hasNonWhitespaceText(xmlNode *__pyx_v_c_node, s
     }
     __pyx_t_6 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 677, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 677, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(5, 677, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 677, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_9 = ((!__pyx_t_5) != 0);
     __pyx_t_4 = __pyx_t_9;
@@ -27323,7 +27329,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
  *     # the rest is not performance critical anymore
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 706, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 706, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_r = __pyx_t_4;
     __pyx_t_4 = 0;
@@ -27366,9 +27372,9 @@ static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
  *         c_node = _textNodeOrSkip(c_node.next)
  *     return funicode(<const_xmlChar*><unsigned char*>result)
  */
-    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_node->content)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 711, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_node->content)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 711, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 711, __pyx_L1_error)
+    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 711, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
@@ -27394,10 +27400,10 @@ static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
   __Pyx_XDECREF(__pyx_r);
   if (unlikely(__pyx_v_result == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
-    __PYX_ERR(5, 713, __pyx_L1_error)
+    __PYX_ERR(6, 713, __pyx_L1_error)
   }
-  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_result); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(5, 713, __pyx_L1_error)
-  __pyx_t_5 = __pyx_f_4lxml_5etree_funicode(((const xmlChar *)((unsigned char *)__pyx_t_6))); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 713, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyBytes_AsWritableUString(__pyx_v_result); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(6, 713, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_funicode(((const xmlChar *)((unsigned char *)__pyx_t_6))); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 713, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_r = __pyx_t_5;
   __pyx_t_5 = 0;
@@ -27589,7 +27595,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createTextNode(xmlDoc *__pyx_v_doc, PyObje
  *     if not c_text_node:
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 735, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_text = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
@@ -27622,7 +27628,7 @@ static xmlNode *__pyx_f_4lxml_5etree__createTextNode(xmlDoc *__pyx_v_doc, PyObje
  *     return c_text_node
  * 
  */
-    PyErr_NoMemory(); __PYX_ERR(5, 738, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(6, 738, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":737
  *         text = _utf8(value)
@@ -27729,7 +27735,7 @@ static int __pyx_f_4lxml_5etree__setNodeText(xmlNode *__pyx_v_c_node, PyObject *
  *     if c_node.children is NULL:
  *         tree.xmlAddChild(c_node, c_text_node)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(5, 747, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(6, 747, __pyx_L1_error)
   __pyx_v_c_text_node = __pyx_t_3;
 
   /* "src/lxml/apihelpers.pxi":748
@@ -27866,7 +27872,7 @@ static int __pyx_f_4lxml_5etree__setTailText(xmlNode *__pyx_v_c_node, PyObject *
  *     tree.xmlAddNextSibling(c_node, c_text_node)
  *     return 0
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(5, 760, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__createTextNode(__pyx_v_c_node->doc, __pyx_v_value); if (unlikely(__pyx_t_3 == ((xmlNode *)NULL))) __PYX_ERR(6, 760, __pyx_L1_error)
   __pyx_v_c_text_node = __pyx_t_3;
 
   /* "src/lxml/apihelpers.pxi":761
@@ -27937,7 +27943,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
  *     if ns is None:
  *         return tag
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 766, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 766, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   if (likely(__pyx_t_1 != Py_None)) {
     PyObject* sequence = __pyx_t_1;
@@ -27945,7 +27951,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(5, 766, __pyx_L1_error)
+      __PYX_ERR(6, 766, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -27953,14 +27959,14 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 766, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 766, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(5, 766, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(6, 766, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -27986,7 +27992,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
  *         c_ns = element._doc._findOrBuildNodeNs(
  */
     __Pyx_XDECREF(__pyx_r);
-    if (!(likely(PyBytes_CheckExact(__pyx_v_tag))||((__pyx_v_tag) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_tag)->tp_name), 0))) __PYX_ERR(5, 768, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_v_tag))||((__pyx_v_tag) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_tag)->tp_name), 0))) __PYX_ERR(6, 768, __pyx_L1_error)
     __Pyx_INCREF(__pyx_v_tag);
     __pyx_r = ((PyObject*)__pyx_v_tag);
     goto __pyx_L0;
@@ -28016,7 +28022,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
  *         return python.PyBytes_FromFormat('%s:%s', c_ns.prefix, _cstr(tag))
  * 
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 0); if (unlikely(__pyx_t_6 == ((xmlNs *)NULL))) __PYX_ERR(5, 770, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs(__pyx_v_element->_doc, __pyx_v_element->_c_node, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_ns), NULL, 0); if (unlikely(__pyx_t_6 == ((xmlNs *)NULL))) __PYX_ERR(6, 770, __pyx_L1_error)
     __pyx_v_c_ns = __pyx_t_6;
 
     /* "src/lxml/apihelpers.pxi":772
@@ -28027,7 +28033,7 @@ static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__py
  * cdef inline bint _hasChild(xmlNode* c_node):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_1 = PyBytes_FromFormat(((char *)"%s:%s"), __pyx_v_c_ns->prefix, PyBytes_AS_STRING(__pyx_v_tag)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 772, __pyx_L1_error)
+    __pyx_t_1 = PyBytes_FromFormat(((char *)"%s:%s"), __pyx_v_c_ns->prefix, PyBytes_AS_STRING(__pyx_v_tag)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 772, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_r = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -28314,7 +28320,7 @@ static int __pyx_f_4lxml_5etree__findChildSlice(PyObject *__pyx_v_sliceobject, x
     /*else*/ {
       __pyx_t_3 = ((PySliceObject*)__pyx_v_sliceobject)->step;
       __Pyx_INCREF(__pyx_t_3);
-      __pyx_t_4 = _PyEval_SliceIndex(__pyx_t_3, __pyx_v_c_step); if (unlikely(__pyx_t_4 == ((int)0))) __PYX_ERR(5, 803, __pyx_L1_error)
+      __pyx_t_4 = _PyEval_SliceIndex(__pyx_t_3, __pyx_v_c_step); if (unlikely(__pyx_t_4 == ((int)0))) __PYX_ERR(6, 803, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     }
     __pyx_L4:;
@@ -28345,7 +28351,7 @@ static int __pyx_f_4lxml_5etree__findChildSlice(PyObject *__pyx_v_sliceobject, x
  *         sliceobject, childcount, &start, &stop, c_step, c_length)
  *     if start > childcount / 2:
  */
-  __pyx_t_4 = _lx_PySlice_GetIndicesEx(__pyx_v_sliceobject, __pyx_v_childcount, (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_c_step, __pyx_v_c_length); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(5, 805, __pyx_L1_error)
+  __pyx_t_4 = _lx_PySlice_GetIndicesEx(__pyx_v_sliceobject, __pyx_v_childcount, (&__pyx_v_start), (&__pyx_v_stop), __pyx_v_c_step, __pyx_v_c_length); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 805, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":807
  *     python.PySlice_GetIndicesEx(
@@ -28552,7 +28558,7 @@ static int __pyx_f_4lxml_5etree__isFullSlice(PyObject *__pyx_v_sliceobject) {
  */
     __pyx_t_4 = ((PySliceObject*)__pyx_v_sliceobject)->step;
     __Pyx_INCREF(__pyx_t_4);
-    __pyx_t_5 = _PyEval_SliceIndex(__pyx_t_4, (&__pyx_v_step)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(5, 823, __pyx_L1_error)
+    __pyx_t_5 = _PyEval_SliceIndex(__pyx_t_4, (&__pyx_v_step)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(6, 823, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/apihelpers.pxi":824
@@ -28661,7 +28667,7 @@ static PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *__pyx
  *     c_node = element._c_node.children
  *     if c_node is not NULL:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 831, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 831, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_result = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -28734,10 +28740,10 @@ static PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *__pyx
  */
       __pyx_t_1 = ((PyObject *)__pyx_v_element->_doc);
       __Pyx_INCREF(__pyx_t_1);
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 837, __pyx_L1_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 837, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 837, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 837, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/apihelpers.pxi":838
@@ -30266,15 +30272,15 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
  */
   if (unlikely(__pyx_v_ns_tags == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(5, 1034, __pyx_L1_error)
+    __PYX_ERR(6, 1034, __pyx_L1_error)
   }
   __pyx_t_1 = __pyx_v_ns_tags; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(5, 1034, __pyx_L1_error)
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(6, 1034, __pyx_L1_error)
     #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1034, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1034, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
@@ -30283,7 +30289,7 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
       if (unlikely(size != 2)) {
         if (size > 2) __Pyx_RaiseTooManyValuesError(2);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(5, 1034, __pyx_L1_error)
+        __PYX_ERR(6, 1034, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -30296,15 +30302,15 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
       __Pyx_INCREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_t_5);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1034, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1034, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1034, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1034, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       #endif
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1034, __pyx_L1_error)
+      __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 1034, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
@@ -30312,7 +30318,7 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
       __Pyx_GOTREF(__pyx_t_4);
       index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_5);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(5, 1034, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(6, 1034, __pyx_L1_error)
       __pyx_t_7 = NULL;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       goto __pyx_L6_unpacking_done;
@@ -30320,11 +30326,11 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(5, 1034, __pyx_L1_error)
+      __PYX_ERR(6, 1034, __pyx_L1_error)
       __pyx_L6_unpacking_done:;
     }
-    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(5, 1034, __pyx_L1_error)
-    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(5, 1034, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(6, 1034, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(6, 1034, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_ns, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
     __Pyx_XDECREF_SET(__pyx_v_tag, ((PyObject*)__pyx_t_5));
@@ -30379,9 +30385,9 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
  */
       if (unlikely(__pyx_v_tag == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-        __PYX_ERR(5, 1038, __pyx_L1_error)
+        __PYX_ERR(6, 1038, __pyx_L1_error)
       }
-      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1038, __pyx_L1_error)
+      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1038, __pyx_L1_error)
       __pyx_v_c_tag = xmlDictLookup(__pyx_v_c_doc->dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag), __pyx_t_10);
 
       /* "src/lxml/apihelpers.pxi":1039
@@ -30423,7 +30429,7 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
  *         else:
  *             c_tag = tree.xmlDictExists(c_doc.dict, _xcstr(tag), len(tag))
  */
-        PyErr_NoMemory(); __PYX_ERR(5, 1043, __pyx_L1_error)
+        PyErr_NoMemory(); __PYX_ERR(6, 1043, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1039
  *         elif force_into_dict:
@@ -30454,9 +30460,9 @@ static Py_ssize_t __pyx_f_4lxml_5etree__mapTagsToQnameMatchArray(xmlDoc *__pyx_v
     /*else*/ {
       if (unlikely(__pyx_v_tag == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-        __PYX_ERR(5, 1045, __pyx_L1_error)
+        __PYX_ERR(6, 1045, __pyx_L1_error)
       }
-      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1045, __pyx_L1_error)
+      __pyx_t_10 = PyBytes_GET_SIZE(__pyx_v_tag); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1045, __pyx_L1_error)
       __pyx_v_c_tag = xmlDictExists(__pyx_v_c_doc->dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_tag), __pyx_t_10);
 
       /* "src/lxml/apihelpers.pxi":1046
@@ -30668,7 +30674,7 @@ static int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *__pyx_v_doc, xm
  *     return 0
  * 
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(5, 1068, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc, __pyx_v_c_node->doc, __pyx_v_c_node); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 1068, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1066
  *     tree.xmlUnlinkNode(c_node)
@@ -31127,7 +31133,7 @@ static int __pyx_f_4lxml_5etree__copyTail(xmlNode *__pyx_v_c_tail, xmlNode *__py
  *         c_target = tree.xmlAddNextSibling(c_target, c_new_tail)
  *         c_tail = _textNodeOrSkip(c_tail.next)
  */
-      PyErr_NoMemory(); __PYX_ERR(5, 1115, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(6, 1115, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1114
  *         else:
@@ -31306,7 +31312,7 @@ static int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *__pyx_v_c_node,
  *             if c_sibling == <xmlNode*>c_node.doc.intSubset:
  *                 c_target.doc.intSubset = <tree.xmlDtd*>c_copy
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree__copyDtd(((xmlDtd *)__pyx_v_c_sibling)); if (unlikely(__pyx_t_4 == ((xmlDtd *)NULL))) __PYX_ERR(5, 1130, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__copyDtd(((xmlDtd *)__pyx_v_c_sibling)); if (unlikely(__pyx_t_4 == ((xmlDtd *)NULL))) __PYX_ERR(6, 1130, __pyx_L1_error)
       __pyx_v_c_copy = ((xmlNode *)__pyx_t_4);
 
       /* "src/lxml/apihelpers.pxi":1131
@@ -31387,7 +31393,7 @@ static int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *__pyx_v_c_node,
  *         tree.xmlAddPrevSibling(c_target, c_copy)
  *         c_sibling = c_sibling.next
  */
-        PyErr_NoMemory(); __PYX_ERR(5, 1138, __pyx_L1_error)
+        PyErr_NoMemory(); __PYX_ERR(6, 1138, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1137
  *         else:
@@ -31507,7 +31513,7 @@ static int __pyx_f_4lxml_5etree__copyNonElementSiblings(xmlNode *__pyx_v_c_node,
  *         tree.xmlAddNextSibling(c_target, c_copy)
  * 
  */
-      PyErr_NoMemory(); __PYX_ERR(5, 1147, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(6, 1147, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1146
  *         c_sibling = c_sibling.next
@@ -31747,7 +31753,7 @@ static int __pyx_f_4lxml_5etree__deleteSlice(struct LxmlDocument *__pyx_v_doc, x
  *         c += 1
  *         c_node = c_next
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(5, 1173, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc, __pyx_v_c_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 1173, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1174
  *                 break
@@ -31845,7 +31851,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_step > 0) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(5, 1193, __pyx_L1_error)
+      __PYX_ERR(6, 1193, __pyx_L1_error)
     }
   }
   #endif
@@ -31919,7 +31925,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  * 
  *     if step != 1 or not left_to_right:
  */
-    __pyx_t_4 = PySequence_List(__pyx_v_elements); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1200, __pyx_L1_error)
+    __pyx_t_4 = PySequence_List(__pyx_v_elements); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1200, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_elements, __pyx_t_4);
     __pyx_t_4 = 0;
@@ -31958,7 +31964,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         if seqlength != slicelength:
  *             raise ValueError, f"attempt to assign sequence of size {seqlength} " \
  */
-    __pyx_t_5 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1204, __pyx_L1_error)
+    __pyx_t_5 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1204, __pyx_L1_error)
     __pyx_v_seqlength = __pyx_t_5;
 
     /* "src/lxml/apihelpers.pxi":1205
@@ -31978,7 +31984,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *                 f"to extended slice of size {slicelength}"
  * 
  */
-      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1206, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1206, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_5 = 0;
       __pyx_t_6 = 127;
@@ -31986,7 +31992,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
       __pyx_t_5 += 35;
       __Pyx_GIVEREF(__pyx_kp_u_attempt_to_assign_sequence_of_si);
       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_attempt_to_assign_sequence_of_si);
-      __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_seqlength, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1206, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_seqlength, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1206, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_7);
@@ -32004,7 +32010,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  * 
  *     if c_node is NULL:
  */
-      __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_slicelength, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1207, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyUnicode_From_Py_ssize_t(__pyx_v_slicelength, 0, ' ', 'd'); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1207, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_7);
@@ -32018,12 +32024,12 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *                 f"to extended slice of size {slicelength}"
  * 
  */
-      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1206, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1206, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_7, 0, 0);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __PYX_ERR(5, 1206, __pyx_L1_error)
+      __PYX_ERR(6, 1206, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1205
  *         # *replacing* children stepwise with list => check size!
@@ -32074,26 +32080,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
         __pyx_t_8 = NULL;
       } else {
-        __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1212, __pyx_L1_error)
+        __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1212, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1212, __pyx_L1_error)
+        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1212, __pyx_L1_error)
       }
       for (;;) {
         if (likely(!__pyx_t_8)) {
           if (likely(PyList_CheckExact(__pyx_t_7))) {
             if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1212, __pyx_L1_error)
+            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1212, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1212, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1212, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           } else {
             if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1212, __pyx_L1_error)
+            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1212, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1212, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1212, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           }
@@ -32103,13 +32109,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(5, 1212, __pyx_L1_error)
+              else __PYX_ERR(6, 1212, __pyx_L1_error)
             }
             break;
           }
           __Pyx_GOTREF(__pyx_t_4);
         }
-        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1212, __pyx_L1_error)
+        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1212, __pyx_L1_error)
         __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_4));
         __pyx_t_4 = 0;
 
@@ -32125,7 +32131,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
           if (unlikely(!(__pyx_t_2 != 0))) {
             PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-            __PYX_ERR(5, 1213, __pyx_L1_error)
+            __PYX_ERR(6, 1213, __pyx_L1_error)
           }
         }
         #endif
@@ -32137,7 +32143,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         else:
  *             for element in elements:
  */
-        __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1214, __pyx_L1_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1214, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1212
  *         # no children yet => add all elements straight away
@@ -32171,26 +32177,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
         __pyx_t_8 = NULL;
       } else {
-        __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1216, __pyx_L1_error)
+        __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1216, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1216, __pyx_L1_error)
+        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1216, __pyx_L1_error)
       }
       for (;;) {
         if (likely(!__pyx_t_8)) {
           if (likely(PyList_CheckExact(__pyx_t_7))) {
             if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1216, __pyx_L1_error)
+            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1216, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1216, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1216, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           } else {
             if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1216, __pyx_L1_error)
+            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1216, __pyx_L1_error)
             #else
-            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1216, __pyx_L1_error)
+            __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1216, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_4);
             #endif
           }
@@ -32200,13 +32206,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(5, 1216, __pyx_L1_error)
+              else __PYX_ERR(6, 1216, __pyx_L1_error)
             }
             break;
           }
           __Pyx_GOTREF(__pyx_t_4);
         }
-        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1216, __pyx_L1_error)
+        if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1216, __pyx_L1_error)
         __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_4));
         __pyx_t_4 = 0;
 
@@ -32222,7 +32228,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
           if (unlikely(!(__pyx_t_2 != 0))) {
             PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-            __PYX_ERR(5, 1217, __pyx_L1_error)
+            __PYX_ERR(6, 1217, __pyx_L1_error)
           }
         }
         #endif
@@ -32234,7 +32240,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *         return 0
  * 
  */
-        __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1218, __pyx_L1_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1218, __pyx_L1_error)
 
         /* "src/lxml/apihelpers.pxi":1216
  *                 _appendChild(parent, element)
@@ -32405,7 +32411,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  */
     __pyx_t_7 = ((PyObject *)__pyx_v_parent->_doc);
     __Pyx_INCREF(__pyx_t_7);
-    __pyx_t_9 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1240, __pyx_L1_error)
+    __pyx_t_9 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlDocument *)__pyx_t_7), __pyx_v_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1240, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
     /* "src/lxml/apihelpers.pxi":1241
@@ -32434,7 +32440,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  * 
  *     # find the first node right of the new insertion point
  */
-  __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1245, __pyx_L1_error)
+  __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1245, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF_SET(__pyx_v_elements, __pyx_t_7);
   __pyx_t_7 = 0;
@@ -32521,26 +32527,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
       __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1257, __pyx_L1_error)
+      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1257, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1257, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1257, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_7))) {
           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1257, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1257, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1257, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1257, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1257, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1257, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1257, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1257, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -32550,13 +32556,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 1257, __pyx_L1_error)
+            else __PYX_ERR(6, 1257, __pyx_L1_error)
           }
           break;
         }
         __Pyx_GOTREF(__pyx_t_4);
       }
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1257, __pyx_L1_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1257, __pyx_L1_error)
       __pyx_v_element = ((struct LxmlElement *)__pyx_t_4);
       __pyx_t_4 = 0;
 
@@ -32572,7 +32578,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
         if (unlikely(!(__pyx_t_2 != 0))) {
           PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-          __PYX_ERR(5, 1258, __pyx_L1_error)
+          __PYX_ERR(6, 1258, __pyx_L1_error)
         }
       }
       #endif
@@ -32584,7 +32590,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             c_node = element._c_node
  *             if slicelength > 0:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1259, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1259, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1260
  *             assert element is not None, u"Node must not be None"
@@ -32766,26 +32772,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
       __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1278, __pyx_L1_error)
+      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1278, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1278, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1278, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_7))) {
           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1278, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1278, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1278, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1278, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1278, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1278, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1278, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1278, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -32795,13 +32801,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 1278, __pyx_L1_error)
+            else __PYX_ERR(6, 1278, __pyx_L1_error)
           }
           break;
         }
         __Pyx_GOTREF(__pyx_t_4);
       }
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1278, __pyx_L1_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1278, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_4));
       __pyx_t_4 = 0;
 
@@ -32817,7 +32823,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
         if (unlikely(!(__pyx_t_2 != 0))) {
           PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-          __PYX_ERR(5, 1279, __pyx_L1_error)
+          __PYX_ERR(6, 1279, __pyx_L1_error)
         }
       }
       #endif
@@ -32829,7 +32835,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             # move element and tail over
  *             c_source_doc = element._c_node.doc
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1280, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1280, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1282
  *             _assertValidNode(element)
@@ -32878,7 +32884,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  */
       __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
       __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_9 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1288, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_element->_c_node); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1288, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/apihelpers.pxi":1291
@@ -33050,26 +33056,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
       __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1305, __pyx_L1_error)
+      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1305, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1305, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1305, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_7))) {
           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1305, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1305, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1305, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1305, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1305, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1305, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1305, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1305, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -33079,13 +33085,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 1305, __pyx_L1_error)
+            else __PYX_ERR(6, 1305, __pyx_L1_error)
           }
           break;
         }
         __Pyx_GOTREF(__pyx_t_4);
       }
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1305, __pyx_L1_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1305, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_4));
       __pyx_t_4 = 0;
 
@@ -33101,7 +33107,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
         if (unlikely(!(__pyx_t_2 != 0))) {
           PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-          __PYX_ERR(5, 1306, __pyx_L1_error)
+          __PYX_ERR(6, 1306, __pyx_L1_error)
         }
       }
       #endif
@@ -33113,7 +33119,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             _appendChild(parent, element)
  *     else:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1307, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1307, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1308
  *             assert element is not None, u"Node must not be None"
@@ -33122,7 +33128,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *     else:
  *         for element in elements:
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1308, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1308, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1305
  *     # append the remaining elements at the respective end
@@ -33156,26 +33162,26 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
       __pyx_t_7 = __pyx_v_elements; __Pyx_INCREF(__pyx_t_7); __pyx_t_5 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 1310, __pyx_L1_error)
+      __pyx_t_5 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 1310, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1310, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1310, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_8)) {
         if (likely(PyList_CheckExact(__pyx_t_7))) {
           if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1310, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1310, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1310, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1310, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(5, 1310, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(6, 1310, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1310, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1310, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -33185,13 +33191,13 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(5, 1310, __pyx_L1_error)
+            else __PYX_ERR(6, 1310, __pyx_L1_error)
           }
           break;
         }
         __Pyx_GOTREF(__pyx_t_4);
       }
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(5, 1310, __pyx_L1_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 1310, __pyx_L1_error)
       __Pyx_XDECREF_SET(__pyx_v_element, ((struct LxmlElement *)__pyx_t_4));
       __pyx_t_4 = 0;
 
@@ -33207,7 +33213,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
         __pyx_t_2 = (((PyObject *)__pyx_v_element) != Py_None);
         if (unlikely(!(__pyx_t_2 != 0))) {
           PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Node_must_not_be_None);
-          __PYX_ERR(5, 1311, __pyx_L1_error)
+          __PYX_ERR(6, 1311, __pyx_L1_error)
         }
       }
       #endif
@@ -33219,7 +33225,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  *             _prependChild(parent, element)
  * 
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1312, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidNode(__pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1312, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1313
  *             assert element is not None, u"Node must not be None"
@@ -33228,7 +33234,7 @@ static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *__pyx_v_parent
  * 
  *     return 0
  */
-      __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(5, 1313, __pyx_L1_error)
+      __pyx_t_9 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(6, 1313, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1310
  *             _appendChild(parent, element)
@@ -33302,7 +33308,7 @@ static int __pyx_f_4lxml_5etree__linkChild(xmlNode *__pyx_v_c_parent, xmlNode *_
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!(_isElement(__pyx_v_c_node) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(5, 1321, __pyx_L1_error)
+      __PYX_ERR(6, 1321, __pyx_L1_error)
     }
   }
   #endif
@@ -33474,11 +33480,11 @@ static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent,
  *     # store possible text node
  *     c_next = c_node.next
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1341, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1341, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(5, 1341, __pyx_L1_error)
+    __PYX_ERR(6, 1341, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1340
  *     c_source_doc = c_node.doc
@@ -33515,7 +33521,7 @@ static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent,
  *     _moveTail(c_next, c_node)
  *     # uh oh, elements may be pointing to different doc when
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__linkChild(__pyx_v_parent->_c_node, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1347, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__linkChild(__pyx_v_parent->_c_node, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1347, __pyx_L1_error)
 
   /* "src/lxml/apihelpers.pxi":1348
  *     # do not call xmlAddChild() here since it would deep-traverse the tree
@@ -33535,7 +33541,7 @@ static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent,
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1351, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1351, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1352
@@ -33628,11 +33634,11 @@ static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent
  *     # store possible text node
  *     c_next = c_node.next
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1361, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1361, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(5, 1361, __pyx_L1_error)
+    __PYX_ERR(6, 1361, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1360
  *     c_source_doc = c_node.doc
@@ -33688,7 +33694,7 @@ static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent
  *     else:
  *         tree.xmlAddPrevSibling(c_child, c_node)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__linkChild(__pyx_v_parent->_c_node, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1369, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__linkChild(__pyx_v_parent->_c_node, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1369, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1366
  *     # move node itself
@@ -33730,7 +33736,7 @@ static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_parent->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1375, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1375, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1376
@@ -33785,7 +33791,7 @@ static int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *__pyx_v_eleme
  * 
  * cdef int _prependSibling(_Element element, _Element sibling) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1381, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 1); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1381, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -33830,7 +33836,7 @@ static int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *__pyx_v_elem
  * 
  * cdef int _addSibling(_Element element, _Element sibling, bint as_next) except -1:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(5, 1386, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__addSibling(__pyx_v_element, __pyx_v_sibling, 0); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 1386, __pyx_L1_error)
   __pyx_r = __pyx_t_1;
   goto __pyx_L0;
 
@@ -33941,11 +33947,11 @@ static int __pyx_f_4lxml_5etree__addSibling(struct LxmlElement *__pyx_v_element,
  *     # store possible text node
  *     c_next = c_node.next
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1395, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1395, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(5, 1395, __pyx_L1_error)
+    __PYX_ERR(6, 1395, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1392
  *     c_source_doc = c_node.doc
@@ -34025,7 +34031,7 @@ static int __pyx_f_4lxml_5etree__addSibling(struct LxmlElement *__pyx_v_element,
  */
   __pyx_t_4 = ((PyObject *)__pyx_v_element->_doc);
   __Pyx_INCREF(__pyx_t_4);
-  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(5, 1406, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_source_doc, __pyx_v_c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 1406, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
   /* "src/lxml/apihelpers.pxi":1407
@@ -34207,7 +34213,7 @@ static int __pyx_f_4lxml_5etree_isutf8l(const xmlChar *__pyx_v_s, size_t __pyx_v
   __pyx_t_1 = (sizeof(unsigned long));
   if (unlikely(__pyx_t_1 == 0)) {
     PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
-    __PYX_ERR(5, 1426, __pyx_L1_error)
+    __PYX_ERR(6, 1426, __pyx_L1_error)
   }
   __pyx_v_end = (__pyx_v_lptr + (__pyx_v_length / __pyx_t_1));
 
@@ -34263,7 +34269,7 @@ static int __pyx_f_4lxml_5etree_isutf8l(const xmlChar *__pyx_v_s, size_t __pyx_v
       __pyx_t_1 = (sizeof(unsigned long));
       if (unlikely(__pyx_t_1 == 0)) {
         PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
-        __PYX_ERR(5, 1434, __pyx_L1_error)
+        __PYX_ERR(6, 1434, __pyx_L1_error)
       }
       __pyx_t_5 = ((((size_t)__pyx_v_s) % __pyx_t_1) != 0);
       if (__pyx_t_5) {
@@ -34403,7 +34409,7 @@ static int __pyx_f_4lxml_5etree_isutf8l(const xmlChar *__pyx_v_s, size_t __pyx_v
     __pyx_t_1 = (sizeof(unsigned long));
     if (unlikely(__pyx_t_1 == 0)) {
       PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
-      __PYX_ERR(5, 1447, __pyx_L1_error)
+      __PYX_ERR(6, 1447, __pyx_L1_error)
     }
     __pyx_t_2 = ((__pyx_v_s < (((const xmlChar *)__pyx_v_end) + (__pyx_v_length % __pyx_t_1))) != 0);
     if (!__pyx_t_2) break;
@@ -34506,7 +34512,7 @@ static int __pyx_f_4lxml_5etree__is_valid_xml_ascii(PyObject *__pyx_v_pystring)
  */
   if (unlikely(__pyx_v_pystring == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
-    __PYX_ERR(5, 1459, __pyx_L1_error)
+    __PYX_ERR(6, 1459, __pyx_L1_error)
   }
   __Pyx_INCREF(__pyx_v_pystring);
   __pyx_t_1 = __pyx_v_pystring;
@@ -34616,9 +34622,9 @@ static int __pyx_f_4lxml_5etree__is_valid_xml_utf8(PyObject *__pyx_v_pystring) {
  */
   if (unlikely(__pyx_v_pystring == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(5, 1467, __pyx_L1_error)
+    __PYX_ERR(6, 1467, __pyx_L1_error)
   }
-  __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_pystring); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1467, __pyx_L1_error)
+  __pyx_t_1 = PyBytes_GET_SIZE(__pyx_v_pystring); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1467, __pyx_L1_error)
   __pyx_v_c_end = (__pyx_v_s + __pyx_t_1);
 
   /* "src/lxml/apihelpers.pxi":1468
@@ -34915,7 +34921,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree_funicodeOrNone(const xmlChar
  */
   __Pyx_XDECREF(__pyx_r);
   if (((__pyx_v_s != NULL) != 0)) {
-    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1496, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1496, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_1 = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -34974,7 +34980,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree_funicodeOrEmpty(const xmlCha
  */
   __Pyx_XDECREF(__pyx_r);
   if (((__pyx_v_s != NULL) != 0)) {
-    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1499, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1499, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_1 = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -35045,7 +35051,7 @@ static PyObject *__pyx_f_4lxml_5etree_funicode(const xmlChar *__pyx_v_s) {
  *     is_non_ascii = 0
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, strlen(((char const *)__pyx_v_s)), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1506, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, strlen(((char const *)__pyx_v_s)), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -35192,7 +35198,7 @@ static PyObject *__pyx_f_4lxml_5etree_funicode(const xmlChar *__pyx_v_s) {
  * 
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_slen, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1518, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_slen, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1518, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -35215,7 +35221,7 @@ static PyObject *__pyx_f_4lxml_5etree_funicode(const xmlChar *__pyx_v_s) {
  * cdef bytes _utf8(object s):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_s) + 0, __pyx_v_slen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1519, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_s) + 0, __pyx_v_slen - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1519, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject*)__pyx_t_2));
   __pyx_r = __pyx_t_2;
@@ -35334,9 +35340,9 @@ static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
  */
     if (unlikely(__pyx_v_s == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
-      __PYX_ERR(5, 1532, __pyx_L1_error)
+      __PYX_ERR(6, 1532, __pyx_L1_error)
     }
-    __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_s)); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1532, __pyx_L1_error)
+    __pyx_t_4 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_s)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1532, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_utf8_string = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
@@ -35388,7 +35394,7 @@ static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
  *         valid = _is_valid_xml_ascii(utf8_string)
  *     else:
  */
-    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1535, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1535, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_utf8_string = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
@@ -35420,17 +35426,17 @@ static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
  *         raise ValueError(
  */
   /*else*/ {
-    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_s)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1538, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_s)), __pyx_n_s_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1538, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Argument_must_be_bytes_or_unicod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1538, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Argument_must_be_bytes_or_unicod, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1538, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1538, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1538, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(5, 1538, __pyx_L1_error)
+    __PYX_ERR(6, 1538, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -35451,11 +35457,11 @@ static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
  *             "All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters")
  *     return utf8_string
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1540, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1540, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(5, 1540, __pyx_L1_error)
+    __PYX_ERR(6, 1540, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1539
  *     else:
@@ -35528,7 +35534,7 @@ static PyObject *__pyx_f_4lxml_5etree__utf8orNone(PyObject *__pyx_v_s) {
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_2 = (__pyx_v_s != Py_None);
   if ((__pyx_t_2 != 0)) {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1546, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1546, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -35589,7 +35595,7 @@ static PyObject *__pyx_f_4lxml_5etree_strrepr(PyObject *__pyx_v_s) {
  */
   __Pyx_XDECREF(__pyx_r);
   if ((IS_PYTHON2 != 0)) {
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1553, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_s, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1553, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -35603,7 +35609,7 @@ static PyObject *__pyx_f_4lxml_5etree_strrepr(PyObject *__pyx_v_s) {
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_unicode_escape) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_unicode_escape);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1553, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1553, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_t_1 = __pyx_t_2;
@@ -35985,9 +35991,9 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  */
     if (unlikely(__pyx_v_filename == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
-      __PYX_ERR(5, 1593, __pyx_L1_error)
+      __PYX_ERR(6, 1593, __pyx_L1_error)
     }
-    __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1593, __pyx_L1_error)
+    __pyx_t_3 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1593, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_v_filename8 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -35999,7 +36005,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  *             try:
  *                 return python.PyUnicode_AsEncodedString(
  */
-    __pyx_t_4 = __Pyx_PyObject_AsWritableUString(__pyx_v_filename8); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(5, 1594, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_AsWritableUString(__pyx_v_filename8); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(6, 1594, __pyx_L1_error)
     __pyx_t_2 = (__pyx_f_4lxml_5etree__isFilePath(((unsigned char *)__pyx_t_4)) != 0);
     if (__pyx_t_2) {
 
@@ -36035,7 +36041,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  *             except UnicodeEncodeError:
  *                 pass
  */
-          __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_filename, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1596, __pyx_L5_error)
+          __pyx_t_3 = PyUnicode_AsEncodedString(__pyx_v_filename, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1596, __pyx_L5_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_r = __pyx_t_3;
           __pyx_t_3 = 0;
@@ -36130,11 +36136,11 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename
  * cdef object _decodeFilename(const_xmlChar* c_path):
  */
   /*else*/ {
-    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1602, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1602, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1602, __pyx_L1_error)
+    __PYX_ERR(6, 1602, __pyx_L1_error)
   }
 
   /* "src/lxml/apihelpers.pxi":1585
@@ -36182,7 +36188,7 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilename(const xmlChar *__pyx_v_c_p
  * cdef object _decodeFilenameWithLength(const_xmlChar* c_path, size_t c_len):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__decodeFilenameWithLength(__pyx_v_c_path, xmlStrlen(__pyx_v_c_path)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1607, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__decodeFilenameWithLength(__pyx_v_c_path, xmlStrlen(__pyx_v_c_path)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1607, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -36274,7 +36280,7 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  *         except UnicodeDecodeError:
  *             pass
  */
-        __pyx_t_5 = PyUnicode_Decode(((const char *)__pyx_v_c_path), __pyx_v_c_len, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1614, __pyx_L4_error)
+        __pyx_t_5 = PyUnicode_Decode(((const char *)__pyx_v_c_path), __pyx_v_c_len, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1614, __pyx_L4_error)
         __Pyx_GOTREF(__pyx_t_5);
         __pyx_r = __pyx_t_5;
         __pyx_t_5 = 0;
@@ -36364,7 +36370,7 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  *         # this is a stupid fallback, but it might still work...
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_5 = __Pyx_decode_c_string(((char const *)((unsigned char *)__pyx_v_c_path)), 0, __pyx_v_c_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1619, __pyx_L10_error)
+      __pyx_t_5 = __Pyx_decode_c_string(((char const *)((unsigned char *)__pyx_v_c_path)), 0, __pyx_v_c_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1619, __pyx_L10_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_r = __pyx_t_5;
       __pyx_t_5 = 0;
@@ -36391,7 +36397,7 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.etree._decodeFilenameWithLength", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(5, 1620, __pyx_L12_except_error)
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(6, 1620, __pyx_L12_except_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_8);
@@ -36404,7 +36410,7 @@ static PyObject *__pyx_f_4lxml_5etree__decodeFilenameWithLength(const xmlChar *_
  * cdef object _encodeFilenameUTF8(object filename):
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_9 = __Pyx_decode_c_string(((char const *)((unsigned char *)__pyx_v_c_path)), 0, __pyx_v_c_len, NULL, ((char const *)"replace"), PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 1622, __pyx_L12_except_error)
+      __pyx_t_9 = __Pyx_decode_c_string(((char const *)((unsigned char *)__pyx_v_c_path)), 0, __pyx_v_c_len, NULL, ((char const *)"replace"), PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 1622, __pyx_L12_except_error)
       __Pyx_GOTREF(__pyx_t_9);
       __pyx_r = __pyx_t_9;
       __pyx_t_9 = 0;
@@ -36551,14 +36557,14 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  */
     if (unlikely(__pyx_v_filename == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
-      __PYX_ERR(5, 1632, __pyx_L1_error)
+      __PYX_ERR(6, 1632, __pyx_L1_error)
     }
-    __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(5, 1632, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyBytes_AsUString(__pyx_v_filename); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(6, 1632, __pyx_L1_error)
     if (unlikely(__pyx_v_filename == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(5, 1632, __pyx_L1_error)
+      __PYX_ERR(6, 1632, __pyx_L1_error)
     }
-    __pyx_t_4 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1632, __pyx_L1_error)
+    __pyx_t_4 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1632, __pyx_L1_error)
     __pyx_t_1 = ((!(__pyx_f_4lxml_5etree_isutf8l(__pyx_t_3, __pyx_t_4) != 0)) != 0);
     if (__pyx_t_1) {
 
@@ -36617,9 +36623,9 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  */
         if (unlikely(__pyx_v_filename == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-          __PYX_ERR(5, 1639, __pyx_L5_error)
+          __PYX_ERR(6, 1639, __pyx_L5_error)
         }
-        __pyx_t_4 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1639, __pyx_L5_error)
+        __pyx_t_4 = PyBytes_GET_SIZE(((PyObject*)__pyx_v_filename)); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1639, __pyx_L5_error)
 
         /* "src/lxml/apihelpers.pxi":1638
  *         try:
@@ -36628,7 +36634,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *                 c_filename, len(<bytes>filename),
  *                 _C_FILENAME_ENCODING, NULL)
  */
-        __pyx_t_8 = PyUnicode_Decode(__pyx_v_c_filename, __pyx_t_4, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 1638, __pyx_L5_error)
+        __pyx_t_8 = PyUnicode_Decode(__pyx_v_c_filename, __pyx_t_4, __pyx_v_4lxml_5etree__C_FILENAME_ENCODING, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 1638, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF_SET(__pyx_v_filename, __pyx_t_8);
         __pyx_t_8 = 0;
@@ -36658,7 +36664,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
       __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
       if (__pyx_t_9) {
         __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(5, 1641, __pyx_L7_except_error)
+        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_10, &__pyx_t_11) < 0) __PYX_ERR(6, 1641, __pyx_L7_except_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_GOTREF(__pyx_t_11);
@@ -36690,9 +36696,9 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  */
             if (unlikely(__pyx_v_filename == Py_None)) {
               PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-              __PYX_ERR(5, 1644, __pyx_L13_error)
+              __PYX_ERR(6, 1644, __pyx_L13_error)
             }
-            __pyx_t_15 = __Pyx_decode_bytes(((PyObject*)__pyx_v_filename), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 1644, __pyx_L13_error)
+            __pyx_t_15 = __Pyx_decode_bytes(((PyObject*)__pyx_v_filename), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_15)) __PYX_ERR(6, 1644, __pyx_L13_error)
             __Pyx_GOTREF(__pyx_t_15);
             __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
 
@@ -36732,7 +36738,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
           __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
           if (__pyx_t_9) {
             __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8", __pyx_clineno, __pyx_lineno, __pyx_filename);
-            if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0) __PYX_ERR(5, 1646, __pyx_L15_except_error)
+            if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17) < 0) __PYX_ERR(6, 1646, __pyx_L15_except_error)
             __Pyx_GOTREF(__pyx_t_15);
             __Pyx_GOTREF(__pyx_t_16);
             __Pyx_GOTREF(__pyx_t_17);
@@ -36745,7 +36751,7 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  *         return (<unicode>filename).encode('utf8')
  */
             __Pyx_Raise(__pyx_v_decode_exc, 0, 0, 0);
-            __PYX_ERR(5, 1647, __pyx_L15_except_error)
+            __PYX_ERR(6, 1647, __pyx_L15_except_error)
           }
           goto __pyx_L15_except_error;
           __pyx_L15_except_error:;
@@ -36824,9 +36830,9 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
     __Pyx_XDECREF(__pyx_r);
     if (unlikely(__pyx_v_filename == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "encode");
-      __PYX_ERR(5, 1649, __pyx_L1_error)
+      __PYX_ERR(6, 1649, __pyx_L1_error)
     }
-    __pyx_t_11 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1649, __pyx_L1_error)
+    __pyx_t_11 = PyUnicode_AsUTF8String(((PyObject*)__pyx_v_filename)); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1649, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __pyx_r = __pyx_t_11;
     __pyx_t_11 = 0;
@@ -36849,11 +36855,11 @@ static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_file
  * cdef tuple _getNsTag(tag):
  */
   /*else*/ {
-    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 1651, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(6, 1651, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __Pyx_Raise(__pyx_t_11, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __PYX_ERR(5, 1651, __pyx_L1_error)
+    __PYX_ERR(6, 1651, __pyx_L1_error)
   }
 
   /* "src/lxml/apihelpers.pxi":1624
@@ -36907,7 +36913,7 @@ static PyObject *__pyx_f_4lxml_5etree__getNsTag(PyObject *__pyx_v_tag) {
  * cdef tuple _getNsTagWithEmptyNs(tag):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree___getNsTag(__pyx_v_tag, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1657, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree___getNsTag(__pyx_v_tag, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1657, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -36957,7 +36963,7 @@ static PyObject *__pyx_f_4lxml_5etree__getNsTagWithEmptyNs(PyObject *__pyx_v_tag
  * cdef tuple __getNsTag(tag, bint empty_ns):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree___getNsTag(__pyx_v_tag, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1664, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree___getNsTag(__pyx_v_tag, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1664, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -37066,7 +37072,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  *     c_tag = _cstr(tag)
  *     if c_tag[0] == c'{':
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1675, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1675, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_4);
   __pyx_t_4 = 0;
@@ -37126,7 +37132,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  *         taglen = python.PyBytes_GET_SIZE(tag) - nslen - 2
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Invalid_tag_name, 0, 0);
-      __PYX_ERR(5, 1681, __pyx_L1_error)
+      __PYX_ERR(6, 1681, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1680
  *         c_tag += 1
@@ -37173,7 +37179,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  *             ns = <bytes>c_tag[:nslen]
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Empty_tag_name, 0, 0);
-      __PYX_ERR(5, 1685, __pyx_L1_error)
+      __PYX_ERR(6, 1685, __pyx_L1_error)
 
       /* "src/lxml/apihelpers.pxi":1684
  *         nslen  = c_ns_end - c_tag
@@ -37201,7 +37207,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  *         elif empty_ns:
  *             ns = b''
  */
-      __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_tag + 0, __pyx_v_nslen - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1687, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_tag + 0, __pyx_v_nslen - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1687, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_5 = __pyx_t_4;
       __Pyx_INCREF(__pyx_t_5);
@@ -37256,7 +37262,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  *     elif python.PyBytes_GET_SIZE(tag) == 0:
  *         raise ValueError, u"Empty tag name"
  */
-    __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_ns_end + 1, (__pyx_v_taglen + 1) - 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1690, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_c_ns_end + 1, (__pyx_v_taglen + 1) - 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1690, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_4 = __pyx_t_5;
     __Pyx_INCREF(__pyx_t_4);
@@ -37292,7 +37298,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  * 
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Empty_tag_name, 0, 0);
-    __PYX_ERR(5, 1692, __pyx_L1_error)
+    __PYX_ERR(6, 1692, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1691
  *             ns = b''
@@ -37312,7 +37318,7 @@ static PyObject *__pyx_f_4lxml_5etree___getNsTag(PyObject *__pyx_v_tag, int __py
  * cdef inline int _pyXmlNameIsValid(name_utf8):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1693, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1693, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(__pyx_v_ns);
   __Pyx_GIVEREF(__pyx_v_ns);
@@ -37378,7 +37384,7 @@ static CYTHON_INLINE int __pyx_f_4lxml_5etree__pyXmlNameIsValid(PyObject *__pyx_
     __pyx_t_1 = __pyx_t_2;
     goto __pyx_L3_bool_binop_done;
   }
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__17, __pyx_v_name_utf8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(5, 1696, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__17, __pyx_v_name_utf8, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 1696, __pyx_L1_error)
   __pyx_t_1 = __pyx_t_3;
   __pyx_L3_bool_binop_done:;
   __pyx_r = __pyx_t_1;
@@ -37904,22 +37910,22 @@ static int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *__pyx_v_tag_utf) {
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(5, 1734, __pyx_L1_error)
+      __PYX_ERR(6, 1734, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1734, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1734, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_tag_name_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1734, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_tag_name_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1734, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1734, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1734, __pyx_L1_error)
+    __PYX_ERR(6, 1734, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1733
  * 
@@ -37997,22 +38003,22 @@ static int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *__pyx_v_tag_utf)
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(5, 1739, __pyx_L1_error)
+      __PYX_ERR(6, 1739, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1739, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1739, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_HTML_tag_name, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1739, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_HTML_tag_name, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1739, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1739, __pyx_L1_error)
+    __PYX_ERR(6, 1739, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1738
  * 
@@ -38090,22 +38096,22 @@ static int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *__pyx_v_name_ut
  */
     if (unlikely(__pyx_v_name_utf == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(5, 1744, __pyx_L1_error)
+      __PYX_ERR(6, 1744, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_name_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1744, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_name_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1744, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1744, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1744, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_attribute_name, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1744, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_attribute_name, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1744, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1744, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1744, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1744, __pyx_L1_error)
+    __PYX_ERR(6, 1744, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1743
  * 
@@ -38183,22 +38189,22 @@ static int __pyx_f_4lxml_5etree__prefixValidOrRaise(PyObject *__pyx_v_tag_utf) {
  */
     if (unlikely(__pyx_v_tag_utf == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(5, 1749, __pyx_L1_error)
+      __PYX_ERR(6, 1749, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1749, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_tag_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1749, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_namespace_prefix, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1749, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_namespace_prefix, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1749, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1749, __pyx_L1_error)
+    __PYX_ERR(6, 1749, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1748
  * 
@@ -38286,22 +38292,22 @@ static int __pyx_f_4lxml_5etree__uriValidOrRaise(PyObject *__pyx_v_uri_utf) {
  */
     if (unlikely(__pyx_v_uri_utf == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(5, 1755, __pyx_L1_error)
+      __PYX_ERR(6, 1755, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_uri_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1755, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_uri_utf), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1755, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_namespace_URI, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1755, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_namespace_URI, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1755, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(5, 1755, __pyx_L1_error)
+    __PYX_ERR(6, 1755, __pyx_L1_error)
 
     /* "src/lxml/apihelpers.pxi":1754
  * cdef int _uriValidOrRaise(uri_utf) except -1:
@@ -38375,7 +38381,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__namespacedName(xmlNode *__p
  * cdef object _namespacedNameFromNsName(const_xmlChar* href, const_xmlChar* name):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(_getNs(__pyx_v_c_node), __pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 1760, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(_getNs(__pyx_v_c_node), __pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 1760, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -38440,7 +38446,7 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
  *         return python.PyUnicode_FromFormat("{%s}%s", href, name)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1764, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1764, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -38493,7 +38499,7 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
  *         s = python.PyBytes_FromFormat("{%s}%s", href, name)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyUnicode_FromFormat(((char *)"{%s}%s"), __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1766, __pyx_L1_error)
+    __pyx_t_2 = PyUnicode_FromFormat(((char *)"{%s}%s"), __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1766, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -38516,7 +38522,7 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
  *             return (<bytes>s).decode('utf8')
  */
   /*else*/ {
-    __pyx_t_2 = PyBytes_FromFormat(((char *)"{%s}%s"), __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1768, __pyx_L1_error)
+    __pyx_t_2 = PyBytes_FromFormat(((char *)"{%s}%s"), __pyx_v_href, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1768, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_s = ((PyObject*)__pyx_t_2);
     __pyx_t_2 = 0;
@@ -38542,14 +38548,14 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
     }
     if (unlikely(__pyx_v_s == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
-      __PYX_ERR(5, 1769, __pyx_L1_error)
+      __PYX_ERR(6, 1769, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_PyBytes_AsUString(__pyx_v_s); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(5, 1769, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBytes_AsUString(__pyx_v_s); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(6, 1769, __pyx_L1_error)
     if (unlikely(__pyx_v_s == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(5, 1769, __pyx_L1_error)
+      __PYX_ERR(6, 1769, __pyx_L1_error)
     }
-    __pyx_t_5 = PyBytes_GET_SIZE(__pyx_v_s); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(5, 1769, __pyx_L1_error)
+    __pyx_t_5 = PyBytes_GET_SIZE(__pyx_v_s); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(6, 1769, __pyx_L1_error)
     __pyx_t_3 = (__pyx_f_4lxml_5etree_isutf8l(__pyx_t_4, __pyx_t_5) != 0);
     __pyx_t_1 = __pyx_t_3;
     __pyx_L9_bool_binop_done:;
@@ -38565,9 +38571,9 @@ static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(const xmlChar *_
       __Pyx_XDECREF(__pyx_r);
       if (unlikely(__pyx_v_s == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-        __PYX_ERR(5, 1770, __pyx_L1_error)
+        __PYX_ERR(6, 1770, __pyx_L1_error)
       }
-      __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_s), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1770, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_decode_bytes(((PyObject*)__pyx_v_s), 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 1770, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_r = __pyx_t_2;
       __pyx_t_2 = 0;
@@ -38665,7 +38671,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         pass
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_geturl); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1781, __pyx_L3_error)
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_geturl); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 1781, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_6 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -38679,7 +38685,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
       }
       __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(5, 1781, __pyx_L3_error)
+      if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1781, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_r = __pyx_t_4;
@@ -38754,7 +38760,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         if _isString(filename):
  *             return os_path_abspath(filename)
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1786, __pyx_L9_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1786, __pyx_L9_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_filename = __pyx_t_4;
       __pyx_t_4 = 0;
@@ -38790,7 +38796,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
         }
         __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename);
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1788, __pyx_L9_error)
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1788, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_r = __pyx_t_4;
@@ -38879,7 +38885,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
  *         if _isString(filename):
  *             return os_path_abspath(filename)
  */
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_filename); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1793, __pyx_L16_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_filename); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1793, __pyx_L16_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_XDECREF_SET(__pyx_v_filename, __pyx_t_4);
       __pyx_t_4 = 0;
@@ -38915,7 +38921,7 @@ static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_sour
         }
         __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_filename) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_filename);
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-        if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1795, __pyx_L16_error)
+        if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 1795, __pyx_L16_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_r = __pyx_t_4;
@@ -88111,11 +88117,11 @@ static int __pyx_f_4lxml_5etree_14_ReadOnlyProxy__assertNode(struct __pyx_obj_4l
  *         return 0
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ReferenceError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 18, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ReferenceError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 18, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(6, 18, __pyx_L1_error)
+    __PYX_ERR(7, 18, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":17
  *         u"""This is our way of saying: this proxy is invalid!
@@ -88179,17 +88185,17 @@ static int __pyx_f_4lxml_5etree_14_ReadOnlyProxy__raise_unsupported_type(struct
  * 
  *     cdef void free_after_use(self):
  */
-  __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_self->_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 22, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_self->_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_node_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 22, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_node_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 22, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 22, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_Raise(__pyx_t_1, 0, 0, 0);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __PYX_ERR(6, 22, __pyx_L1_error)
+  __PYX_ERR(7, 22, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":21
  *         return 0
@@ -88280,7 +88286,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *         if self._c_node.type == tree.XML_ELEMENT_NODE:
  *             return _namespacedName(self._c_node)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 33, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 33, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":34
  *         """
@@ -88300,7 +88306,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *             return ProcessingInstruction
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_self->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 35, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_self->_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 35, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -88324,7 +88330,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *             return Comment
  */
     __Pyx_XDECREF(__pyx_r);
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 37, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 37, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -88348,7 +88354,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *             return Entity
  */
     __Pyx_XDECREF(__pyx_r);
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 39, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Comment); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 39, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -88372,7 +88378,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  *             self._raise_unsupported_type()
  */
     __Pyx_XDECREF(__pyx_r);
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 41, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 41, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -88395,7 +88401,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_3tag___get__(struct __py
  * 
  *     @property
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 43, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 43, __pyx_L1_error)
     break;
   }
 
@@ -88463,7 +88469,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  *         if self._c_node.type == tree.XML_ELEMENT_NODE:
  *             return _collectText(self._c_node.children)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 50, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 50, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":51
  *         """
@@ -88483,7 +88489,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  *                                    tree.XML_COMMENT_NODE):
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 52, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 52, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_r = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -88548,7 +88554,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  */
     /*else*/ {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->content); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 58, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->content); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 58, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_r = __pyx_t_2;
       __pyx_t_2 = 0;
@@ -88573,7 +88579,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  *             self._raise_unsupported_type()
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 60, __pyx_L1_error)
+    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 60, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_4 = 0;
     __pyx_t_5 = 127;
@@ -88581,9 +88587,9 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
     __pyx_t_4 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__29);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u__29);
-    __pyx_t_6 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->name); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 60, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->name); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 60, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 60, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 60, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
@@ -88595,7 +88601,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
     __pyx_t_4 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__30);
     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u__30);
-    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 60, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_2, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 60, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __pyx_t_7;
@@ -88619,7 +88625,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4text___get__(struct __p
  * 
  *     @property
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 62, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 62, __pyx_L1_error)
     break;
   }
 
@@ -88684,7 +88690,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4tail___get__(struct __p
  *         return _collectText(self._c_node.next)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 70, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 70, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":71
  *         """
@@ -88694,7 +88700,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4tail___get__(struct __p
  *     @property
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->next); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 71, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->_c_node->next); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 71, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -88759,7 +88765,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_10sourceline___get__(str
  *         line = tree.xmlGetLineNo(self._c_node)
  *         if line > 0:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 78, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 78, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":79
  *         cdef long line
@@ -88788,7 +88794,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_10sourceline___get__(str
  *             return None
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 81, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_line); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 81, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -88877,7 +88883,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *         if self._c_node.type == tree.XML_ELEMENT_NODE:
  *             return "<Element %s at 0x%x>" % (strrepr(self.tag), id(self))
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 86, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 86, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":87
  *     def __repr__(self):
@@ -88897,14 +88903,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *             return "<!--%s-->" % strrepr(self.text)
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 88, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_tag); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 88, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 88, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 88, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_GIVEREF(__pyx_t_3);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
@@ -88912,7 +88918,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
     PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
     __pyx_t_3 = 0;
     __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Element_s_at_0x_x, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 88, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Element_s_at_0x_x, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 88, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_2;
@@ -88937,12 +88943,12 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *             return "&%s;" % strrepr(funicode(self._c_node.name))
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 90, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 90, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 90, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 90, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 90, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 90, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_2;
@@ -88967,12 +88973,12 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *             text = self.text
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 92, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->_c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 92, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 92, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 92, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_2;
@@ -88996,7 +89002,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *             if text:
  *                 return "<?%s %s?>" % (strrepr(self.target), text)
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 94, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 94, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_v_text = __pyx_t_2;
     __pyx_t_2 = 0;
@@ -89008,7 +89014,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *                 return "<?%s %s?>" % (strrepr(self.target), text)
  *             else:
  */
-    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(6, 95, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(7, 95, __pyx_L1_error)
     if (__pyx_t_5) {
 
       /* "src/lxml/readonlytree.pxi":96
@@ -89019,12 +89025,12 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  *                 return "<?%s?>" % strrepr(self.target)
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 96, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 96, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
-      __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 96, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 96, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 96, __pyx_L1_error)
+      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 96, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
@@ -89032,7 +89038,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
       __Pyx_GIVEREF(__pyx_v_text);
       PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_text);
       __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 96, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 96, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_4;
@@ -89057,12 +89063,12 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  */
     /*else*/ {
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 98, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_target); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 98, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 98, __pyx_L1_error)
+      __pyx_t_2 = __pyx_f_4lxml_5etree_strrepr(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 98, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 98, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyString_FormatSafe(__pyx_kp_s_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 98, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       __pyx_r = __pyx_t_4;
@@ -89087,7 +89093,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_2__repr__(struct __pyx_o
  * 
  *     def __getitem__(self, x):
  */
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 100, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_raise_unsupported_type(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 100, __pyx_L1_error)
     break;
   }
 
@@ -89188,7 +89194,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *         if isinstance(x, slice):
  *             # slicing
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 111, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 111, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":112
  *         cdef list result
@@ -89208,7 +89214,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *                 return _collectChildren(self)
  *             _findChildSlice(<slice>x, self._c_node, &c_node, &step, &slicelength)
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(6, 114, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__isFullSlice(((PyObject*)__pyx_v_x)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 114, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_3 != 0);
     if (__pyx_t_2) {
 
@@ -89220,8 +89226,8 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *             if c_node is NULL:
  */
       __Pyx_XDECREF(__pyx_r);
-      if (!(likely(((((PyObject *)__pyx_v_self)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 115, __pyx_L1_error)
-      __pyx_t_4 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 115, __pyx_L1_error)
+      if (!(likely(((((PyObject *)__pyx_v_self)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(7, 115, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 115, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
@@ -89243,7 +89249,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *             if c_node is NULL:
  *                 return []
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 116, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__findChildSlice(((PyObject*)__pyx_v_x), __pyx_v_self->_c_node, (&__pyx_v_c_node), (&__pyx_v_step), (&__pyx_v_slicelength)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 116, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":117
  *                 return _collectChildren(self)
@@ -89263,7 +89269,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *                 next_element = _nextElement
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 118, __pyx_L1_error)
+      __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 118, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_r = __pyx_t_4;
       __pyx_t_4 = 0;
@@ -89335,7 +89341,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *             c = 0
  *             while c_node is not NULL and c < slicelength:
  */
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 124, __pyx_L1_error)
+    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 124, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_result = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
@@ -89377,10 +89383,10 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  */
       __pyx_t_4 = ((PyObject *)__pyx_v_self->_source_proxy);
       __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 127, __pyx_L1_error)
+      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 127, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 127, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 127, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
       /* "src/lxml/readonlytree.pxi":128
@@ -89390,13 +89396,13 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *                 c = c + 1
  *                 for i from 0 <= i < step:
  */
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 128, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doc); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 128, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Document))))) __PYX_ERR(6, 128, __pyx_L1_error)
-      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 128, __pyx_L1_error)
+      if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Document))))) __PYX_ERR(7, 128, __pyx_L1_error)
+      __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 128, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(6, 128, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(7, 128, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
       /* "src/lxml/readonlytree.pxi":129
@@ -89458,7 +89464,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  *                 raise IndexError, u"list index out of range"
  */
   /*else*/ {
-    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(6, 135, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(7, 135, __pyx_L1_error)
     __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(__pyx_v_self->_c_node, __pyx_t_7);
 
     /* "src/lxml/readonlytree.pxi":136
@@ -89479,7 +89485,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
  * 
  */
       __Pyx_Raise(__pyx_builtin_IndexError, __pyx_kp_u_list_index_out_of_range, 0, 0);
-      __PYX_ERR(6, 137, __pyx_L1_error)
+      __PYX_ERR(7, 137, __pyx_L1_error)
 
       /* "src/lxml/readonlytree.pxi":136
  *             # indexing
@@ -89500,7 +89506,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_4__getitem__(struct __py
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_4 = ((PyObject *)__pyx_v_self->_source_proxy);
     __Pyx_INCREF(__pyx_t_4);
-    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 138, __pyx_L1_error)
+    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_4), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 138, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_r = __pyx_t_5;
@@ -89574,7 +89580,7 @@ static Py_ssize_t __pyx_pf_4lxml_5etree_14_ReadOnlyProxy_6__len__(struct __pyx_o
  *         c = 0
  *         c_node = self._c_node.children
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 145, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 145, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":146
  *         cdef xmlNode* c_node
@@ -89710,7 +89716,7 @@ static int __pyx_pf_4lxml_5etree_14_ReadOnlyProxy_8__nonzero__(struct __pyx_obj_
  *         c_node = _findChildBackwards(self._c_node, 0)
  *         return c_node != NULL
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 156, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 156, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":157
  *         cdef xmlNode* c_node
@@ -89788,7 +89794,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_10__deepcopy__(struct __
  *     cpdef __copy__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->__pyx___copy__(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 162, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->__pyx___copy__(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 162, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -89850,7 +89856,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
       #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 164, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 164, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4lxml_5etree_14_ReadOnlyProxy_13__copy__)) {
         __Pyx_XDECREF(__pyx_r);
@@ -89867,7 +89873,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
         }
         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 164, __pyx_L1_error)
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 164, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __pyx_r = __pyx_t_2;
@@ -89926,7 +89932,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
  *         new_doc = _documentFactory(c_doc, None)
  *         root = new_doc.getroot()
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_c_node->doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(6, 171, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_self->_c_node->doc, __pyx_v_self->_c_node); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(7, 171, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_6;
 
   /* "src/lxml/readonlytree.pxi":172
@@ -89936,7 +89942,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
  *         root = new_doc.getroot()
  *         if root is not None:
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 172, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 172, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_new_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -89948,7 +89954,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
  *         if root is not None:
  *             return root
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 173, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_new_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 173, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_root = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90063,7 +90069,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(struct __pyx_obj
  *     def __iter__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 182, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc, __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 182, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90117,7 +90123,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_12__copy__(struct __pyx_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__copy__", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 164, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90173,9 +90179,9 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_14__iter__(struct __pyx_
  *     def iterchildren(self, tag=None, *, reversed=False):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->getchildren(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 185, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->getchildren(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 185, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 185, __pyx_L1_error)
+  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 185, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
@@ -90251,7 +90257,7 @@ static PyObject *__pyx_pw_4lxml_5etree_14_ReadOnlyProxy_17iterchildren(PyObject
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterchildren") < 0)) __PYX_ERR(6, 187, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterchildren") < 0)) __PYX_ERR(7, 187, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -90266,7 +90272,7 @@ static PyObject *__pyx_pw_4lxml_5etree_14_ReadOnlyProxy_17iterchildren(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("iterchildren", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 187, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("iterchildren", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 187, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ReadOnlyProxy.iterchildren", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -90305,7 +90311,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *         if tag is not None and tag != '*':
  *             children = [ el for el in children if el.tag == tag ]
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->getchildren(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 192, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->getchildren(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 192, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_children = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90324,7 +90330,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 193, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 193, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
@@ -90336,32 +90342,32 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *         if reversed:
  *             children = children[::-1]
  */
-    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 194, __pyx_L1_error)
+    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (likely(PyList_CheckExact(__pyx_v_children)) || PyTuple_CheckExact(__pyx_v_children)) {
       __pyx_t_5 = __pyx_v_children; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
       __pyx_t_7 = NULL;
     } else {
-      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 194, __pyx_L1_error)
+      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 194, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 194, __pyx_L1_error)
+      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 194, __pyx_L1_error)
     }
     for (;;) {
       if (likely(!__pyx_t_7)) {
         if (likely(PyList_CheckExact(__pyx_t_5))) {
           if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 194, __pyx_L1_error)
+          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(7, 194, __pyx_L1_error)
           #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 194, __pyx_L1_error)
+          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 194, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
           #endif
         } else {
           if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(6, 194, __pyx_L1_error)
+          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(7, 194, __pyx_L1_error)
           #else
-          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 194, __pyx_L1_error)
+          __pyx_t_8 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 194, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
           #endif
         }
@@ -90371,7 +90377,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(6, 194, __pyx_L1_error)
+            else __PYX_ERR(7, 194, __pyx_L1_error)
           }
           break;
         }
@@ -90379,14 +90385,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
       }
       __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_8);
       __pyx_t_8 = 0;
-      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(6, 194, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 194, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_v_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(6, 194, __pyx_L1_error)
+      __pyx_t_9 = PyObject_RichCompare(__pyx_t_8, __pyx_v_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(7, 194, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 194, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 194, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       if (__pyx_t_2) {
-        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_el))) __PYX_ERR(6, 194, __pyx_L1_error)
+        if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_v_el))) __PYX_ERR(7, 194, __pyx_L1_error)
       }
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -90409,7 +90415,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *             children = children[::-1]
  *         return iter(children)
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reversed); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(6, 195, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_reversed); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(7, 195, __pyx_L1_error)
   if (__pyx_t_2) {
 
     /* "src/lxml/readonlytree.pxi":196
@@ -90419,7 +90425,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *         return iter(children)
  * 
  */
-    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_children, __pyx_slice__54); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 196, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_children, __pyx_slice__54); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 196, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_children, __pyx_t_1);
     __pyx_t_1 = 0;
@@ -90441,7 +90447,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_16iterchildren(struct __
  *     cpdef getchildren(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 197, __pyx_L1_error)
+  __pyx_t_1 = PyObject_GetIter(__pyx_v_children); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 197, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90506,7 +90512,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
     if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
       PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
       #endif
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getchildren); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 199, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getchildren); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 199, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_4lxml_5etree_14_ReadOnlyProxy_19getchildren)) {
         __Pyx_XDECREF(__pyx_r);
@@ -90523,7 +90529,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
         }
         __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 199, __pyx_L1_error)
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 199, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __pyx_r = __pyx_t_2;
@@ -90551,7 +90557,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
  *         result = []
  *         c_node = self._c_node.children
  */
-  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(6, 205, __pyx_L1_error)
+  __pyx_t_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 205, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":206
  *         cdef list result
@@ -90560,7 +90566,7 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
  *         c_node = self._c_node.children
  *         while c_node is not NULL:
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 206, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 206, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_result = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -90605,10 +90611,10 @@ static PyObject *__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(struct __pyx_
  */
       __pyx_t_1 = ((PyObject *)__pyx_v_self->_source_proxy);
       __Pyx_INCREF(__pyx_t_1);
-      __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 210, __pyx_L1_error)
+      __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1), __pyx_v_c_node)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 210, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(6, 210, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(7, 210, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
       /* "src/lxml/readonlytree.pxi":209
@@ -90690,7 +90696,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_18getchildren(struct __p
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("getchildren", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -90752,7 +90758,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_20getparent(struct __pyx
  *         c_parent = self._c_node.parent
  *         if c_parent is NULL or not tree._isElement(c_parent):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 218, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 218, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":219
  *         cdef xmlNode* c_parent
@@ -90813,7 +90819,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_20getparent(struct __pyx
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_5 = ((PyObject *)__pyx_v_self->_source_proxy);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_5), __pyx_v_c_parent)); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 223, __pyx_L1_error)
+    __pyx_t_6 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_5), __pyx_v_c_parent)); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 223, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_r = __pyx_t_6;
@@ -90884,7 +90890,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_22getnext(struct __pyx_o
  *         c_node = _nextElement(self._c_node)
  *         if c_node is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 229, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 229, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":230
  *         cdef xmlNode* c_node
@@ -90915,7 +90921,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_22getnext(struct __pyx_o
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_source_proxy);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 232, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_4;
@@ -91005,7 +91011,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_24getprevious(struct __p
  *         c_node = _previousElement(self._c_node)
  *         if c_node is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 239, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self->__pyx_vtab)->_assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 239, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":240
  *         cdef xmlNode* c_node
@@ -91036,7 +91042,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_ReadOnlyProxy_24getprevious(struct __p
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_3 = ((PyObject *)__pyx_v_self->_source_proxy);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 242, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 242, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_4;
@@ -91121,7 +91127,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ReadOnlyPIProxy_6target___get__(struct
  *         return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 252, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 252, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":253
  *     def target(self):
@@ -91131,7 +91137,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_ReadOnlyPIProxy_6target___get__(struct
  * @cython.final
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 253, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 253, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -91194,7 +91200,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name___get__(stru
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 261, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 261, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -91263,7 +91269,7 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
  *             if u'&' in value or u';' in value:
  *                 raise ValueError(f"Invalid entity name '{value}'")
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 264, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 264, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_value_utf = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -91275,14 +91281,14 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
  *                 raise ValueError(f"Invalid entity name '{value}'")
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))
  */
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 265, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_3 != 0);
   if (!__pyx_t_4) {
   } else {
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 265, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 265, __pyx_L1_error)
   __pyx_t_3 = (__pyx_t_4 != 0);
   __pyx_t_2 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
@@ -91295,7 +91301,7 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
  *             tree.xmlNodeSetName(self._c_node, _xcstr(value_utf))
  * 
  */
-    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 266, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_5 = 0;
     __pyx_t_6 = 127;
@@ -91303,7 +91309,7 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
     __pyx_t_5 += 21;
     __Pyx_GIVEREF(__pyx_kp_u_Invalid_entity_name);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Invalid_entity_name);
-    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 266, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
     __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
@@ -91314,15 +91320,15 @@ static int __pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4name_2__set__(struct __
     __pyx_t_5 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__22);
     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__22);
-    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 266, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 266, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 266, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(6, 266, __pyx_L1_error)
+    __PYX_ERR(7, 266, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":265
  *         def __set__(self, value):
@@ -91406,7 +91412,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4text___get__(stru
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 271, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = 0;
   __pyx_t_3 = 127;
@@ -91414,9 +91420,9 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4text___get__(stru
   __pyx_t_2 += 1;
   __Pyx_GIVEREF(__pyx_kp_u__29);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u__29);
-  __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 271, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->name); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 271, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_3 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_3) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_3;
@@ -91428,7 +91434,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ReadOnlyEntityProxy_4text___get__(stru
   __pyx_t_2 += 1;
   __Pyx_GIVEREF(__pyx_kp_u__30);
   PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__30);
-  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 271, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 271, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_5;
@@ -91495,7 +91501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(s
  *         return dict(_collectAttributes(self._c_node, 3))
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 280, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 280, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":281
  *     def attrib(self):
@@ -91505,9 +91511,9 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6attrib___get__(s
  *     @property
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 281, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 281, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 281, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_3;
@@ -91573,7 +91579,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(s
  *         if self._c_node.ns is not NULL:
  *             if self._c_node.ns.prefix is not NULL:
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 287, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 287, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":288
  *         """
@@ -91603,7 +91609,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6prefix___get__(s
  * 
  */
       __Pyx_XDECREF(__pyx_r);
-      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->ns->prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 290, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->ns->prefix); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 290, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_r = __pyx_t_3;
       __pyx_t_3 = 0;
@@ -91695,7 +91701,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_5nsmap___get__(st
  *         return _build_nsmap(self._c_node)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 301, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 301, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":302
  *         """
@@ -91705,7 +91711,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_5nsmap___get__(st
  *     def get(self, key, default=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__build_nsmap(__pyx_v_self->__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 302, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__build_nsmap(__pyx_v_self->__pyx_base._c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 302, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -91779,7 +91785,7 @@ static PyObject *__pyx_pw_4lxml_5etree_21_ReadOnlyElementProxy_1get(PyObject *__
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(6, 304, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get") < 0)) __PYX_ERR(7, 304, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -91795,7 +91801,7 @@ static PyObject *__pyx_pw_4lxml_5etree_21_ReadOnlyElementProxy_1get(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(6, 304, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("get", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 304, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._ReadOnlyElementProxy.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -91825,7 +91831,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get(struct __pyx_
  *         return _getNodeAttributeValue(self._c_node, key, default)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 307, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 307, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":308
  *         """
@@ -91835,7 +91841,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_get(struct __pyx_
  *     def keys(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__getNodeAttributeValue(__pyx_v_self->__pyx_base._c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 308, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__getNodeAttributeValue(__pyx_v_self->__pyx_base._c_node, __pyx_v_key, __pyx_v_default); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -91900,7 +91906,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_2keys(struct __py
  *         return _collectAttributes(self._c_node, 1)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 314, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 314, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":315
  *         """
@@ -91910,7 +91916,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_2keys(struct __py
  *     def values(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 315, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 315, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -91975,7 +91981,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4values(struct __
  *         return _collectAttributes(self._c_node, 2)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 321, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 321, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":322
  *         """
@@ -91985,7 +91991,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_4values(struct __
  *     def items(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 322, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 322, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -92050,7 +92056,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6items(struct __p
  *         return _collectAttributes(self._c_node, 3)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 328, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ReadOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 328, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":329
  *         """
@@ -92060,7 +92066,7 @@ static PyObject *__pyx_pf_4lxml_5etree_21_ReadOnlyElementProxy_6items(struct __p
  * cdef _ReadOnlyProxy _newReadOnlyProxy(
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 329, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_self->__pyx_base._c_node, 3); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 329, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -92121,9 +92127,9 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newRe
  *     elif c_node.type == tree.XML_PI_NODE:
  *         el = _ReadOnlyPIProxy.__new__(_ReadOnlyPIProxy)
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyElementProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 335, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyElementProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 335, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(6, 335, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(7, 335, __pyx_L1_error)
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -92144,9 +92150,9 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newRe
  *     elif c_node.type in (tree.XML_COMMENT_NODE,
  *                          tree.XML_ENTITY_REF_NODE):
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyPIProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyPIProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 337, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyPIProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyPIProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 337, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(6, 337, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(7, 337, __pyx_L1_error)
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -92176,7 +92182,7 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newRe
  *     else:
  *         raise TypeError(f"Unsupported element type: {c_node.type}")
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 340, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ReadOnlyProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 340, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -92198,17 +92204,17 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newRe
  *     el._c_node = c_node
  *     _initReadOnlyProxy(el, source_proxy)
  */
-    __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 342, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 342, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 342, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 342, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 342, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(6, 342, __pyx_L1_error)
+    __PYX_ERR(7, 342, __pyx_L1_error)
     break;
   }
 
@@ -92228,7 +92234,7 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newRe
  *     return el
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(__pyx_v_el, __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 344, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(__pyx_v_el, __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 344, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -92316,7 +92322,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__initReadOnlyProxy(struct __
  *     else:
  *         el._source_proxy = source_proxy
  */
-    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 351, __pyx_L1_error)
+    __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 351, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(((PyObject *)__pyx_v_el));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_el));
@@ -92360,9 +92366,9 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__initReadOnlyProxy(struct __
  */
     if (unlikely(__pyx_v_source_proxy->_dependent_proxies == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-      __PYX_ERR(6, 354, __pyx_L1_error)
+      __PYX_ERR(7, 354, __pyx_L1_error)
     }
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_source_proxy->_dependent_proxies, ((PyObject *)__pyx_v_el)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(6, 354, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_source_proxy->_dependent_proxies, ((PyObject *)__pyx_v_el)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 354, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -92482,18 +92488,18 @@ static PyObject *__pyx_f_4lxml_5etree__freeReadOnlyProxies(struct __pyx_obj_4lxm
  */
   if (unlikely(__pyx_v_sourceProxy->_dependent_proxies == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(6, 363, __pyx_L1_error)
+    __PYX_ERR(7, 363, __pyx_L1_error)
   }
   __pyx_t_3 = __pyx_v_sourceProxy->_dependent_proxies; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
   for (;;) {
     if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(6, 363, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(7, 363, __pyx_L1_error)
     #else
-    __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 363, __pyx_L1_error)
+    __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 363, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     #endif
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__ReadOnlyProxy))))) __PYX_ERR(6, 363, __pyx_L1_error)
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__ReadOnlyProxy))))) __PYX_ERR(7, 363, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_el, ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_5));
     __pyx_t_5 = 0;
 
@@ -92563,9 +92569,9 @@ static PyObject *__pyx_f_4lxml_5etree__freeReadOnlyProxies(struct __pyx_obj_4lxm
  */
   if (unlikely(__pyx_v_sourceProxy->_dependent_proxies == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(6, 368, __pyx_L1_error)
+    __PYX_ERR(7, 368, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_sourceProxy->_dependent_proxies, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(6, 368, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_sourceProxy->_dependent_proxies, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(7, 368, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":356
  *         source_proxy._dependent_proxies.append(el)
@@ -92630,7 +92636,7 @@ static int __pyx_pf_4lxml_5etree_18_OpaqueNodeWrapper___init__(CYTHON_UNUSED str
  * @cython.final
  */
   __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_This_type_cannot_be_instantiated, 0, 0);
-  __PYX_ERR(6, 379, __pyx_L1_error)
+  __PYX_ERR(7, 379, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":378
  * cdef class _OpaqueNodeWrapper:
@@ -92675,7 +92681,7 @@ static int __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(struct __py
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->__pyx_base._c_node != NULL) != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_Proxy_invalidated);
-      __PYX_ERR(6, 387, __pyx_L1_error)
+      __PYX_ERR(7, 387, __pyx_L1_error)
     }
   }
   #endif
@@ -92739,7 +92745,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         c_node = _roNodeOf(other_element)
  *         if c_node.type == tree.XML_ELEMENT_NODE:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 395, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 395, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":396
  *         cdef xmlNode* c_node
@@ -92748,7 +92754,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         if c_node.type == tree.XML_ELEMENT_NODE:
  *             if tree.xmlDocGetRootElement(<tree.xmlDoc*>self._c_node) is not NULL:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 396, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(7, 396, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":397
@@ -92779,7 +92785,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *             raise TypeError, f"unsupported element type for top-level node: {c_node.type}"
  */
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_cannot_append_document_already_h, 0, 0);
-      __PYX_ERR(6, 399, __pyx_L1_error)
+      __PYX_ERR(7, 399, __pyx_L1_error)
 
       /* "src/lxml/readonlytree.pxi":398
  *         c_node = _roNodeOf(other_element)
@@ -92826,14 +92832,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         c_node = _copyNodeToDoc(c_node, <tree.xmlDoc*>self._c_node)
  *         c_next = c_node.next
  */
-    __pyx_t_5 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 401, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 401, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unsupported_element_type_for_top, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(6, 401, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_unsupported_element_type_for_top, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 401, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_6, 0, 0);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __PYX_ERR(6, 401, __pyx_L1_error)
+    __PYX_ERR(7, 401, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":400
  *             if tree.xmlDocGetRootElement(<tree.xmlDoc*>self._c_node) is not NULL:
@@ -92852,7 +92858,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __p
  *         c_next = c_node.next
  *         tree.xmlAddChild(self._c_node, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, ((xmlDoc *)__pyx_v_self->__pyx_base._c_node)); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 402, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, ((xmlDoc *)__pyx_v_self->__pyx_base._c_node)); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(7, 402, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":403
@@ -92929,7 +92935,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_append(struct __
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("append", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(__pyx_v_self, __pyx_v_other_element, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 390, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(__pyx_v_self, __pyx_v_other_element, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -92990,7 +92996,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
  *         for element in elements:
  *             self.append(element)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 411, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 411, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":412
  *         """
@@ -93003,26 +93009,26 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
     __pyx_t_2 = __pyx_v_elements; __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_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 412, __pyx_L1_error)
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 412, __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(6, 412, __pyx_L1_error)
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 412, __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_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 412, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(7, 412, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 412, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 412, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 412, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(7, 412, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 412, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 412, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -93032,7 +93038,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(6, 412, __pyx_L1_error)
+          else __PYX_ERR(7, 412, __pyx_L1_error)
         }
         break;
       }
@@ -93048,7 +93054,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_OpaqueDocumentWrapper_2extend(struct _
  * 
  * cdef _OpaqueNodeWrapper _newOpaqueAppendOnlyNodeWrapper(xmlNode* c_node):
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(__pyx_v_self, __pyx_v_element, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 413, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append(__pyx_v_self, __pyx_v_element, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 413, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -93121,9 +93127,9 @@ static struct __pyx_obj_4lxml_5etree__OpaqueNodeWrapper *__pyx_f_4lxml_5etree__n
  *     else:
  *         node = _OpaqueNodeWrapper.__new__(_OpaqueNodeWrapper)
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__OpaqueDocumentWrapper(((PyTypeObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 418, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__OpaqueDocumentWrapper(((PyTypeObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 418, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__OpaqueNodeWrapper)))) __PYX_ERR(6, 418, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__OpaqueNodeWrapper)))) __PYX_ERR(7, 418, __pyx_L1_error)
     __pyx_v_node = ((struct __pyx_obj_4lxml_5etree__OpaqueNodeWrapper *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -93144,7 +93150,7 @@ static struct __pyx_obj_4lxml_5etree__OpaqueNodeWrapper *__pyx_f_4lxml_5etree__n
  *     node._c_node = c_node
  *     return node
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__OpaqueNodeWrapper(((PyTypeObject *)__pyx_ptype_4lxml_5etree__OpaqueNodeWrapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 420, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__OpaqueNodeWrapper(((PyTypeObject *)__pyx_ptype_4lxml_5etree__OpaqueNodeWrapper), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 420, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
     __pyx_v_node = ((struct __pyx_obj_4lxml_5etree__OpaqueNodeWrapper *)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -93231,7 +93237,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text___get__(s
  *             if self._c_node.content is NULL:
  *                 return ''
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 432, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 432, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":433
  *         def __get__(self):
@@ -93273,7 +93279,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text___get__(s
  */
   /*else*/ {
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->content); if (unlikely(!__pyx_t_3)) __PYX_ERR(6, 436, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base._c_node->content); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 436, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -93341,7 +93347,7 @@ static int __pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text_2__set__(struct
  *             if value is None:
  *                 c_text = <const_xmlChar*>NULL
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 440, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyProxy *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 440, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":441
  *             cdef tree.xmlDict* c_dict
@@ -93381,7 +93387,7 @@ static int __pyx_pf_4lxml_5etree_23_ModifyContentOnlyProxy_4text_2__set__(struct
  *             tree.xmlNodeSetContent(self._c_node, c_text)
  */
   /*else*/ {
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 444, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 444, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_4);
     __pyx_t_4 = 0;
@@ -93465,7 +93471,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target___get
  *             return funicode(self._c_node.name)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 456, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 456, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":457
  *         def __get__(self):
@@ -93475,7 +93481,7 @@ static PyObject *__pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target___get
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 457, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 457, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -93540,7 +93546,7 @@ static int __pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target_2__set__(st
  *             value = _utf8(value)
  *             c_text = _xcstr(value)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 460, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ModifyContentOnlyPIProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 460, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":461
  *         def __set__(self, value):
@@ -93549,7 +93555,7 @@ static int __pyx_pf_4lxml_5etree_25_ModifyContentOnlyPIProxy_6target_2__set__(st
  *             c_text = _xcstr(value)
  *             tree.xmlNodeSetName(self._c_node, c_text)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 461, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 461, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
   __pyx_t_2 = 0;
@@ -93631,7 +93637,7 @@ static PyObject *__pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name___g
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 471, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_self->__pyx_base.__pyx_base._c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 471, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -93701,7 +93707,7 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
  *             assert u'&' not in value and u';' not in value, \
  *                 f"Invalid entity name '{value}'"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 474, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 474, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_1);
   __pyx_t_1 = 0;
@@ -93715,14 +93721,14 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(6, 475, __pyx_L1_error)
+    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__29, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(7, 475, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_3 != 0);
     if (__pyx_t_4) {
     } else {
       __pyx_t_2 = __pyx_t_4;
       goto __pyx_L3_bool_binop_done;
     }
-    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(6, 475, __pyx_L1_error)
+    __pyx_t_4 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__30, __pyx_v_value, Py_NE)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(7, 475, __pyx_L1_error)
     __pyx_t_3 = (__pyx_t_4 != 0);
     __pyx_t_2 = __pyx_t_3;
     __pyx_L3_bool_binop_done:;
@@ -93735,7 +93741,7 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
  *             c_text = _xcstr(value)
  *             tree.xmlNodeSetName(self._c_node, c_text)
  */
-      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 476, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 476, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_t_5 = 0;
       __pyx_t_6 = 127;
@@ -93743,7 +93749,7 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
       __pyx_t_5 += 21;
       __Pyx_GIVEREF(__pyx_kp_u_Invalid_entity_name);
       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Invalid_entity_name);
-      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 476, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 476, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
       __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
@@ -93754,12 +93760,12 @@ static int __pyx_pf_4lxml_5etree_29_ModifyContentOnlyEntityProxy_4name_2__set__(
       __pyx_t_5 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__22);
       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__22);
-      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 476, __pyx_L1_error)
+      __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 476, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-      __PYX_ERR(6, 475, __pyx_L1_error)
+      __PYX_ERR(7, 475, __pyx_L1_error)
     }
   }
   #endif
@@ -93832,7 +93838,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_node = _roNodeOf(other_element)
  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 492, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 492, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":493
  *         cdef xmlNode* c_node
@@ -93841,7 +93847,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_node = _copyNodeToDoc(c_node, self._c_node.doc)
  *         c_next = c_node.next
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 493, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__roNodeOf(__pyx_v_other_element); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(7, 493, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":494
@@ -93851,7 +93857,7 @@ static PyObject *__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(struct __
  *         c_next = c_node.next
  *         tree.xmlAddChild(self._c_node, c_node)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, __pyx_v_self->__pyx_base.__pyx_base._c_node->doc); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(6, 494, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_node, __pyx_v_self->__pyx_base.__pyx_base._c_node->doc); if (unlikely(__pyx_t_2 == ((xmlNode *)NULL))) __PYX_ERR(7, 494, __pyx_L1_error)
   __pyx_v_c_node = __pyx_t_2;
 
   /* "src/lxml/readonlytree.pxi":495
@@ -93926,7 +93932,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_append(struct _
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("append", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(__pyx_v_self, __pyx_v_other_element, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 487, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(__pyx_v_self, __pyx_v_other_element, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -93987,7 +93993,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
  *         for element in elements:
  *             self.append(element)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 503, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 503, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":504
  *         """
@@ -94000,26 +94006,26 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
     __pyx_t_2 = __pyx_v_elements; __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_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 504, __pyx_L1_error)
+    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 504, __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(6, 504, __pyx_L1_error)
+    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 504, __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_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 504, __pyx_L1_error)
+        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(7, 504, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 504, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 504, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(6, 504, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(7, 504, __pyx_L1_error)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 504, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 504, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -94029,7 +94035,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(6, 504, __pyx_L1_error)
+          else __PYX_ERR(7, 504, __pyx_L1_error)
         }
         break;
       }
@@ -94045,7 +94051,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_2extend(struct
  * 
  *     property text:
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(__pyx_v_self, __pyx_v_element, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 505, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append(__pyx_v_self, __pyx_v_element, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 505, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -94120,7 +94126,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(s
  *             return _collectText(self._c_node.children)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 512, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 512, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":513
  *         def __get__(self):
@@ -94130,7 +94136,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text___get__(s
  *         def __set__(self, value):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->__pyx_base.__pyx_base._c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 513, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->__pyx_base.__pyx_base._c_node->children); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -94197,7 +94203,7 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
  *             if isinstance(value, QName):
  *                 value = _resolveQNameText(self, value).decode('utf8')
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 516, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__AppendOnlyElementProxy *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._assertNode(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 516, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":517
  *         def __set__(self, value):
@@ -94217,14 +94223,14 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
  *             _setNodeText(self._c_node, value)
  * 
  */
-    if (!(likely(((((PyObject *)__pyx_v_self)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(6, 518, __pyx_L1_error)
-    __pyx_t_4 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 518, __pyx_L1_error)
+    if (!(likely(((((PyObject *)__pyx_v_self)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(7, 518, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self), __pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 518, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     if (unlikely(__pyx_t_4 == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
-      __PYX_ERR(6, 518, __pyx_L1_error)
+      __PYX_ERR(7, 518, __pyx_L1_error)
     }
-    __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_4, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 518, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_decode_bytes(__pyx_t_4, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 518, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_5);
@@ -94246,7 +94252,7 @@ static int __pyx_pf_4lxml_5etree_23_AppendOnlyElementProxy_4text_2__set__(struct
  * 
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(6, 519, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base.__pyx_base._c_node, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(7, 519, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":515
  *             return _collectText(self._c_node.children)
@@ -94306,9 +94312,9 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newAp
  *     elif c_node.type == tree.XML_PI_NODE:
  *         el = _ModifyContentOnlyPIProxy.__new__(_ModifyContentOnlyPIProxy)
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__AppendOnlyElementProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 526, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__AppendOnlyElementProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 526, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(6, 526, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(7, 526, __pyx_L1_error)
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -94329,9 +94335,9 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newAp
  *     elif c_node.type == tree.XML_COMMENT_NODE:
  *         el = _ModifyContentOnlyProxy.__new__(_ModifyContentOnlyProxy)
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ModifyContentOnlyPIProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ModifyContentOnlyPIProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 528, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ModifyContentOnlyPIProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ModifyContentOnlyPIProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 528, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(6, 528, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(7, 528, __pyx_L1_error)
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -94352,9 +94358,9 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newAp
  *     else:
  *         raise TypeError(f"Unsupported element type: {c_node.type}")
  */
-    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ModifyContentOnlyProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ModifyContentOnlyProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 530, __pyx_L1_error)
+    __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree__ModifyContentOnlyProxy(((PyTypeObject *)__pyx_ptype_4lxml_5etree__ModifyContentOnlyProxy), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 530, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(6, 530, __pyx_L1_error)
+    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_1), __pyx_ptype_4lxml_5etree__ReadOnlyProxy)))) __PYX_ERR(7, 530, __pyx_L1_error)
     __pyx_v_el = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
     __pyx_t_1 = 0;
 
@@ -94375,17 +94381,17 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newAp
  *     el._c_node = c_node
  *     _initReadOnlyProxy(el, source_proxy)
  */
-    __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 532, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 532, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 532, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unsupported_element_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 532, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 532, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 532, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_1, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(6, 532, __pyx_L1_error)
+    __PYX_ERR(7, 532, __pyx_L1_error)
     break;
   }
 
@@ -94405,7 +94411,7 @@ static struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *__pyx_f_4lxml_5etree__newAp
  *     return el
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(__pyx_v_el, __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 534, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__initReadOnlyProxy(__pyx_v_el, __pyx_v_source_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 534, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -94565,14 +94571,14 @@ static xmlNode *__pyx_f_4lxml_5etree__roNodeOf(PyObject *__pyx_v_element) {
  *     if c_node is NULL:
  */
   /*else*/ {
-    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_element)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 546, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_element)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 546, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_argument_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 546, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_argument_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 546, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(6, 546, __pyx_L1_error)
+    __PYX_ERR(7, 546, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -94594,7 +94600,7 @@ static xmlNode *__pyx_f_4lxml_5etree__roNodeOf(PyObject *__pyx_v_element) {
  * 
  */
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_element, 0, 0);
-    __PYX_ERR(6, 549, __pyx_L1_error)
+    __PYX_ERR(7, 549, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":548
  *         raise TypeError, f"invalid argument type {type(element)}"
@@ -94757,14 +94763,14 @@ static xmlNode *__pyx_f_4lxml_5etree__nonRoNodeOf(PyObject *__pyx_v_element) {
  *     if c_node is NULL:
  */
   /*else*/ {
-    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_element)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(6, 561, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_element)), __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 561, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_argument_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(6, 561, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_invalid_argument_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 561, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_5, 0, 0);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    __PYX_ERR(6, 561, __pyx_L1_error)
+    __PYX_ERR(7, 561, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -94785,7 +94791,7 @@ static xmlNode *__pyx_f_4lxml_5etree__nonRoNodeOf(PyObject *__pyx_v_element) {
  *     return c_node
  */
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_invalid_element, 0, 0);
-    __PYX_ERR(6, 564, __pyx_L1_error)
+    __PYX_ERR(7, 564, __pyx_L1_error)
 
     /* "src/lxml/readonlytree.pxi":563
  *         raise TypeError, f"invalid argument type {type(element)}"
@@ -94882,7 +94888,7 @@ static int __pyx_pw_4lxml_5etree_11ElementBase_1__init__(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, 0, "__init__") < 0)) __PYX_ERR(7, 42, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, 0, "__init__") < 0)) __PYX_ERR(8, 42, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
       goto __pyx_L5_argtuple_error;
@@ -94893,7 +94899,7 @@ static int __pyx_pw_4lxml_5etree_11ElementBase_1__init__(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 42, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 42, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_children); __pyx_v_children = 0;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
@@ -94958,7 +94964,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *         try:
  *             namespace = _utf8(_getattr(self, 'NAMESPACE'))
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 49, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_builtin_object, __pyx_n_s_getattribute); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 49, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v__getattr = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -95002,7 +95008,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_n_s_NAMESPACE};
-        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 51, __pyx_L3_error)
+        __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 51, __pyx_L3_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
@@ -95010,13 +95016,13 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
         PyObject *__pyx_temp[3] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_n_s_NAMESPACE};
-        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 51, __pyx_L3_error)
+        __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 51, __pyx_L3_error)
         __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
       #endif
       {
-        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 51, __pyx_L3_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 51, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_8);
         if (__pyx_t_6) {
           __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -95027,12 +95033,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_n_s_NAMESPACE);
         __Pyx_GIVEREF(__pyx_n_s_NAMESPACE);
         PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_n_s_NAMESPACE);
-        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 51, __pyx_L3_error)
+        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 51, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_5 = __pyx_f_4lxml_5etree__utf8(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 51, __pyx_L3_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__utf8(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 51, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_v_namespace = __pyx_t_5;
@@ -95066,7 +95072,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.ElementBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(7, 52, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_1, &__pyx_t_8) < 0) __PYX_ERR(8, 52, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_8);
@@ -95147,7 +95153,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_1)) {
         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_n_s_TAG};
-        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_8);
       } else
@@ -95155,13 +95161,13 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
         PyObject *__pyx_temp[3] = {__pyx_t_5, ((PyObject *)__pyx_v_self), __pyx_n_s_TAG};
-        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_GOTREF(__pyx_t_8);
       } else
       #endif
       {
-        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_GOTREF(__pyx_t_6);
         if (__pyx_t_5) {
           __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
@@ -95172,12 +95178,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_n_s_TAG);
         __Pyx_GIVEREF(__pyx_n_s_TAG);
         PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_n_s_TAG);
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 55, __pyx_L11_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 55, __pyx_L11_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       if (likely(__pyx_t_1 != Py_None)) {
@@ -95186,7 +95192,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(7, 55, __pyx_L11_error)
+          __PYX_ERR(8, 55, __pyx_L11_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
@@ -95194,14 +95200,14 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_t_8);
         __Pyx_INCREF(__pyx_t_6);
         #else
-        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 55, __pyx_L11_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 55, __pyx_L11_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       } else {
-        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(7, 55, __pyx_L11_error)
+        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(8, 55, __pyx_L11_error)
       }
       __pyx_v_ns = __pyx_t_8;
       __pyx_t_8 = 0;
@@ -95266,7 +95272,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.ElementBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(7, 58, __pyx_L13_except_error)
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_8) < 0) __PYX_ERR(8, 58, __pyx_L13_except_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_8);
@@ -95294,7 +95300,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_12)) {
         PyObject *__pyx_temp[3] = {__pyx_t_13, ((PyObject *)__pyx_v_self), __pyx_n_s_class};
-        __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_11 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
         __Pyx_GOTREF(__pyx_t_11);
       } else
@@ -95302,13 +95308,13 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
         PyObject *__pyx_temp[3] = {__pyx_t_13, ((PyObject *)__pyx_v_self), __pyx_n_s_class};
-        __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_11 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
         __Pyx_GOTREF(__pyx_t_11);
       } else
       #endif
       {
-        __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_14 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_14);
         if (__pyx_t_13) {
           __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
@@ -95319,7 +95325,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_n_s_class);
         __Pyx_GIVEREF(__pyx_n_s_class);
         PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_7, __pyx_n_s_class);
-        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_14, NULL); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
       }
@@ -95340,7 +95346,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_12)) {
         PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_11, __pyx_n_s_name};
-        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -95349,14 +95355,14 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_12)) {
         PyObject *__pyx_temp[3] = {__pyx_t_14, __pyx_t_11, __pyx_n_s_name};
-        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_12, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       } else
       #endif
       {
-        __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_13);
         if (__pyx_t_14) {
           __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
@@ -95367,12 +95373,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_GIVEREF(__pyx_n_s_name);
         PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_n_s_name);
         __pyx_t_11 = 0;
-        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 59, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
       }
       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __pyx_t_12 = __pyx_f_4lxml_5etree__utf8(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 59, __pyx_L13_except_error)
+      __pyx_t_12 = __pyx_f_4lxml_5etree__utf8(__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 59, __pyx_L13_except_error)
       __Pyx_GOTREF(__pyx_t_12);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __Pyx_XDECREF_SET(__pyx_v_tag, __pyx_t_12);
@@ -95385,7 +95391,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                 tag = tag.split(b'.')[-1]
  *         try:
  */
-      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__4, __pyx_v_tag, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(7, 60, __pyx_L13_except_error)
+      __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_kp_b__4, __pyx_v_tag, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(8, 60, __pyx_L13_except_error)
       __pyx_t_9 = (__pyx_t_10 != 0);
       if (__pyx_t_9) {
 
@@ -95396,9 +95402,9 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *         try:
  *             parser = _getattr(self, 'PARSER')
  */
-        __pyx_t_12 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyBytes_Type_split, __pyx_v_tag, __pyx_kp_b__4); if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 61, __pyx_L13_except_error)
+        __pyx_t_12 = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyBytes_Type_split, __pyx_v_tag, __pyx_kp_b__4); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 61, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_12);
-        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 61, __pyx_L13_except_error)
+        __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_12, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 61, __pyx_L13_except_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         __Pyx_DECREF_SET(__pyx_v_tag, __pyx_t_5);
@@ -95479,7 +95485,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCALL
       if (PyFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_self), __pyx_n_s_PARSER};
-        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 63, __pyx_L21_error)
+        __pyx_t_8 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 63, __pyx_L21_error)
         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_GOTREF(__pyx_t_8);
       } else
@@ -95487,13 +95493,13 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       #if CYTHON_FAST_PYCCALL
       if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
         PyObject *__pyx_temp[3] = {__pyx_t_1, ((PyObject *)__pyx_v_self), __pyx_n_s_PARSER};
-        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 63, __pyx_L21_error)
+        __pyx_t_8 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 63, __pyx_L21_error)
         __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_GOTREF(__pyx_t_8);
       } else
       #endif
       {
-        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 63, __pyx_L21_error)
+        __pyx_t_5 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 63, __pyx_L21_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;
@@ -95504,12 +95510,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_n_s_PARSER);
         __Pyx_GIVEREF(__pyx_n_s_PARSER);
         PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_7, __pyx_n_s_PARSER);
-        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(7, 63, __pyx_L21_error)
+        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 63, __pyx_L21_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       }
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(7, 63, __pyx_L21_error)
+      if (!(likely(((__pyx_t_8) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_8, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(8, 63, __pyx_L21_error)
       __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_8);
       __pyx_t_8 = 0;
 
@@ -95545,7 +95551,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree.ElementBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(7, 64, __pyx_L23_except_error)
+      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_6, &__pyx_t_5) < 0) __PYX_ERR(8, 64, __pyx_L23_except_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_5);
@@ -95571,9 +95577,9 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       for (;;) {
         if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-        __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(7, 66, __pyx_L23_except_error)
+        __pyx_t_12 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_15); __Pyx_INCREF(__pyx_t_12); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(8, 66, __pyx_L23_except_error)
         #else
-        __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(7, 66, __pyx_L23_except_error)
+        __pyx_t_12 = PySequence_ITEM(__pyx_t_1, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 66, __pyx_L23_except_error)
         __Pyx_GOTREF(__pyx_t_12);
         #endif
         __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_12);
@@ -95737,7 +95743,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_n_s_HTML};
-          __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(7, 74, __pyx_L34_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(8, 74, __pyx_L34_error)
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_GOTREF(__pyx_t_5);
         } else
@@ -95745,13 +95751,13 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
           PyObject *__pyx_temp[3] = {__pyx_t_8, ((PyObject *)__pyx_v_self), __pyx_n_s_HTML};
-          __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(7, 74, __pyx_L34_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(8, 74, __pyx_L34_error)
           __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_GOTREF(__pyx_t_5);
         } else
         #endif
         {
-          __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 74, __pyx_L34_error)
+          __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 74, __pyx_L34_error)
           __Pyx_GOTREF(__pyx_t_1);
           if (__pyx_t_8) {
             __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
@@ -95762,12 +95768,12 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
           __Pyx_INCREF(__pyx_n_s_HTML);
           __Pyx_GIVEREF(__pyx_n_s_HTML);
           PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_n_s_HTML);
-          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 74, __pyx_L34_error)
+          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 74, __pyx_L34_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         }
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(7, 74, __pyx_L34_error)
+        __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 74, __pyx_L34_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_v_is_html = __pyx_t_10;
 
@@ -95844,7 +95850,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                         attrib, nsmap, _extra)
  *         last_child = None
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__initNewElement(((struct LxmlElement *)__pyx_v_self), __pyx_v_is_html, __pyx_v_tag, __pyx_v_namespace, __pyx_v_parser, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 77, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__initNewElement(((struct LxmlElement *)__pyx_v_self), __pyx_v_is_html, __pyx_v_tag, __pyx_v_namespace, __pyx_v_parser, __pyx_v_attrib, __pyx_v_nsmap, __pyx_v__extra); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 77, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":79
  *         _initNewElement(self, is_html, tag, namespace, parser,
@@ -95867,9 +95873,9 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
   for (;;) {
     if (__pyx_t_15 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(7, 80, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_15); __Pyx_INCREF(__pyx_t_6); __pyx_t_15++; if (unlikely(0 < 0)) __PYX_ERR(8, 80, __pyx_L1_error)
     #else
-    __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 80, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(__pyx_t_5, __pyx_t_15); __pyx_t_15++; if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 80, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_6);
@@ -95903,9 +95909,9 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                 else:
  *                     _setTailText(last_child._c_node,
  */
-        __pyx_t_1 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->__pyx_base._c_node->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 84, __pyx_L1_error)
+        __pyx_t_1 = __pyx_f_4lxml_5etree__collectText(__pyx_v_self->__pyx_base._c_node->children); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 84, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(7, 84, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(8, 84, __pyx_L1_error)
         if (!__pyx_t_9) {
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         } else {
@@ -95917,7 +95923,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_kp_s__12);
         __pyx_t_6 = __pyx_kp_s__12;
         __pyx_L44_bool_binop_done:;
-        __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 84, __pyx_L1_error)
+        __pyx_t_1 = PyNumber_Add(__pyx_t_6, __pyx_v_child); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 84, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
@@ -95928,7 +95934,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                                  (_collectText(self._c_node.children) or '') + child)
  *                 else:
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base._c_node, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 83, __pyx_L1_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_self->__pyx_base._c_node, __pyx_t_1); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 83, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
         /* "src/lxml/classlookup.pxi":82
@@ -95957,9 +95963,9 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             elif isinstance(child, _Element):
  *                 last_child = child
  */
-        __pyx_t_6 = __pyx_f_4lxml_5etree__collectText(__pyx_v_last_child->_c_node->next); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 87, __pyx_L1_error)
+        __pyx_t_6 = __pyx_f_4lxml_5etree__collectText(__pyx_v_last_child->_c_node->next); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 87, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(7, 87, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(8, 87, __pyx_L1_error)
         if (!__pyx_t_9) {
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         } else {
@@ -95971,7 +95977,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
         __Pyx_INCREF(__pyx_kp_s__12);
         __pyx_t_1 = __pyx_kp_s__12;
         __pyx_L46_bool_binop_done:;
-        __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_child); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 87, __pyx_L1_error)
+        __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_v_child); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 87, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -95982,7 +95988,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                                  (_collectText(last_child._c_node.next) or '') + child)
  *             elif isinstance(child, _Element):
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_last_child->_c_node, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 86, __pyx_L1_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_last_child->_c_node, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 86, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       }
       __pyx_L43:;
@@ -96015,7 +96021,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *                 _appendChild(self, last_child)
  *             elif isinstance(child, type) and issubclass(child, ElementBase):
  */
-      if (!(likely(((__pyx_v_child) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(7, 89, __pyx_L1_error)
+      if (!(likely(((__pyx_v_child) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_child, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 89, __pyx_L1_error)
       __pyx_t_6 = __pyx_v_child;
       __Pyx_INCREF(__pyx_t_6);
       __Pyx_DECREF_SET(__pyx_v_last_child, ((struct LxmlElement *)__pyx_t_6));
@@ -96028,7 +96034,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             elif isinstance(child, type) and issubclass(child, ElementBase):
  *                 last_child = child()
  */
-      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 90, __pyx_L1_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 90, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":88
  *                     _setTailText(last_child._c_node,
@@ -96054,7 +96060,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       __pyx_t_10 = __pyx_t_16;
       goto __pyx_L48_bool_binop_done;
     }
-    __pyx_t_16 = PyObject_IsSubclass(__pyx_v_child, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(7, 91, __pyx_L1_error)
+    __pyx_t_16 = PyObject_IsSubclass(__pyx_v_child, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(8, 91, __pyx_L1_error)
     __pyx_t_9 = (__pyx_t_16 != 0);
     __pyx_t_10 = __pyx_t_9;
     __pyx_L48_bool_binop_done:;
@@ -96080,10 +96086,10 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
       }
       __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-      if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 92, __pyx_L1_error)
+      if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 92, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(7, 92, __pyx_L1_error)
+      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 92, __pyx_L1_error)
       __Pyx_DECREF_SET(__pyx_v_last_child, ((struct LxmlElement *)__pyx_t_6));
       __pyx_t_6 = 0;
 
@@ -96094,7 +96100,7 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  *             else:
  *                 raise TypeError, f"Invalid child type: {type(child)!r}"
  */
-      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 93, __pyx_L1_error)
+      __pyx_t_7 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self), __pyx_v_last_child); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 93, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":91
  *                 last_child = child
@@ -96114,14 +96120,14 @@ static int __pyx_pf_4lxml_5etree_11ElementBase___init__(struct LxmlElementBase *
  * cdef class CommentBase(_Comment):
  */
     /*else*/ {
-      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_child))), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 95, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(((PyObject *)Py_TYPE(__pyx_v_child))), __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 95, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_child_type, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 95, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Invalid_child_type, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 95, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_Raise(__pyx_builtin_TypeError, __pyx_t_1, 0, 0);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __PYX_ERR(7, 95, __pyx_L1_error)
+      __PYX_ERR(8, 95, __pyx_L1_error)
     }
     __pyx_L42:;
 
@@ -96206,7 +96212,7 @@ static int __pyx_pw_4lxml_5etree_11CommentBase_1__init__(PyObject *__pyx_v_self,
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 109, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 109, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -96217,7 +96223,7 @@ static int __pyx_pw_4lxml_5etree_11CommentBase_1__init__(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 109, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 109, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.CommentBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -96287,7 +96293,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         doc = _documentFactory(c_doc, None)
  */
   /*else*/ {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 116, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 116, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_3);
     __pyx_t_3 = 0;
@@ -96301,7 +96307,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createComment(c_doc, _xcstr(text))
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(7, 117, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(8, 117, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_4;
 
   /* "src/lxml/classlookup.pxi":118
@@ -96311,7 +96317,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         self._c_node = _createComment(c_doc, _xcstr(text))
  *         if self._c_node is NULL:
  */
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 118, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 118, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_3);
   __pyx_t_3 = 0;
@@ -96342,7 +96348,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
  *         _registerProxy(self, doc, self._c_node)
  */
-    PyErr_NoMemory(); __PYX_ERR(7, 121, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(8, 121, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":120
  *         doc = _documentFactory(c_doc, None)
@@ -96369,7 +96375,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  *         self._init()
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 123, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 123, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":124
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -96378,7 +96384,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
  * 
  * cdef class PIBase(_ProcessingInstruction):
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 124, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 124, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_7 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -96392,7 +96398,7 @@ static int __pyx_pf_4lxml_5etree_11CommentBase___init__(struct __pyx_obj_4lxml_5
   }
   __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 124, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 124, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -96468,7 +96474,7 @@ static int __pyx_pw_4lxml_5etree_6PIBase_1__init__(PyObject *__pyx_v_self, PyObj
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 139, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 139, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -96484,7 +96490,7 @@ static int __pyx_pw_4lxml_5etree_6PIBase_1__init__(PyObject *__pyx_v_self, PyObj
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 139, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 139, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.PIBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -96523,7 +96529,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         if text is None:
  *             text = b''
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 143, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 143, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF_SET(__pyx_v_target, __pyx_t_1);
   __pyx_t_1 = 0;
@@ -96567,7 +96573,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         doc = _documentFactory(c_doc, None)
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 147, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 147, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF_SET(__pyx_v_text, __pyx_t_1);
     __pyx_t_1 = 0;
@@ -96581,7 +96587,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  */
-  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(7, 148, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_4 == ((xmlDoc *)NULL))) __PYX_ERR(8, 148, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_4;
 
   /* "src/lxml/classlookup.pxi":149
@@ -96591,7 +96597,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         self._c_node = _createPI(c_doc, _xcstr(target), _xcstr(text))
  *         if self._c_node is NULL:
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 149, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 149, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -96622,7 +96628,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
  *         _registerProxy(self, doc, self._c_node)
  */
-    PyErr_NoMemory(); __PYX_ERR(7, 152, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(8, 152, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":151
  *         doc = _documentFactory(c_doc, None)
@@ -96649,7 +96655,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  *         self._init()
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 154, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 154, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":155
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -96658,7 +96664,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
  * 
  * cdef class EntityBase(_Entity):
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 155, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 155, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_7 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -96672,7 +96678,7 @@ static int __pyx_pf_4lxml_5etree_6PIBase___init__(struct __pyx_obj_4lxml_5etree_
   }
   __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 155, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 155, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -96739,7 +96745,7 @@ static int __pyx_pw_4lxml_5etree_10EntityBase_1__init__(PyObject *__pyx_v_self,
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 169, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 169, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -96750,7 +96756,7 @@ static int __pyx_pw_4lxml_5etree_10EntityBase_1__init__(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 169, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 169, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.EntityBase.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -96790,7 +96796,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         c_name = _xcstr(name_utf)
  *         if c_name[0] == c'#':
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 172, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 172, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_name_utf = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -96831,7 +96837,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         elif not _xmlNameIsValid(c_name):
  *             raise ValueError, f"Invalid entity reference: '{name}'"
  */
-      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 176, __pyx_L1_error)
+      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_t_3 = 0;
       __pyx_t_4 = 127;
@@ -96839,7 +96845,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
       __pyx_t_3 += 30;
       __Pyx_GIVEREF(__pyx_kp_u_Invalid_character_reference);
       PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_Invalid_character_reference);
-      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 176, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_4;
       __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5);
@@ -96850,12 +96856,12 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
       __pyx_t_3 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__22);
       PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u__22);
-      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 176, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 176, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_5, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __PYX_ERR(7, 176, __pyx_L1_error)
+      __PYX_ERR(8, 176, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":175
  *         c_name = _xcstr(name_utf)
@@ -96893,7 +96899,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         c_doc = _newXMLDoc()
  *         doc = _documentFactory(c_doc, None)
  */
-    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 178, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 178, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_3 = 0;
     __pyx_t_4 = 127;
@@ -96901,7 +96907,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
     __pyx_t_3 += 27;
     __Pyx_GIVEREF(__pyx_kp_u_Invalid_entity_reference);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u_Invalid_entity_reference);
-    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 178, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_FormatSimple(__pyx_v_name, __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 178, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_4 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_4) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_4;
     __pyx_t_3 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
@@ -96912,12 +96918,12 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
     __pyx_t_3 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__22);
     PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__22);
-    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 178, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_5, 3, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 178, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_1, 0, 0);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __PYX_ERR(7, 178, __pyx_L1_error)
+    __PYX_ERR(8, 178, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":177
  *             if not _characterReferenceIsValid(c_name + 1):
@@ -96936,7 +96942,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         doc = _documentFactory(c_doc, None)
  *         self._c_node = _createEntity(c_doc, c_name)
  */
-  __pyx_t_6 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(7, 179, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_6 == ((xmlDoc *)NULL))) __PYX_ERR(8, 179, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_6;
 
   /* "src/lxml/classlookup.pxi":180
@@ -96946,7 +96952,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         self._c_node = _createEntity(c_doc, c_name)
  *         if self._c_node is NULL:
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 180, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 180, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -96977,7 +96983,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
  *         _registerProxy(self, doc, self._c_node)
  */
-    PyErr_NoMemory(); __PYX_ERR(7, 183, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(8, 183, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":182
  *         doc = _documentFactory(c_doc, None)
@@ -97004,7 +97010,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  *         self._init()
  * 
  */
-  __pyx_t_7 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(7, 185, __pyx_L1_error)
+  __pyx_t_7 = __pyx_f_4lxml_5etree__registerProxy(((struct LxmlElement *)__pyx_v_self), __pyx_v_doc, __pyx_v_self->__pyx_base.__pyx_base.__pyx_base._c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 185, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":186
  *         tree.xmlAddChild(<xmlNode*>c_doc, self._c_node)
@@ -97013,7 +97019,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
  * 
  * 
  */
-  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 186, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 186, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -97027,7 +97033,7 @@ static int __pyx_pf_4lxml_5etree_10EntityBase___init__(struct __pyx_obj_4lxml_5e
   }
   __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 186, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 186, __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;
@@ -97180,14 +97186,14 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
     #ifndef CYTHON_WITHOUT_ASSERTIONS
     if (unlikely(!Py_OptimizeFlag)) {
       if (unlikely(!0)) {
-        __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 199, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 199, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_node_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 199, __pyx_L1_error)
+        __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_node_type, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 199, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         PyErr_SetObject(PyExc_AssertionError, __pyx_t_2);
         __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-        __PYX_ERR(7, 199, __pyx_L1_error)
+        __PYX_ERR(8, 199, __pyx_L1_error)
       }
     }
     #endif
@@ -97208,8 +97214,8 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
     __pyx_t_3 = __pyx_t_5;
     goto __pyx_L4_bool_binop_done;
   }
-  if (unlikely(!__pyx_v_expected)) { __Pyx_RaiseUnboundLocalError("expected"); __PYX_ERR(7, 201, __pyx_L1_error) }
-  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_cls, ((PyObject *)__pyx_v_expected)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 201, __pyx_L1_error)
+  if (unlikely(!__pyx_v_expected)) { __Pyx_RaiseUnboundLocalError("expected"); __PYX_ERR(8, 201, __pyx_L1_error) }
+  __pyx_t_5 = PyObject_IsSubclass(__pyx_v_cls, ((PyObject *)__pyx_v_expected)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 201, __pyx_L1_error)
   __pyx_t_4 = (__pyx_t_5 != 0);
   __pyx_t_3 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
@@ -97223,7 +97229,7 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
  *     return 0
  * 
  */
-    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 203, __pyx_L1_error)
+    __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_6 = 0;
     __pyx_t_7 = 127;
@@ -97231,8 +97237,8 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
     __pyx_t_6 += 43;
     __Pyx_GIVEREF(__pyx_kp_u_result_of_class_lookup_must_be_s);
     PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_result_of_class_lookup_must_be_s);
-    if (unlikely(!__pyx_v_expected)) { __Pyx_RaiseUnboundLocalError("expected"); __PYX_ERR(7, 203, __pyx_L1_error) }
-    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_expected))), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 203, __pyx_L1_error)
+    if (unlikely(!__pyx_v_expected)) { __Pyx_RaiseUnboundLocalError("expected"); __PYX_ERR(8, 203, __pyx_L1_error) }
+    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_expected))), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
     __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
@@ -97243,14 +97249,14 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
     __pyx_t_6 += 6;
     __Pyx_GIVEREF(__pyx_kp_u_got);
     PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_got);
-    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_cls)), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 203, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_cls)), __pyx_empty_unicode); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_1) : __pyx_t_7;
     __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 203, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_2, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 203, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
@@ -97261,12 +97267,12 @@ static int __pyx_f_4lxml_5etree__validateNodeClass(xmlNode *__pyx_v_c_node, PyOb
  *             f"result of class lookup must be subclass of {type(expected)}, got {type(cls)}")
  *     return 0
  */
-    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 202, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 202, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(7, 202, __pyx_L1_error)
+    __PYX_ERR(8, 202, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":201
  *         assert False, f"Unknown node type: {c_node.type}"
@@ -97399,7 +97405,7 @@ static int __pyx_pw_4lxml_5etree_26FallbackElementClassLookup_3__init__(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 234, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 234, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -97413,13 +97419,13 @@ static int __pyx_pw_4lxml_5etree_26FallbackElementClassLookup_3__init__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 234, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 234, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(7, 234, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 234, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_2__init__(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), __pyx_v_fallback);
 
   /* function exit code */
@@ -97590,7 +97596,7 @@ static PyObject *__pyx_pw_4lxml_5etree_26FallbackElementClassLookup_5set_fallbac
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("set_fallback (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup", 0))) __PYX_ERR(7, 248, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup", 0))) __PYX_ERR(8, 248, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_26FallbackElementClassLookup_4set_fallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_self), ((struct LxmlElementClassLookup *)__pyx_v_lookup));
 
   /* function exit code */
@@ -97696,7 +97702,7 @@ static CYTHON_INLINE PyObject *__pyx_f_4lxml_5etree__callLookupFallback(struct L
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_1 = ((PyObject *)__pyx_v_lookup->fallback);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_v_lookup->_fallback_function(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 257, __pyx_L1_error)
+  __pyx_t_2 = __pyx_v_lookup->_fallback_function(__pyx_t_1, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 257, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
@@ -97845,7 +97851,7 @@ static int __pyx_pw_4lxml_5etree_25ElementDefaultClassLookup_3__init__(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 278, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 278, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -97868,7 +97874,7 @@ static int __pyx_pw_4lxml_5etree_25ElementDefaultClassLookup_3__init__(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 278, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 278, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.ElementDefaultClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -97932,7 +97938,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  *             self.element_class = element
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_element, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 281, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_element, ((PyObject *)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 281, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (likely(__pyx_t_1)) {
 
@@ -97968,7 +97974,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_element_class_must_be_subclass_o, 0, 0);
-    __PYX_ERR(7, 284, __pyx_L1_error)
+    __PYX_ERR(8, 284, __pyx_L1_error)
   }
   __pyx_L3:;
 
@@ -98013,7 +98019,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  *             self.comment_class = comment
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_comment, ((PyObject *)__pyx_ptype_4lxml_5etree_CommentBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 288, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_comment, ((PyObject *)__pyx_ptype_4lxml_5etree_CommentBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 288, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (likely(__pyx_t_1)) {
 
@@ -98049,7 +98055,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_comment_class_must_be_subclass_o, 0, 0);
-    __PYX_ERR(7, 291, __pyx_L1_error)
+    __PYX_ERR(8, 291, __pyx_L1_error)
   }
   __pyx_L4:;
 
@@ -98094,7 +98100,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  *             self.entity_class = entity
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_entity, ((PyObject *)__pyx_ptype_4lxml_5etree_EntityBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 295, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_entity, ((PyObject *)__pyx_ptype_4lxml_5etree_EntityBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 295, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (likely(__pyx_t_1)) {
 
@@ -98130,7 +98136,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_Entity_class_must_be_subclass_of, 0, 0);
-    __PYX_ERR(7, 298, __pyx_L1_error)
+    __PYX_ERR(8, 298, __pyx_L1_error)
   }
   __pyx_L5:;
 
@@ -98175,7 +98181,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  *             self.pi_class = pi
  *         else:
  */
-  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_pi, ((PyObject *)__pyx_ptype_4lxml_5etree_PIBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(7, 302, __pyx_L1_error)
+  __pyx_t_2 = PyObject_IsSubclass(__pyx_v_pi, ((PyObject *)__pyx_ptype_4lxml_5etree_PIBase)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(8, 302, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (likely(__pyx_t_1)) {
 
@@ -98211,7 +98217,7 @@ static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup_2__init__(struct __
  */
   /*else*/ {
     __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_u_PI_class_must_be_subclass_of_PIB, 0, 0);
-    __PYX_ERR(7, 305, __pyx_L1_error)
+    __PYX_ERR(8, 305, __pyx_L1_error)
   }
   __pyx_L6:;
 
@@ -98757,14 +98763,14 @@ static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx
     #ifndef CYTHON_WITHOUT_ASSERTIONS
     if (unlikely(!Py_OptimizeFlag)) {
       if (unlikely(!0)) {
-        __pyx_t_4 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 336, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyUnicode_From_xmlElementType(__pyx_v_c_node->type, 0, ' ', 'd'); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 336, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_node_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(7, 336, __pyx_L1_error)
+        __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Unknown_node_type, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 336, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         PyErr_SetObject(PyExc_AssertionError, __pyx_t_5);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __PYX_ERR(7, 336, __pyx_L1_error)
+        __PYX_ERR(8, 336, __pyx_L1_error)
       }
     }
     #endif
@@ -98899,7 +98905,7 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_class_mapping)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(7, 362, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(8, 362, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -98909,7 +98915,7 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(7, 362, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(8, 362, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -98927,13 +98933,13 @@ static int __pyx_pw_4lxml_5etree_32AttributeBasedElementClassLookup_3__init__(Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 362, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 362, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.AttributeBasedElementClassLookup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(7, 363, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback", 0))) __PYX_ERR(8, 363, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self), __pyx_v_attribute_name, __pyx_v_class_mapping, __pyx_v_fallback);
 
   /* "src/lxml/classlookup.pxi":362
@@ -98977,7 +98983,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
  *         ns, name = self._pytag
  *         if ns is None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 364, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 364, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_pytag);
@@ -99000,7 +99006,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(7, 365, __pyx_L1_error)
+      __PYX_ERR(8, 365, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
@@ -99008,14 +99014,14 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     __Pyx_INCREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 365, __pyx_L1_error)
+    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 365, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 365, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(7, 365, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(8, 365, __pyx_L1_error)
   }
   __pyx_v_ns = __pyx_t_2;
   __pyx_t_2 = 0;
@@ -99080,7 +99086,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
  * 
  *         FallbackElementClassLookup.__init__(self, fallback)
  */
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_class_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 371, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_class_mapping); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 371, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_class_mapping);
@@ -99095,7 +99101,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
  * 
  * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 373, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 373, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_2 = NULL;
   __pyx_t_6 = 0;
@@ -99112,7 +99118,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 373, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -99120,13 +99126,13 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_fallback)};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 373, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(7, 373, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 373, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     if (__pyx_t_2) {
       __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2); __pyx_t_2 = NULL;
@@ -99137,7 +99143,7 @@ static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup_2__init__(st
     __Pyx_INCREF(((PyObject *)__pyx_v_fallback));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_fallback));
     PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, ((PyObject *)__pyx_v_fallback));
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 373, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 373, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -99221,7 +99227,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  *             c_node, lookup._c_ns, lookup._c_name)
  *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node, __pyx_v_lookup->_c_ns, __pyx_v_lookup->_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 381, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node, __pyx_v_lookup->_c_ns, __pyx_v_lookup->_c_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 381, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_value = __pyx_t_1;
     __pyx_t_1 = 0;
@@ -99267,7 +99273,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  *             return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-      __pyx_t_3 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(7, 386, __pyx_L1_error)
+      __pyx_t_3 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(8, 386, __pyx_L1_error)
 
       /* "src/lxml/classlookup.pxi":387
  *             cls = <object>dict_result
@@ -99307,7 +99313,7 @@ static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 388, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 388, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -99444,7 +99450,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
  *             doc._parser._class_lookup, doc, c_node)
  *     return _callLookupFallback(<FallbackElementClassLookup>state, doc, c_node)
  */
-    __pyx_t_4 = __pyx_v_doc->_parser->_class_lookup->_lookup_function(__pyx_t_3, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 403, __pyx_L1_error)
+    __pyx_t_4 = __pyx_v_doc->_parser->_class_lookup->_lookup_function(__pyx_t_3, __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 403, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_4;
@@ -99468,7 +99474,7 @@ static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_sta
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(7, 405, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 405, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
@@ -99596,23 +99602,23 @@ static PyObject *__pyx_pw_4lxml_5etree_24CustomElementClassLookup_3lookup(PyObje
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_doc_2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); __PYX_ERR(7, 430, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 1); __PYX_ERR(8, 430, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_namespace)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); __PYX_ERR(7, 430, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 2); __PYX_ERR(8, 430, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name_2)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); __PYX_ERR(7, 430, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, 3); __PYX_ERR(8, 430, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(7, 430, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 430, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -99629,7 +99635,7 @@ static PyObject *__pyx_pw_4lxml_5etree_24CustomElementClassLookup_3lookup(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 430, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("lookup", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 430, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.CustomElementClassLookup.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -99854,7 +99860,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *     ns = funicode(c_str) if c_str is not NULL else None
  */
   /*else*/ {
-    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 452, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 452, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_name = __pyx_t_1;
     __pyx_t_1 = 0;
@@ -99878,7 +99884,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *     cls = lookup.lookup(element_type, doc, ns, name)
  */
   if (((__pyx_v_c_str != NULL) != 0)) {
-    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 454, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_str); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 454, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -99896,7 +99902,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *     if cls is not None:
  *         _validateNodeClass(c_node, cls)
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(7, 456, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 456, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = NULL;
   __pyx_t_5 = 0;
@@ -99913,7 +99919,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_element_type, ((PyObject *)__pyx_v_doc), __pyx_v_ns, __pyx_v_name};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 456, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 456, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -99921,13 +99927,13 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
     PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_v_element_type, ((PyObject *)__pyx_v_doc), __pyx_v_ns, __pyx_v_name};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 456, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 456, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(7, 456, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 456, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_4) {
       __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -99944,7 +99950,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(__pyx_v_name);
     __Pyx_GIVEREF(__pyx_v_name);
     PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_name);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 456, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 456, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -99970,7 +99976,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(7, 458, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 458, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":459
  *     if cls is not None:
@@ -100001,7 +100007,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
  * 
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 460, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 460, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -100035,7 +100041,7 @@ static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_sta
 }
 
 /* "src/lxml/classlookup.pxi":509
- *     See http://codespeak.net/lxml/element_classes.html
+ *     See https://lxml.de/element_classes.html
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
  *         self._lookup_function = _python_class_lookup
@@ -100073,7 +100079,7 @@ static int __pyx_pf_4lxml_5etree_24PythonElementClassLookup___cinit__(struct __p
   __pyx_v_self->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__python_class_lookup;
 
   /* "src/lxml/classlookup.pxi":509
- *     See http://codespeak.net/lxml/element_classes.html
+ *     See https://lxml.de/element_classes.html
  *     """
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
  *         self._lookup_function = _python_class_lookup
@@ -100130,11 +100136,11 @@ static PyObject *__pyx_pw_4lxml_5etree_24PythonElementClassLookup_3lookup(PyObje
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(7, 512, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, 1); __PYX_ERR(8, 512, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(7, 512, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lookup") < 0)) __PYX_ERR(8, 512, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -100147,7 +100153,7 @@ static PyObject *__pyx_pw_4lxml_5etree_24PythonElementClassLookup_3lookup(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 512, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("lookup", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 512, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.PythonElementClassLookup.lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -100236,7 +100242,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  *     cls = lookup.lookup(doc, proxy)
  *     _freeReadOnlyProxies(proxy)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)Py_None), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 524, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newReadOnlyProxy(((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)Py_None), __pyx_v_c_node)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 524, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_proxy = ((struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -100248,7 +100254,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  *     _freeReadOnlyProxies(proxy)
  * 
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 525, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_lookup), __pyx_n_s_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -100265,7 +100271,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_doc), ((PyObject *)__pyx_v_proxy)};
-    __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(7, 525, __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(8, 525, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -100273,13 +100279,13 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_doc), ((PyObject *)__pyx_v_proxy)};
-    __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(7, 525, __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(8, 525, __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(7, 525, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 525, __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;
@@ -100290,7 +100296,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
     __Pyx_INCREF(((PyObject *)__pyx_v_proxy));
     __Pyx_GIVEREF(((PyObject *)__pyx_v_proxy));
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, ((PyObject *)__pyx_v_proxy));
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 525, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 525, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -100305,7 +100311,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  * 
  *     if cls is not None:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(__pyx_v_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 526, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__freeReadOnlyProxies(__pyx_v_proxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 526, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -100327,7 +100333,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  *         return cls
  *     return _callLookupFallback(lookup, doc, c_node)
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(7, 529, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__validateNodeClass(__pyx_v_c_node, __pyx_v_cls); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 529, __pyx_L1_error)
 
     /* "src/lxml/classlookup.pxi":530
  *     if cls is not None:
@@ -100358,7 +100364,7 @@ static PyObject *__pyx_f_4lxml_5etree__python_class_lookup(PyObject *__pyx_v_sta
  * ################################################################################
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 531, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__callLookupFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup), __pyx_v_doc, __pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 531, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -100519,7 +100525,7 @@ static PyObject *__pyx_pw_4lxml_5etree_43set_element_class_lookup(PyObject *__py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_element_class_lookup") < 0)) __PYX_ERR(7, 549, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_element_class_lookup") < 0)) __PYX_ERR(8, 549, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -100533,13 +100539,13 @@ static PyObject *__pyx_pw_4lxml_5etree_43set_element_class_lookup(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(7, 549, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_element_class_lookup", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 549, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.set_element_class_lookup", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) __PYX_ERR(7, 549, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup", 0))) __PYX_ERR(8, 549, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_42set_element_class_lookup(__pyx_self, __pyx_v_lookup);
 
   /* function exit code */
@@ -126563,7 +126569,7 @@ static struct LxmlDocument *__pyx_f_4lxml_5etree__parseFilelikeDocument(PyObject
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":22
+/* "src/lxml/saxparser.pxi":31
  * 
  * 
  * cdef int _buildParseEventFilter(events) except -1:             # <<<<<<<<<<<<<<
@@ -126589,7 +126595,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_buildParseEventFilter", 0);
 
-  /* "src/lxml/saxparser.pxi":24
+  /* "src/lxml/saxparser.pxi":33
  * cdef int _buildParseEventFilter(events) except -1:
  *     cdef int event_filter
  *     event_filter = 0             # <<<<<<<<<<<<<<
@@ -126598,7 +126604,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
   __pyx_v_event_filter = 0;
 
-  /* "src/lxml/saxparser.pxi":25
+  /* "src/lxml/saxparser.pxi":34
  *     cdef int event_filter
  *     event_filter = 0
  *     for event in events:             # <<<<<<<<<<<<<<
@@ -126609,26 +126615,26 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
     __pyx_t_1 = __pyx_v_events; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
     __pyx_t_3 = NULL;
   } else {
-    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 25, __pyx_L1_error)
+    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_events); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 34, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 25, __pyx_L1_error)
+    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 34, __pyx_L1_error)
   }
   for (;;) {
     if (likely(!__pyx_t_3)) {
       if (likely(PyList_CheckExact(__pyx_t_1))) {
         if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(8, 25, __pyx_L1_error)
+        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 34, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 25, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 34, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       } else {
         if (__pyx_t_2 >= 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_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(8, 25, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 34, __pyx_L1_error)
         #else
-        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 25, __pyx_L1_error)
+        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 34, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         #endif
       }
@@ -126638,7 +126644,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
         PyObject* exc_type = PyErr_Occurred();
         if (exc_type) {
           if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-          else __PYX_ERR(8, 25, __pyx_L1_error)
+          else __PYX_ERR(3, 34, __pyx_L1_error)
         }
         break;
       }
@@ -126647,17 +126653,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
     __Pyx_XDECREF_SET(__pyx_v_event, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/saxparser.pxi":26
+    /* "src/lxml/saxparser.pxi":35
  *     event_filter = 0
  *     for event in events:
  *         if event == 'start':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_START
  *         elif event == 'end':
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_start, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 26, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_start, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 35, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "src/lxml/saxparser.pxi":27
+      /* "src/lxml/saxparser.pxi":36
  *     for event in events:
  *         if event == 'start':
  *             event_filter |= PARSE_EVENT_FILTER_START             # <<<<<<<<<<<<<<
@@ -126666,7 +126672,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START);
 
-      /* "src/lxml/saxparser.pxi":26
+      /* "src/lxml/saxparser.pxi":35
  *     event_filter = 0
  *     for event in events:
  *         if event == 'start':             # <<<<<<<<<<<<<<
@@ -126676,17 +126682,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":28
+    /* "src/lxml/saxparser.pxi":37
  *         if event == 'start':
  *             event_filter |= PARSE_EVENT_FILTER_START
  *         elif event == 'end':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_END
  *         elif event == 'start-ns':
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_end, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 28, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_end, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 37, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "src/lxml/saxparser.pxi":29
+      /* "src/lxml/saxparser.pxi":38
  *             event_filter |= PARSE_EVENT_FILTER_START
  *         elif event == 'end':
  *             event_filter |= PARSE_EVENT_FILTER_END             # <<<<<<<<<<<<<<
@@ -126695,7 +126701,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END);
 
-      /* "src/lxml/saxparser.pxi":28
+      /* "src/lxml/saxparser.pxi":37
  *         if event == 'start':
  *             event_filter |= PARSE_EVENT_FILTER_START
  *         elif event == 'end':             # <<<<<<<<<<<<<<
@@ -126705,17 +126711,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":30
+    /* "src/lxml/saxparser.pxi":39
  *         elif event == 'end':
  *             event_filter |= PARSE_EVENT_FILTER_END
  *         elif event == 'start-ns':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_START_NS
  *         elif event == 'end-ns':
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_kp_s_start_ns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 30, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_kp_s_start_ns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 39, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "src/lxml/saxparser.pxi":31
+      /* "src/lxml/saxparser.pxi":40
  *             event_filter |= PARSE_EVENT_FILTER_END
  *         elif event == 'start-ns':
  *             event_filter |= PARSE_EVENT_FILTER_START_NS             # <<<<<<<<<<<<<<
@@ -126724,7 +126730,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START_NS);
 
-      /* "src/lxml/saxparser.pxi":30
+      /* "src/lxml/saxparser.pxi":39
  *         elif event == 'end':
  *             event_filter |= PARSE_EVENT_FILTER_END
  *         elif event == 'start-ns':             # <<<<<<<<<<<<<<
@@ -126734,17 +126740,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":32
+    /* "src/lxml/saxparser.pxi":41
  *         elif event == 'start-ns':
  *             event_filter |= PARSE_EVENT_FILTER_START_NS
  *         elif event == 'end-ns':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_END_NS
  *         elif event == 'comment':
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_kp_s_end_ns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 32, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_kp_s_end_ns, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 41, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "src/lxml/saxparser.pxi":33
+      /* "src/lxml/saxparser.pxi":42
  *             event_filter |= PARSE_EVENT_FILTER_START_NS
  *         elif event == 'end-ns':
  *             event_filter |= PARSE_EVENT_FILTER_END_NS             # <<<<<<<<<<<<<<
@@ -126753,7 +126759,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END_NS);
 
-      /* "src/lxml/saxparser.pxi":32
+      /* "src/lxml/saxparser.pxi":41
  *         elif event == 'start-ns':
  *             event_filter |= PARSE_EVENT_FILTER_START_NS
  *         elif event == 'end-ns':             # <<<<<<<<<<<<<<
@@ -126763,17 +126769,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":34
+    /* "src/lxml/saxparser.pxi":43
  *         elif event == 'end-ns':
  *             event_filter |= PARSE_EVENT_FILTER_END_NS
  *         elif event == 'comment':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_COMMENT
  *         elif event == 'pi':
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_comment, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 34, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_comment, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 43, __pyx_L1_error)
     if (__pyx_t_5) {
 
-      /* "src/lxml/saxparser.pxi":35
+      /* "src/lxml/saxparser.pxi":44
  *             event_filter |= PARSE_EVENT_FILTER_END_NS
  *         elif event == 'comment':
  *             event_filter |= PARSE_EVENT_FILTER_COMMENT             # <<<<<<<<<<<<<<
@@ -126782,7 +126788,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_COMMENT);
 
-      /* "src/lxml/saxparser.pxi":34
+      /* "src/lxml/saxparser.pxi":43
  *         elif event == 'end-ns':
  *             event_filter |= PARSE_EVENT_FILTER_END_NS
  *         elif event == 'comment':             # <<<<<<<<<<<<<<
@@ -126792,17 +126798,17 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":36
+    /* "src/lxml/saxparser.pxi":45
  *         elif event == 'comment':
  *             event_filter |= PARSE_EVENT_FILTER_COMMENT
  *         elif event == 'pi':             # <<<<<<<<<<<<<<
  *             event_filter |= PARSE_EVENT_FILTER_PI
  *         else:
  */
-    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_pi, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(8, 36, __pyx_L1_error)
+    __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_event, __pyx_n_s_pi, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 45, __pyx_L1_error)
     if (likely(__pyx_t_5)) {
 
-      /* "src/lxml/saxparser.pxi":37
+      /* "src/lxml/saxparser.pxi":46
  *             event_filter |= PARSE_EVENT_FILTER_COMMENT
  *         elif event == 'pi':
  *             event_filter |= PARSE_EVENT_FILTER_PI             # <<<<<<<<<<<<<<
@@ -126811,7 +126817,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  */
       __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_PI);
 
-      /* "src/lxml/saxparser.pxi":36
+      /* "src/lxml/saxparser.pxi":45
  *         elif event == 'comment':
  *             event_filter |= PARSE_EVENT_FILTER_COMMENT
  *         elif event == 'pi':             # <<<<<<<<<<<<<<
@@ -126821,7 +126827,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       goto __pyx_L5;
     }
 
-    /* "src/lxml/saxparser.pxi":39
+    /* "src/lxml/saxparser.pxi":48
  *             event_filter |= PARSE_EVENT_FILTER_PI
  *         else:
  *             raise ValueError, f"invalid event name '{event}'"             # <<<<<<<<<<<<<<
@@ -126829,7 +126835,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
  * 
  */
     /*else*/ {
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 39, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 48, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_6 = 0;
       __pyx_t_7 = 127;
@@ -126837,7 +126843,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       __pyx_t_6 += 20;
       __Pyx_GIVEREF(__pyx_kp_u_invalid_event_name);
       PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_invalid_event_name);
-      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_event, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 39, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_event, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 48, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
       __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
@@ -126848,16 +126854,16 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
       __pyx_t_6 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__22);
       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__22);
-      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 39, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 48, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_8, 0, 0);
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-      __PYX_ERR(8, 39, __pyx_L1_error)
+      __PYX_ERR(3, 48, __pyx_L1_error)
     }
     __pyx_L5:;
 
-    /* "src/lxml/saxparser.pxi":25
+    /* "src/lxml/saxparser.pxi":34
  *     cdef int event_filter
  *     event_filter = 0
  *     for event in events:             # <<<<<<<<<<<<<<
@@ -126867,7 +126873,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":40
+  /* "src/lxml/saxparser.pxi":49
  *         else:
  *             raise ValueError, f"invalid event name '{event}'"
  *     return event_filter             # <<<<<<<<<<<<<<
@@ -126877,7 +126883,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
   __pyx_r = __pyx_v_event_filter;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":22
+  /* "src/lxml/saxparser.pxi":31
  * 
  * 
  * cdef int _buildParseEventFilter(events) except -1:             # <<<<<<<<<<<<<<
@@ -126898,7 +126904,7 @@ static int __pyx_f_4lxml_5etree__buildParseEventFilter(PyObject *__pyx_v_events)
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":45
+/* "src/lxml/saxparser.pxi":54
  * cdef class _SaxParserTarget:
  *     cdef int _sax_event_filter
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -126927,7 +126933,7 @@ static int __pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(struct __pyx_obj_4
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/saxparser.pxi":46
+  /* "src/lxml/saxparser.pxi":55
  *     cdef int _sax_event_filter
  *     def __cinit__(self):
  *         self._sax_event_filter = 0             # <<<<<<<<<<<<<<
@@ -126936,7 +126942,7 @@ static int __pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(struct __pyx_obj_4
  */
   __pyx_v_self->_sax_event_filter = 0;
 
-  /* "src/lxml/saxparser.pxi":45
+  /* "src/lxml/saxparser.pxi":54
  * cdef class _SaxParserTarget:
  *     cdef int _sax_event_filter
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -126950,7 +126956,7 @@ static int __pyx_pf_4lxml_5etree_16_SaxParserTarget___cinit__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":48
+/* "src/lxml/saxparser.pxi":57
  *         self._sax_event_filter = 0
  * 
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
@@ -126963,7 +126969,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart(CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxStart", 0);
 
-  /* "src/lxml/saxparser.pxi":49
+  /* "src/lxml/saxparser.pxi":58
  * 
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         return None             # <<<<<<<<<<<<<<
@@ -126974,7 +126980,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart(CYTHON_
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":48
+  /* "src/lxml/saxparser.pxi":57
  *         self._sax_event_filter = 0
  * 
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
@@ -126989,7 +126995,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart(CYTHON_
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":50
+/* "src/lxml/saxparser.pxi":59
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         return None
  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
@@ -127002,7 +127008,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd(CYTHON_UN
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxEnd", 0);
 
-  /* "src/lxml/saxparser.pxi":51
+  /* "src/lxml/saxparser.pxi":60
  *         return None
  *     cdef _handleSaxEnd(self, tag):
  *         return None             # <<<<<<<<<<<<<<
@@ -127013,7 +127019,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd(CYTHON_UN
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":50
+  /* "src/lxml/saxparser.pxi":59
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         return None
  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
@@ -127028,7 +127034,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd(CYTHON_UN
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":52
+/* "src/lxml/saxparser.pxi":61
  *     cdef _handleSaxEnd(self, tag):
  *         return None
  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
@@ -127041,7 +127047,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData(CYTHON_UNUSED
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxData", 0);
 
-  /* "src/lxml/saxparser.pxi":53
+  /* "src/lxml/saxparser.pxi":62
  *         return None
  *     cdef int _handleSaxData(self, data) except -1:
  *         return 0             # <<<<<<<<<<<<<<
@@ -127051,7 +127057,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData(CYTHON_UNUSED
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":52
+  /* "src/lxml/saxparser.pxi":61
  *     cdef _handleSaxEnd(self, tag):
  *         return None
  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
@@ -127065,7 +127071,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":54
+/* "src/lxml/saxparser.pxi":63
  *     cdef int _handleSaxData(self, data) except -1:
  *         return 0
  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<<
@@ -127078,7 +127084,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype(CYTHON_UNUS
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxDoctype", 0);
 
-  /* "src/lxml/saxparser.pxi":55
+  /* "src/lxml/saxparser.pxi":64
  *         return 0
  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
  *         return 0             # <<<<<<<<<<<<<<
@@ -127088,7 +127094,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype(CYTHON_UNUS
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":54
+  /* "src/lxml/saxparser.pxi":63
  *     cdef int _handleSaxData(self, data) except -1:
  *         return 0
  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<<
@@ -127102,7 +127108,7 @@ static int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype(CYTHON_UNUS
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":56
+/* "src/lxml/saxparser.pxi":65
  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
  *         return 0
  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
@@ -127115,7 +127121,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi(CYTHON_UNU
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxPi", 0);
 
-  /* "src/lxml/saxparser.pxi":57
+  /* "src/lxml/saxparser.pxi":66
  *         return 0
  *     cdef _handleSaxPi(self, target, data):
  *         return None             # <<<<<<<<<<<<<<
@@ -127126,7 +127132,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi(CYTHON_UNU
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":56
+  /* "src/lxml/saxparser.pxi":65
  *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
  *         return 0
  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
@@ -127141,7 +127147,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi(CYTHON_UNU
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":58
+/* "src/lxml/saxparser.pxi":67
  *     cdef _handleSaxPi(self, target, data):
  *         return None
  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
@@ -127154,7 +127160,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment(CYTHO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxComment", 0);
 
-  /* "src/lxml/saxparser.pxi":59
+  /* "src/lxml/saxparser.pxi":68
  *         return None
  *     cdef _handleSaxComment(self, comment):
  *         return None             # <<<<<<<<<<<<<<
@@ -127165,7 +127171,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment(CYTHO
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":58
+  /* "src/lxml/saxparser.pxi":67
  *     cdef _handleSaxPi(self, target, data):
  *         return None
  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
@@ -127180,7 +127186,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment(CYTHO
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":60
+/* "src/lxml/saxparser.pxi":69
  *     cdef _handleSaxComment(self, comment):
  *         return None
  *     cdef _handleSaxStartNs(self, prefix, uri):             # <<<<<<<<<<<<<<
@@ -127193,7 +127199,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStartNs(CYTHO
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxStartNs", 0);
 
-  /* "src/lxml/saxparser.pxi":61
+  /* "src/lxml/saxparser.pxi":70
  *         return None
  *     cdef _handleSaxStartNs(self, prefix, uri):
  *         return None             # <<<<<<<<<<<<<<
@@ -127204,7 +127210,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStartNs(CYTHO
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":60
+  /* "src/lxml/saxparser.pxi":69
  *     cdef _handleSaxComment(self, comment):
  *         return None
  *     cdef _handleSaxStartNs(self, prefix, uri):             # <<<<<<<<<<<<<<
@@ -127219,7 +127225,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStartNs(CYTHO
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":62
+/* "src/lxml/saxparser.pxi":71
  *     cdef _handleSaxStartNs(self, prefix, uri):
  *         return None
  *     cdef _handleSaxEndNs(self, prefix):             # <<<<<<<<<<<<<<
@@ -127232,7 +127238,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEndNs(CYTHON_
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_handleSaxEndNs", 0);
 
-  /* "src/lxml/saxparser.pxi":63
+  /* "src/lxml/saxparser.pxi":72
  *         return None
  *     cdef _handleSaxEndNs(self, prefix):
  *         return None             # <<<<<<<<<<<<<<
@@ -127243,7 +127249,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEndNs(CYTHON_
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":62
+  /* "src/lxml/saxparser.pxi":71
  *     cdef _handleSaxStartNs(self, prefix, uri):
  *         return None
  *     cdef _handleSaxEndNs(self, prefix):             # <<<<<<<<<<<<<<
@@ -127258,7 +127264,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEndNs(CYTHON_
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":95
+/* "src/lxml/saxparser.pxi":104
  *     cdef _MultiTagMatcher _matcher
  * 
  *     def __cinit__(self, _BaseParser parser):             # <<<<<<<<<<<<<<
@@ -127295,7 +127301,7 @@ static int __pyx_pw_4lxml_5etree_17_SaxParserContext_1__cinit__(PyObject *__pyx_
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(8, 95, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 104, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -127306,13 +127312,13 @@ static int __pyx_pw_4lxml_5etree_17_SaxParserContext_1__cinit__(PyObject *__pyx_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 95, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 104, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._SaxParserContext.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(8, 95, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser", 0))) __PYX_ERR(3, 104, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_v_self), __pyx_v_parser);
 
   /* function exit code */
@@ -127333,14 +127339,14 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/saxparser.pxi":96
+  /* "src/lxml/saxparser.pxi":105
  * 
  *     def __cinit__(self, _BaseParser parser):
  *         self._ns_stack = []             # <<<<<<<<<<<<<<
  *         self._node_stack = []
  *         self._parser = parser
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 96, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_ns_stack);
@@ -127348,14 +127354,14 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   __pyx_v_self->_ns_stack = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":97
+  /* "src/lxml/saxparser.pxi":106
  *     def __cinit__(self, _BaseParser parser):
  *         self._ns_stack = []
  *         self._node_stack = []             # <<<<<<<<<<<<<<
  *         self._parser = parser
  *         self.events_iterator = _ParseEventsIterator()
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 97, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_node_stack);
@@ -127363,7 +127369,7 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   __pyx_v_self->_node_stack = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":98
+  /* "src/lxml/saxparser.pxi":107
  *         self._ns_stack = []
  *         self._node_stack = []
  *         self._parser = parser             # <<<<<<<<<<<<<<
@@ -127376,14 +127382,14 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_parser));
   __pyx_v_self->_parser = __pyx_v_parser;
 
-  /* "src/lxml/saxparser.pxi":99
+  /* "src/lxml/saxparser.pxi":108
  *         self._node_stack = []
  *         self._parser = parser
  *         self.events_iterator = _ParseEventsIterator()             # <<<<<<<<<<<<<<
  * 
  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ParseEventsIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 99, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ParseEventsIterator)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 108, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->events_iterator);
@@ -127391,7 +127397,7 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   __pyx_v_self->events_iterator = ((struct __pyx_obj_4lxml_5etree__ParseEventsIterator *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":95
+  /* "src/lxml/saxparser.pxi":104
  *     cdef _MultiTagMatcher _matcher
  * 
  *     def __cinit__(self, _BaseParser parser):             # <<<<<<<<<<<<<<
@@ -127411,7 +127417,7 @@ static int __pyx_pf_4lxml_5etree_17_SaxParserContext___cinit__(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":101
+/* "src/lxml/saxparser.pxi":110
  *         self.events_iterator = _ParseEventsIterator()
  * 
  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):             # <<<<<<<<<<<<<<
@@ -127423,7 +127429,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget(struct
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_setSaxParserTarget", 0);
 
-  /* "src/lxml/saxparser.pxi":102
+  /* "src/lxml/saxparser.pxi":111
  * 
  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):
  *         self._target = target             # <<<<<<<<<<<<<<
@@ -127436,7 +127442,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget(struct
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_target));
   __pyx_v_self->_target = __pyx_v_target;
 
-  /* "src/lxml/saxparser.pxi":101
+  /* "src/lxml/saxparser.pxi":110
  *         self.events_iterator = _ParseEventsIterator()
  * 
  *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):             # <<<<<<<<<<<<<<
@@ -127448,7 +127454,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget(struct
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/saxparser.pxi":104
+/* "src/lxml/saxparser.pxi":113
  *         self._target = target
  * 
  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -127462,7 +127468,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
   int __pyx_t_2;
   __Pyx_RefNannySetupContext("_initParserContext", 0);
 
-  /* "src/lxml/saxparser.pxi":105
+  /* "src/lxml/saxparser.pxi":114
  * 
  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         _ParserContext._initParserContext(self, c_ctxt)             # <<<<<<<<<<<<<<
@@ -127471,7 +127477,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
  */
   __pyx_f_4lxml_5etree_14_ParserContext__initParserContext(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self), __pyx_v_c_ctxt);
 
-  /* "src/lxml/saxparser.pxi":106
+  /* "src/lxml/saxparser.pxi":115
  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         _ParserContext._initParserContext(self, c_ctxt)
  *         if self._target is not None:             # <<<<<<<<<<<<<<
@@ -127482,7 +127488,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":107
+    /* "src/lxml/saxparser.pxi":116
  *         _ParserContext._initParserContext(self, c_ctxt)
  *         if self._target is not None:
  *             self._connectTarget(c_ctxt)             # <<<<<<<<<<<<<<
@@ -127491,7 +127497,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
  */
     ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_connectTarget(__pyx_v_self, __pyx_v_c_ctxt);
 
-    /* "src/lxml/saxparser.pxi":106
+    /* "src/lxml/saxparser.pxi":115
  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         _ParserContext._initParserContext(self, c_ctxt)
  *         if self._target is not None:             # <<<<<<<<<<<<<<
@@ -127501,7 +127507,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
     goto __pyx_L3;
   }
 
-  /* "src/lxml/saxparser.pxi":108
+  /* "src/lxml/saxparser.pxi":117
  *         if self._target is not None:
  *             self._connectTarget(c_ctxt)
  *         elif self._event_filter:             # <<<<<<<<<<<<<<
@@ -127511,7 +127517,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
   __pyx_t_2 = (__pyx_v_self->_event_filter != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":109
+    /* "src/lxml/saxparser.pxi":118
  *             self._connectTarget(c_ctxt)
  *         elif self._event_filter:
  *             self._connectEvents(c_ctxt)             # <<<<<<<<<<<<<<
@@ -127520,7 +127526,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
  */
     ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_connectEvents(__pyx_v_self, __pyx_v_c_ctxt);
 
-    /* "src/lxml/saxparser.pxi":108
+    /* "src/lxml/saxparser.pxi":117
  *         if self._target is not None:
  *             self._connectTarget(c_ctxt)
  *         elif self._event_filter:             # <<<<<<<<<<<<<<
@@ -127530,7 +127536,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
   }
   __pyx_L3:;
 
-  /* "src/lxml/saxparser.pxi":104
+  /* "src/lxml/saxparser.pxi":113
  *         self._target = target
  * 
  *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -127542,7 +127548,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct _
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/saxparser.pxi":111
+/* "src/lxml/saxparser.pxi":120
  *             self._connectEvents(c_ctxt)
  * 
  *     cdef void _connectTarget(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -127558,7 +127564,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   internalSubsetSAXFunc __pyx_t_3;
   __Pyx_RefNannySetupContext("_connectTarget", 0);
 
-  /* "src/lxml/saxparser.pxi":114
+  /* "src/lxml/saxparser.pxi":123
  *         """Wrap original SAX2 callbacks to call into parser target.
  *         """
  *         sax = c_ctxt.sax             # <<<<<<<<<<<<<<
@@ -127568,7 +127574,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_1 = __pyx_v_c_ctxt->sax;
   __pyx_v_sax = __pyx_t_1;
 
-  /* "src/lxml/saxparser.pxi":115
+  /* "src/lxml/saxparser.pxi":124
  *         """
  *         sax = c_ctxt.sax
  *         self._origSaxStart = sax.startElementNs = NULL             # <<<<<<<<<<<<<<
@@ -127578,7 +127584,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxStart = NULL;
   __pyx_v_sax->startElementNs = NULL;
 
-  /* "src/lxml/saxparser.pxi":116
+  /* "src/lxml/saxparser.pxi":125
  *         sax = c_ctxt.sax
  *         self._origSaxStart = sax.startElementNs = NULL
  *         self._origSaxStartNoNs = sax.startElement = NULL             # <<<<<<<<<<<<<<
@@ -127588,7 +127594,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxStartNoNs = NULL;
   __pyx_v_sax->startElement = NULL;
 
-  /* "src/lxml/saxparser.pxi":117
+  /* "src/lxml/saxparser.pxi":126
  *         self._origSaxStart = sax.startElementNs = NULL
  *         self._origSaxStartNoNs = sax.startElement = NULL
  *         if self._target._sax_event_filter & (SAX_EVENT_START |             # <<<<<<<<<<<<<<
@@ -127598,7 +127604,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & ((__pyx_e_4lxml_5etree_SAX_EVENT_START | __pyx_e_4lxml_5etree_SAX_EVENT_START_NS) | __pyx_e_4lxml_5etree_SAX_EVENT_END_NS)) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":122
+    /* "src/lxml/saxparser.pxi":131
  *             # intercept => overwrite orig callback
  *             # FIXME: also intercept on when collecting END events
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
@@ -127608,7 +127614,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
     __pyx_t_2 = ((__pyx_v_sax->initialized == XML_SAX2_MAGIC) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":123
+      /* "src/lxml/saxparser.pxi":132
  *             # FIXME: also intercept on when collecting END events
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.startElementNs = _handleSaxTargetStart             # <<<<<<<<<<<<<<
@@ -127617,7 +127623,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
       __pyx_v_sax->startElementNs = __pyx_f_4lxml_5etree__handleSaxTargetStart;
 
-      /* "src/lxml/saxparser.pxi":122
+      /* "src/lxml/saxparser.pxi":131
  *             # intercept => overwrite orig callback
  *             # FIXME: also intercept on when collecting END events
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
@@ -127626,7 +127632,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     }
 
-    /* "src/lxml/saxparser.pxi":124
+    /* "src/lxml/saxparser.pxi":133
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.startElementNs = _handleSaxTargetStart
  *             if self._target._sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<<
@@ -127636,7 +127642,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
     __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_START) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":125
+      /* "src/lxml/saxparser.pxi":134
  *                 sax.startElementNs = _handleSaxTargetStart
  *             if self._target._sax_event_filter & SAX_EVENT_START:
  *                 sax.startElement = _handleSaxTargetStartNoNs             # <<<<<<<<<<<<<<
@@ -127645,7 +127651,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
       __pyx_v_sax->startElement = __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs;
 
-      /* "src/lxml/saxparser.pxi":124
+      /* "src/lxml/saxparser.pxi":133
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.startElementNs = _handleSaxTargetStart
  *             if self._target._sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<<
@@ -127654,7 +127660,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     }
 
-    /* "src/lxml/saxparser.pxi":117
+    /* "src/lxml/saxparser.pxi":126
  *         self._origSaxStart = sax.startElementNs = NULL
  *         self._origSaxStartNoNs = sax.startElement = NULL
  *         if self._target._sax_event_filter & (SAX_EVENT_START |             # <<<<<<<<<<<<<<
@@ -127663,7 +127669,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":127
+  /* "src/lxml/saxparser.pxi":136
  *                 sax.startElement = _handleSaxTargetStartNoNs
  * 
  *         self._origSaxEnd = sax.endElementNs = NULL             # <<<<<<<<<<<<<<
@@ -127673,7 +127679,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxEnd = NULL;
   __pyx_v_sax->endElementNs = NULL;
 
-  /* "src/lxml/saxparser.pxi":128
+  /* "src/lxml/saxparser.pxi":137
  * 
  *         self._origSaxEnd = sax.endElementNs = NULL
  *         self._origSaxEndNoNs = sax.endElement = NULL             # <<<<<<<<<<<<<<
@@ -127683,7 +127689,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxEndNoNs = NULL;
   __pyx_v_sax->endElement = NULL;
 
-  /* "src/lxml/saxparser.pxi":129
+  /* "src/lxml/saxparser.pxi":138
  *         self._origSaxEnd = sax.endElementNs = NULL
  *         self._origSaxEndNoNs = sax.endElement = NULL
  *         if self._target._sax_event_filter & (SAX_EVENT_END |             # <<<<<<<<<<<<<<
@@ -127693,7 +127699,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & (__pyx_e_4lxml_5etree_SAX_EVENT_END | __pyx_e_4lxml_5etree_SAX_EVENT_END_NS)) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":131
+    /* "src/lxml/saxparser.pxi":140
  *         if self._target._sax_event_filter & (SAX_EVENT_END |
  *                                              SAX_EVENT_END_NS):
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
@@ -127703,7 +127709,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
     __pyx_t_2 = ((__pyx_v_sax->initialized == XML_SAX2_MAGIC) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":132
+      /* "src/lxml/saxparser.pxi":141
  *                                              SAX_EVENT_END_NS):
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.endElementNs = _handleSaxEnd             # <<<<<<<<<<<<<<
@@ -127712,7 +127718,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
       __pyx_v_sax->endElementNs = __pyx_f_4lxml_5etree__handleSaxEnd;
 
-      /* "src/lxml/saxparser.pxi":131
+      /* "src/lxml/saxparser.pxi":140
  *         if self._target._sax_event_filter & (SAX_EVENT_END |
  *                                              SAX_EVENT_END_NS):
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<<
@@ -127721,7 +127727,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     }
 
-    /* "src/lxml/saxparser.pxi":133
+    /* "src/lxml/saxparser.pxi":142
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.endElementNs = _handleSaxEnd
  *             if self._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<<
@@ -127731,7 +127737,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
     __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_END) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":134
+      /* "src/lxml/saxparser.pxi":143
  *                 sax.endElementNs = _handleSaxEnd
  *             if self._target._sax_event_filter & SAX_EVENT_END:
  *                 sax.endElement = _handleSaxEndNoNs             # <<<<<<<<<<<<<<
@@ -127740,7 +127746,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
       __pyx_v_sax->endElement = __pyx_f_4lxml_5etree__handleSaxEndNoNs;
 
-      /* "src/lxml/saxparser.pxi":133
+      /* "src/lxml/saxparser.pxi":142
  *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
  *                 sax.endElementNs = _handleSaxEnd
  *             if self._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<<
@@ -127749,7 +127755,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     }
 
-    /* "src/lxml/saxparser.pxi":129
+    /* "src/lxml/saxparser.pxi":138
  *         self._origSaxEnd = sax.endElementNs = NULL
  *         self._origSaxEndNoNs = sax.endElement = NULL
  *         if self._target._sax_event_filter & (SAX_EVENT_END |             # <<<<<<<<<<<<<<
@@ -127758,7 +127764,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":136
+  /* "src/lxml/saxparser.pxi":145
  *                 sax.endElement = _handleSaxEndNoNs
  * 
  *         self._origSaxData = sax.characters = sax.cdataBlock = NULL             # <<<<<<<<<<<<<<
@@ -127769,7 +127775,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_sax->characters = NULL;
   __pyx_v_sax->cdataBlock = NULL;
 
-  /* "src/lxml/saxparser.pxi":137
+  /* "src/lxml/saxparser.pxi":146
  * 
  *         self._origSaxData = sax.characters = sax.cdataBlock = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_DATA:             # <<<<<<<<<<<<<<
@@ -127779,7 +127785,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DATA) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":138
+    /* "src/lxml/saxparser.pxi":147
  *         self._origSaxData = sax.characters = sax.cdataBlock = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_DATA:
  *             sax.characters = sax.cdataBlock = _handleSaxData             # <<<<<<<<<<<<<<
@@ -127789,7 +127795,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
     __pyx_v_sax->characters = __pyx_f_4lxml_5etree__handleSaxData;
     __pyx_v_sax->cdataBlock = __pyx_f_4lxml_5etree__handleSaxData;
 
-    /* "src/lxml/saxparser.pxi":137
+    /* "src/lxml/saxparser.pxi":146
  * 
  *         self._origSaxData = sax.characters = sax.cdataBlock = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_DATA:             # <<<<<<<<<<<<<<
@@ -127798,7 +127804,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":141
+  /* "src/lxml/saxparser.pxi":150
  * 
  *         # doctype propagation is always required for entity replacement
  *         self._origSaxDoctype = sax.internalSubset             # <<<<<<<<<<<<<<
@@ -127808,7 +127814,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_3 = __pyx_v_sax->internalSubset;
   __pyx_v_self->_origSaxDoctype = __pyx_t_3;
 
-  /* "src/lxml/saxparser.pxi":142
+  /* "src/lxml/saxparser.pxi":151
  *         # doctype propagation is always required for entity replacement
  *         self._origSaxDoctype = sax.internalSubset
  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:             # <<<<<<<<<<<<<<
@@ -127818,7 +127824,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":143
+    /* "src/lxml/saxparser.pxi":152
  *         self._origSaxDoctype = sax.internalSubset
  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
  *             sax.internalSubset = _handleSaxTargetDoctype             # <<<<<<<<<<<<<<
@@ -127827,7 +127833,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     __pyx_v_sax->internalSubset = __pyx_f_4lxml_5etree__handleSaxTargetDoctype;
 
-    /* "src/lxml/saxparser.pxi":142
+    /* "src/lxml/saxparser.pxi":151
  *         # doctype propagation is always required for entity replacement
  *         self._origSaxDoctype = sax.internalSubset
  *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:             # <<<<<<<<<<<<<<
@@ -127836,7 +127842,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":145
+  /* "src/lxml/saxparser.pxi":154
  *             sax.internalSubset = _handleSaxTargetDoctype
  * 
  *         self._origSaxPI = sax.processingInstruction = NULL             # <<<<<<<<<<<<<<
@@ -127846,7 +127852,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxPI = NULL;
   __pyx_v_sax->processingInstruction = NULL;
 
-  /* "src/lxml/saxparser.pxi":146
+  /* "src/lxml/saxparser.pxi":155
  * 
  *         self._origSaxPI = sax.processingInstruction = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_PI:             # <<<<<<<<<<<<<<
@@ -127856,7 +127862,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_PI) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":147
+    /* "src/lxml/saxparser.pxi":156
  *         self._origSaxPI = sax.processingInstruction = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_PI:
  *             sax.processingInstruction = _handleSaxTargetPI             # <<<<<<<<<<<<<<
@@ -127865,7 +127871,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     __pyx_v_sax->processingInstruction = __pyx_f_4lxml_5etree__handleSaxTargetPI;
 
-    /* "src/lxml/saxparser.pxi":146
+    /* "src/lxml/saxparser.pxi":155
  * 
  *         self._origSaxPI = sax.processingInstruction = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_PI:             # <<<<<<<<<<<<<<
@@ -127874,7 +127880,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":149
+  /* "src/lxml/saxparser.pxi":158
  *             sax.processingInstruction = _handleSaxTargetPI
  * 
  *         self._origSaxComment = sax.comment = NULL             # <<<<<<<<<<<<<<
@@ -127884,7 +127890,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_v_self->_origSaxComment = NULL;
   __pyx_v_sax->comment = NULL;
 
-  /* "src/lxml/saxparser.pxi":150
+  /* "src/lxml/saxparser.pxi":159
  * 
  *         self._origSaxComment = sax.comment = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<<
@@ -127894,7 +127900,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __pyx_t_2 = ((__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":151
+    /* "src/lxml/saxparser.pxi":160
  *         self._origSaxComment = sax.comment = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
  *             sax.comment = _handleSaxTargetComment             # <<<<<<<<<<<<<<
@@ -127903,7 +127909,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
     __pyx_v_sax->comment = __pyx_f_4lxml_5etree__handleSaxTargetComment;
 
-    /* "src/lxml/saxparser.pxi":150
+    /* "src/lxml/saxparser.pxi":159
  * 
  *         self._origSaxComment = sax.comment = NULL
  *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<<
@@ -127912,7 +127918,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":154
+  /* "src/lxml/saxparser.pxi":163
  * 
  *         # enforce entity replacement
  *         sax.reference = NULL             # <<<<<<<<<<<<<<
@@ -127921,7 +127927,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   __pyx_v_sax->reference = NULL;
 
-  /* "src/lxml/saxparser.pxi":155
+  /* "src/lxml/saxparser.pxi":164
  *         # enforce entity replacement
  *         sax.reference = NULL
  *         c_ctxt.replaceEntities = 1             # <<<<<<<<<<<<<<
@@ -127930,7 +127936,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
  */
   __pyx_v_c_ctxt->replaceEntities = 1;
 
-  /* "src/lxml/saxparser.pxi":111
+  /* "src/lxml/saxparser.pxi":120
  *             self._connectEvents(c_ctxt)
  * 
  *     cdef void _connectTarget(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -127942,7 +127948,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectTarget(struct __pyx
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/saxparser.pxi":157
+/* "src/lxml/saxparser.pxi":166
  *         c_ctxt.replaceEntities = 1
  * 
  *     cdef void _connectEvents(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -127965,7 +127971,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   processingInstructionSAXFunc __pyx_t_10;
   __Pyx_RefNannySetupContext("_connectEvents", 0);
 
-  /* "src/lxml/saxparser.pxi":160
+  /* "src/lxml/saxparser.pxi":169
  *         """Wrap original SAX2 callbacks to collect parse events without parser target.
  *         """
  *         sax = c_ctxt.sax             # <<<<<<<<<<<<<<
@@ -127975,7 +127981,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_1 = __pyx_v_c_ctxt->sax;
   __pyx_v_sax = __pyx_t_1;
 
-  /* "src/lxml/saxparser.pxi":161
+  /* "src/lxml/saxparser.pxi":170
  *         """
  *         sax = c_ctxt.sax
  *         self._origSaxStartDocument = sax.startDocument             # <<<<<<<<<<<<<<
@@ -127985,7 +127991,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_2 = __pyx_v_sax->startDocument;
   __pyx_v_self->_origSaxStartDocument = __pyx_t_2;
 
-  /* "src/lxml/saxparser.pxi":162
+  /* "src/lxml/saxparser.pxi":171
  *         sax = c_ctxt.sax
  *         self._origSaxStartDocument = sax.startDocument
  *         sax.startDocument = _handleSaxStartDocument             # <<<<<<<<<<<<<<
@@ -127994,7 +128000,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   __pyx_v_sax->startDocument = __pyx_f_4lxml_5etree__handleSaxStartDocument;
 
-  /* "src/lxml/saxparser.pxi":165
+  /* "src/lxml/saxparser.pxi":174
  * 
  *         # only override "start" event handler if needed
  *         self._origSaxStart = sax.startElementNs             # <<<<<<<<<<<<<<
@@ -128004,7 +128010,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_3 = __pyx_v_sax->startElementNs;
   __pyx_v_self->_origSaxStart = __pyx_t_3;
 
-  /* "src/lxml/saxparser.pxi":166
+  /* "src/lxml/saxparser.pxi":175
  *         # only override "start" event handler if needed
  *         self._origSaxStart = sax.startElementNs
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128024,7 +128030,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
     goto __pyx_L4_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":167
+  /* "src/lxml/saxparser.pxi":176
  *         self._origSaxStart = sax.startElementNs
  *         if self._event_filter == 0 or c_ctxt.html or \
  *                self._event_filter & (PARSE_EVENT_FILTER_START |             # <<<<<<<<<<<<<<
@@ -128035,7 +128041,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
 
-  /* "src/lxml/saxparser.pxi":166
+  /* "src/lxml/saxparser.pxi":175
  *         # only override "start" event handler if needed
  *         self._origSaxStart = sax.startElementNs
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128044,7 +128050,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":171
+    /* "src/lxml/saxparser.pxi":180
  *                                      PARSE_EVENT_FILTER_START_NS |
  *                                      PARSE_EVENT_FILTER_END_NS):
  *             sax.startElementNs = <xmlparser.startElementNsSAX2Func>_handleSaxStart             # <<<<<<<<<<<<<<
@@ -128053,7 +128059,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->startElementNs = ((startElementNsSAX2Func)__pyx_f_4lxml_5etree__handleSaxStart);
 
-    /* "src/lxml/saxparser.pxi":166
+    /* "src/lxml/saxparser.pxi":175
  *         # only override "start" event handler if needed
  *         self._origSaxStart = sax.startElementNs
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128062,7 +128068,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":173
+  /* "src/lxml/saxparser.pxi":182
  *             sax.startElementNs = <xmlparser.startElementNsSAX2Func>_handleSaxStart
  * 
  *         self._origSaxStartNoNs = sax.startElement             # <<<<<<<<<<<<<<
@@ -128072,7 +128078,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_6 = __pyx_v_sax->startElement;
   __pyx_v_self->_origSaxStartNoNs = __pyx_t_6;
 
-  /* "src/lxml/saxparser.pxi":174
+  /* "src/lxml/saxparser.pxi":183
  * 
  *         self._origSaxStartNoNs = sax.startElement
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128092,7 +128098,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
     goto __pyx_L8_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":175
+  /* "src/lxml/saxparser.pxi":184
  *         self._origSaxStartNoNs = sax.startElement
  *         if self._event_filter == 0 or c_ctxt.html or \
  *                self._event_filter & (PARSE_EVENT_FILTER_START |             # <<<<<<<<<<<<<<
@@ -128103,7 +128109,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = __pyx_t_5;
   __pyx_L8_bool_binop_done:;
 
-  /* "src/lxml/saxparser.pxi":174
+  /* "src/lxml/saxparser.pxi":183
  * 
  *         self._origSaxStartNoNs = sax.startElement
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128112,7 +128118,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":177
+    /* "src/lxml/saxparser.pxi":186
  *                self._event_filter & (PARSE_EVENT_FILTER_START |
  *                                      PARSE_EVENT_FILTER_END):
  *             sax.startElement = <xmlparser.startElementSAXFunc>_handleSaxStartNoNs             # <<<<<<<<<<<<<<
@@ -128121,7 +128127,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->startElement = ((startElementSAXFunc)__pyx_f_4lxml_5etree__handleSaxStartNoNs);
 
-    /* "src/lxml/saxparser.pxi":174
+    /* "src/lxml/saxparser.pxi":183
  * 
  *         self._origSaxStartNoNs = sax.startElement
  *         if self._event_filter == 0 or c_ctxt.html or \             # <<<<<<<<<<<<<<
@@ -128130,7 +128136,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":180
+  /* "src/lxml/saxparser.pxi":189
  * 
  *         # only override "end" event handler if needed
  *         self._origSaxEnd = sax.endElementNs             # <<<<<<<<<<<<<<
@@ -128140,7 +128146,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_7 = __pyx_v_sax->endElementNs;
   __pyx_v_self->_origSaxEnd = __pyx_t_7;
 
-  /* "src/lxml/saxparser.pxi":181
+  /* "src/lxml/saxparser.pxi":190
  *         # only override "end" event handler if needed
  *         self._origSaxEnd = sax.endElementNs
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128154,7 +128160,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
     goto __pyx_L12_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":182
+  /* "src/lxml/saxparser.pxi":191
  *         self._origSaxEnd = sax.endElementNs
  *         if self._event_filter == 0 or \
  *                self._event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -128165,7 +128171,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = __pyx_t_5;
   __pyx_L12_bool_binop_done:;
 
-  /* "src/lxml/saxparser.pxi":181
+  /* "src/lxml/saxparser.pxi":190
  *         # only override "end" event handler if needed
  *         self._origSaxEnd = sax.endElementNs
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128174,7 +128180,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":184
+    /* "src/lxml/saxparser.pxi":193
  *                self._event_filter & (PARSE_EVENT_FILTER_END |
  *                                      PARSE_EVENT_FILTER_END_NS):
  *             sax.endElementNs = <xmlparser.endElementNsSAX2Func>_handleSaxEnd             # <<<<<<<<<<<<<<
@@ -128183,7 +128189,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->endElementNs = ((endElementNsSAX2Func)__pyx_f_4lxml_5etree__handleSaxEnd);
 
-    /* "src/lxml/saxparser.pxi":181
+    /* "src/lxml/saxparser.pxi":190
  *         # only override "end" event handler if needed
  *         self._origSaxEnd = sax.endElementNs
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128192,7 +128198,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":186
+  /* "src/lxml/saxparser.pxi":195
  *             sax.endElementNs = <xmlparser.endElementNsSAX2Func>_handleSaxEnd
  * 
  *         self._origSaxEndNoNs = sax.endElement             # <<<<<<<<<<<<<<
@@ -128202,7 +128208,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_8 = __pyx_v_sax->endElement;
   __pyx_v_self->_origSaxEndNoNs = __pyx_t_8;
 
-  /* "src/lxml/saxparser.pxi":187
+  /* "src/lxml/saxparser.pxi":196
  * 
  *         self._origSaxEndNoNs = sax.endElement
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128216,7 +128222,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
     goto __pyx_L15_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":188
+  /* "src/lxml/saxparser.pxi":197
  *         self._origSaxEndNoNs = sax.endElement
  *         if self._event_filter == 0 or \
  *                self._event_filter & PARSE_EVENT_FILTER_END:             # <<<<<<<<<<<<<<
@@ -128227,7 +128233,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = __pyx_t_5;
   __pyx_L15_bool_binop_done:;
 
-  /* "src/lxml/saxparser.pxi":187
+  /* "src/lxml/saxparser.pxi":196
  * 
  *         self._origSaxEndNoNs = sax.endElement
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128236,7 +128242,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":189
+    /* "src/lxml/saxparser.pxi":198
  *         if self._event_filter == 0 or \
  *                self._event_filter & PARSE_EVENT_FILTER_END:
  *             sax.endElement = <xmlparser.endElementSAXFunc>_handleSaxEndNoNs             # <<<<<<<<<<<<<<
@@ -128245,7 +128251,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->endElement = ((endElementSAXFunc)__pyx_f_4lxml_5etree__handleSaxEndNoNs);
 
-    /* "src/lxml/saxparser.pxi":187
+    /* "src/lxml/saxparser.pxi":196
  * 
  *         self._origSaxEndNoNs = sax.endElement
  *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<<
@@ -128254,7 +128260,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":191
+  /* "src/lxml/saxparser.pxi":200
  *             sax.endElement = <xmlparser.endElementSAXFunc>_handleSaxEndNoNs
  * 
  *         self._origSaxComment = sax.comment             # <<<<<<<<<<<<<<
@@ -128264,7 +128270,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_9 = __pyx_v_sax->comment;
   __pyx_v_self->_origSaxComment = __pyx_t_9;
 
-  /* "src/lxml/saxparser.pxi":192
+  /* "src/lxml/saxparser.pxi":201
  * 
  *         self._origSaxComment = sax.comment
  *         if self._event_filter & PARSE_EVENT_FILTER_COMMENT:             # <<<<<<<<<<<<<<
@@ -128274,7 +128280,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = ((__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_COMMENT) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":193
+    /* "src/lxml/saxparser.pxi":202
  *         self._origSaxComment = sax.comment
  *         if self._event_filter & PARSE_EVENT_FILTER_COMMENT:
  *             sax.comment = <xmlparser.commentSAXFunc>_handleSaxComment             # <<<<<<<<<<<<<<
@@ -128283,7 +128289,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->comment = ((commentSAXFunc)__pyx_f_4lxml_5etree__handleSaxComment);
 
-    /* "src/lxml/saxparser.pxi":192
+    /* "src/lxml/saxparser.pxi":201
  * 
  *         self._origSaxComment = sax.comment
  *         if self._event_filter & PARSE_EVENT_FILTER_COMMENT:             # <<<<<<<<<<<<<<
@@ -128292,7 +128298,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":195
+  /* "src/lxml/saxparser.pxi":204
  *             sax.comment = <xmlparser.commentSAXFunc>_handleSaxComment
  * 
  *         self._origSaxPI = sax.processingInstruction             # <<<<<<<<<<<<<<
@@ -128302,7 +128308,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_10 = __pyx_v_sax->processingInstruction;
   __pyx_v_self->_origSaxPI = __pyx_t_10;
 
-  /* "src/lxml/saxparser.pxi":196
+  /* "src/lxml/saxparser.pxi":205
  * 
  *         self._origSaxPI = sax.processingInstruction
  *         if self._event_filter & PARSE_EVENT_FILTER_PI:             # <<<<<<<<<<<<<<
@@ -128312,7 +128318,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __pyx_t_4 = ((__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_PI) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":197
+    /* "src/lxml/saxparser.pxi":206
  *         self._origSaxPI = sax.processingInstruction
  *         if self._event_filter & PARSE_EVENT_FILTER_PI:
  *             sax.processingInstruction = <xmlparser.processingInstructionSAXFunc>_handleSaxPIEvent             # <<<<<<<<<<<<<<
@@ -128321,7 +128327,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
     __pyx_v_sax->processingInstruction = ((processingInstructionSAXFunc)__pyx_f_4lxml_5etree__handleSaxPIEvent);
 
-    /* "src/lxml/saxparser.pxi":196
+    /* "src/lxml/saxparser.pxi":205
  * 
  *         self._origSaxPI = sax.processingInstruction
  *         if self._event_filter & PARSE_EVENT_FILTER_PI:             # <<<<<<<<<<<<<<
@@ -128330,7 +128336,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":157
+  /* "src/lxml/saxparser.pxi":166
  *         c_ctxt.replaceEntities = 1
  * 
  *     cdef void _connectEvents(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -128342,7 +128348,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__connectEvents(struct __pyx
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/saxparser.pxi":199
+/* "src/lxml/saxparser.pxi":208
  *             sax.processingInstruction = <xmlparser.processingInstructionSAXFunc>_handleSaxPIEvent
  * 
  *     cdef _setEventFilter(self, events, tag):             # <<<<<<<<<<<<<<
@@ -128364,17 +128370,17 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_setEventFilter", 0);
 
-  /* "src/lxml/saxparser.pxi":200
+  /* "src/lxml/saxparser.pxi":209
  * 
  *     cdef _setEventFilter(self, events, tag):
  *         self._event_filter = _buildParseEventFilter(events)             # <<<<<<<<<<<<<<
  *         if not self._event_filter or tag is None or tag == '*':
  *             self._matcher = None
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 200, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__buildParseEventFilter(__pyx_v_events); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 209, __pyx_L1_error)
   __pyx_v_self->_event_filter = __pyx_t_1;
 
-  /* "src/lxml/saxparser.pxi":201
+  /* "src/lxml/saxparser.pxi":210
  *     cdef _setEventFilter(self, events, tag):
  *         self._event_filter = _buildParseEventFilter(events)
  *         if not self._event_filter or tag is None or tag == '*':             # <<<<<<<<<<<<<<
@@ -128394,12 +128400,12 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(8, 201, __pyx_L1_error)
+  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_tag, __pyx_kp_s__42, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 210, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":202
+    /* "src/lxml/saxparser.pxi":211
  *         self._event_filter = _buildParseEventFilter(events)
  *         if not self._event_filter or tag is None or tag == '*':
  *             self._matcher = None             # <<<<<<<<<<<<<<
@@ -128412,7 +128418,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_matcher));
     __pyx_v_self->_matcher = ((struct __pyx_obj_4lxml_5etree__MultiTagMatcher *)Py_None);
 
-    /* "src/lxml/saxparser.pxi":201
+    /* "src/lxml/saxparser.pxi":210
  *     cdef _setEventFilter(self, events, tag):
  *         self._event_filter = _buildParseEventFilter(events)
  *         if not self._event_filter or tag is None or tag == '*':             # <<<<<<<<<<<<<<
@@ -128422,7 +128428,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
     goto __pyx_L3;
   }
 
-  /* "src/lxml/saxparser.pxi":204
+  /* "src/lxml/saxparser.pxi":213
  *             self._matcher = None
  *         else:
  *             self._matcher = _MultiTagMatcher.__new__(_MultiTagMatcher, tag)             # <<<<<<<<<<<<<<
@@ -128430,12 +128436,12 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
  *     cdef int startDocument(self, xmlDoc* c_doc) except -1:
  */
   /*else*/ {
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 204, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 213, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
     PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tag);
-    __pyx_t_6 = ((PyObject *)__pyx_tp_new_4lxml_5etree__MultiTagMatcher(((PyTypeObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_5, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 204, __pyx_L1_error)
+    __pyx_t_6 = ((PyObject *)__pyx_tp_new_4lxml_5etree__MultiTagMatcher(((PyTypeObject *)__pyx_ptype_4lxml_5etree__MultiTagMatcher), __pyx_t_5, NULL)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 213, __pyx_L1_error)
     __Pyx_GOTREF(((PyObject *)__pyx_t_6));
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
@@ -128446,7 +128452,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
   }
   __pyx_L3:;
 
-  /* "src/lxml/saxparser.pxi":199
+  /* "src/lxml/saxparser.pxi":208
  *             sax.processingInstruction = <xmlparser.processingInstructionSAXFunc>_handleSaxPIEvent
  * 
  *     cdef _setEventFilter(self, events, tag):             # <<<<<<<<<<<<<<
@@ -128468,7 +128474,7 @@ static PyObject *__pyx_f_4lxml_5etree_17_SaxParserContext__setEventFilter(struct
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":206
+/* "src/lxml/saxparser.pxi":215
  *             self._matcher = _MultiTagMatcher.__new__(_MultiTagMatcher, tag)
  * 
  *     cdef int startDocument(self, xmlDoc* c_doc) except -1:             # <<<<<<<<<<<<<<
@@ -128498,7 +128504,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("startDocument", 0);
 
-  /* "src/lxml/saxparser.pxi":207
+  /* "src/lxml/saxparser.pxi":216
  * 
  *     cdef int startDocument(self, xmlDoc* c_doc) except -1:
  *         try:             # <<<<<<<<<<<<<<
@@ -128507,7 +128513,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
  */
   /*try:*/ {
 
-    /* "src/lxml/saxparser.pxi":208
+    /* "src/lxml/saxparser.pxi":217
  *     cdef int startDocument(self, xmlDoc* c_doc) except -1:
  *         try:
  *             self._doc = _documentFactory(c_doc, self._parser)             # <<<<<<<<<<<<<<
@@ -128516,7 +128522,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
  */
     __pyx_t_1 = ((PyObject *)__pyx_v_self->_parser);
     __Pyx_INCREF(__pyx_t_1);
-    __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 208, __pyx_L4_error)
+    __pyx_t_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1))); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 217, __pyx_L4_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GIVEREF(__pyx_t_2);
@@ -128526,7 +128532,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
     __pyx_t_2 = 0;
   }
 
-  /* "src/lxml/saxparser.pxi":210
+  /* "src/lxml/saxparser.pxi":219
  *             self._doc = _documentFactory(c_doc, self._parser)
  *         finally:
  *             self._parser = None  # clear circular reference ASAP             # <<<<<<<<<<<<<<
@@ -128582,7 +128588,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
     __pyx_L5:;
   }
 
-  /* "src/lxml/saxparser.pxi":211
+  /* "src/lxml/saxparser.pxi":220
  *         finally:
  *             self._parser = None  # clear circular reference ASAP
  *         if self._matcher is not None:             # <<<<<<<<<<<<<<
@@ -128593,7 +128599,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
   __pyx_t_13 = (__pyx_t_12 != 0);
   if (__pyx_t_13) {
 
-    /* "src/lxml/saxparser.pxi":212
+    /* "src/lxml/saxparser.pxi":221
  *             self._parser = None  # clear circular reference ASAP
  *         if self._matcher is not None:
  *             self._matcher.cacheTags(self._doc, True) # force entry in libxml2 dict             # <<<<<<<<<<<<<<
@@ -128604,10 +128610,10 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
     __Pyx_INCREF(__pyx_t_2);
     __pyx_t_14.__pyx_n = 1;
     __pyx_t_14.force_into_dict = 1;
-    __pyx_t_4 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_2), &__pyx_t_14); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 212, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_16_MultiTagMatcher_cacheTags(__pyx_v_self->_matcher, ((struct LxmlDocument *)__pyx_t_2), &__pyx_t_14); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 221, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/saxparser.pxi":211
+    /* "src/lxml/saxparser.pxi":220
  *         finally:
  *             self._parser = None  # clear circular reference ASAP
  *         if self._matcher is not None:             # <<<<<<<<<<<<<<
@@ -128616,7 +128622,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
  */
   }
 
-  /* "src/lxml/saxparser.pxi":213
+  /* "src/lxml/saxparser.pxi":222
  *         if self._matcher is not None:
  *             self._matcher.cacheTags(self._doc, True) # force entry in libxml2 dict
  *         return 0             # <<<<<<<<<<<<<<
@@ -128626,7 +128632,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":206
+  /* "src/lxml/saxparser.pxi":215
  *             self._matcher = _MultiTagMatcher.__new__(_MultiTagMatcher, tag)
  * 
  *     cdef int startDocument(self, xmlDoc* c_doc) except -1:             # <<<<<<<<<<<<<<
@@ -128645,7 +128651,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_startDocument(struct __pyx_o
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":215
+/* "src/lxml/saxparser.pxi":224
  *         return 0
  * 
  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
@@ -128669,7 +128675,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("pushEvent", 0);
 
-  /* "src/lxml/saxparser.pxi":217
+  /* "src/lxml/saxparser.pxi":226
  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:
  *         cdef _Element root
  *         if self._root is None:             # <<<<<<<<<<<<<<
@@ -128680,20 +128686,20 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":218
+    /* "src/lxml/saxparser.pxi":227
  *         cdef _Element root
  *         if self._root is None:
  *             root = self._doc.getroot()             # <<<<<<<<<<<<<<
  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
  *                 self._root = root
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->__pyx_base._doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 218, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->__pyx_base._doc); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 227, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 218, __pyx_L1_error)
+    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 227, __pyx_L1_error)
     __pyx_v_root = ((struct LxmlElement *)__pyx_t_3);
     __pyx_t_3 = 0;
 
-    /* "src/lxml/saxparser.pxi":219
+    /* "src/lxml/saxparser.pxi":228
  *         if self._root is None:
  *             root = self._doc.getroot()
  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -128712,7 +128718,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
     __pyx_L5_bool_binop_done:;
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":220
+      /* "src/lxml/saxparser.pxi":229
  *             root = self._doc.getroot()
  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
  *                 self._root = root             # <<<<<<<<<<<<<<
@@ -128725,7 +128731,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
       __Pyx_DECREF(((PyObject *)__pyx_v_self->_root));
       __pyx_v_self->_root = __pyx_v_root;
 
-      /* "src/lxml/saxparser.pxi":219
+      /* "src/lxml/saxparser.pxi":228
  *         if self._root is None:
  *             root = self._doc.getroot()
  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -128734,7 +128740,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
  */
     }
 
-    /* "src/lxml/saxparser.pxi":217
+    /* "src/lxml/saxparser.pxi":226
  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:
  *         cdef _Element root
  *         if self._root is None:             # <<<<<<<<<<<<<<
@@ -128743,7 +128749,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
  */
   }
 
-  /* "src/lxml/saxparser.pxi":221
+  /* "src/lxml/saxparser.pxi":230
  *             if root is not None and root._c_node.type == tree.XML_ELEMENT_NODE:
  *                 self._root = root
  *         node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<<
@@ -128752,13 +128758,13 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
  */
   __pyx_t_3 = ((PyObject *)__pyx_v_self->__pyx_base._doc);
   __Pyx_INCREF(__pyx_t_3);
-  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 221, __pyx_L1_error)
+  __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_c_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 230, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_node = ((struct LxmlElement *)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "src/lxml/saxparser.pxi":222
+  /* "src/lxml/saxparser.pxi":231
  *                 self._root = root
  *         node = _elementFactory(self._doc, c_node)
  *         self.events_iterator._events.append( (event, node) )             # <<<<<<<<<<<<<<
@@ -128767,9 +128773,9 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
  */
   if (unlikely(__pyx_v_self->events_iterator->_events == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(8, 222, __pyx_L1_error)
+    __PYX_ERR(3, 231, __pyx_L1_error)
   }
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 222, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 231, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_event);
   __Pyx_GIVEREF(__pyx_v_event);
@@ -128777,10 +128783,10 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   __Pyx_INCREF(((PyObject *)__pyx_v_node));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
   PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_node));
-  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 222, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 231, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/saxparser.pxi":223
+  /* "src/lxml/saxparser.pxi":232
  *         node = _elementFactory(self._doc, c_node)
  *         self.events_iterator._events.append( (event, node) )
  *         return 0             # <<<<<<<<<<<<<<
@@ -128790,7 +128796,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":215
+  /* "src/lxml/saxparser.pxi":224
  *         return 0
  * 
  *     cdef int pushEvent(self, event, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<<
@@ -128811,7 +128817,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_pushEvent(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":225
+/* "src/lxml/saxparser.pxi":234
  *         return 0
  * 
  *     cdef int flushEvents(self) except -1:             # <<<<<<<<<<<<<<
@@ -128833,7 +128839,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("flushEvents", 0);
 
-  /* "src/lxml/saxparser.pxi":226
+  /* "src/lxml/saxparser.pxi":235
  * 
  *     cdef int flushEvents(self) except -1:
  *         events = self.events_iterator._events             # <<<<<<<<<<<<<<
@@ -128845,7 +128851,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
   __pyx_v_events = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":227
+  /* "src/lxml/saxparser.pxi":236
  *     cdef int flushEvents(self) except -1:
  *         events = self.events_iterator._events
  *         while self._node_stack:             # <<<<<<<<<<<<<<
@@ -128856,7 +128862,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
     __pyx_t_2 = (__pyx_v_self->_node_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_node_stack) != 0);
     if (!__pyx_t_2) break;
 
-    /* "src/lxml/saxparser.pxi":228
+    /* "src/lxml/saxparser.pxi":237
  *         events = self.events_iterator._events
  *         while self._node_stack:
  *             events.append( ('end', self._node_stack.pop()) )             # <<<<<<<<<<<<<<
@@ -128865,15 +128871,15 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
  */
     if (unlikely(__pyx_v_events == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-      __PYX_ERR(8, 228, __pyx_L1_error)
+      __PYX_ERR(3, 237, __pyx_L1_error)
     }
     if (unlikely(__pyx_v_self->_node_stack == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-      __PYX_ERR(8, 228, __pyx_L1_error)
+      __PYX_ERR(3, 237, __pyx_L1_error)
     }
-    __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->_node_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 228, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyList_Pop(__pyx_v_self->_node_stack); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 237, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 228, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 237, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_INCREF(__pyx_n_s_end);
     __Pyx_GIVEREF(__pyx_n_s_end);
@@ -128881,20 +128887,20 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
     __pyx_t_1 = 0;
-    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_events, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 228, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_events, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 237, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "src/lxml/saxparser.pxi":229
+    /* "src/lxml/saxparser.pxi":238
  *         while self._node_stack:
  *             events.append( ('end', self._node_stack.pop()) )
  *             _pushSaxNsEndEvents(self)             # <<<<<<<<<<<<<<
  *         while self._ns_stack:
  *             _pushSaxNsEndEvents(self)
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 229, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 238, __pyx_L1_error)
   }
 
-  /* "src/lxml/saxparser.pxi":230
+  /* "src/lxml/saxparser.pxi":239
  *             events.append( ('end', self._node_stack.pop()) )
  *             _pushSaxNsEndEvents(self)
  *         while self._ns_stack:             # <<<<<<<<<<<<<<
@@ -128905,17 +128911,17 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
     __pyx_t_2 = (__pyx_v_self->_ns_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_ns_stack) != 0);
     if (!__pyx_t_2) break;
 
-    /* "src/lxml/saxparser.pxi":231
+    /* "src/lxml/saxparser.pxi":240
  *             _pushSaxNsEndEvents(self)
  *         while self._ns_stack:
  *             _pushSaxNsEndEvents(self)             # <<<<<<<<<<<<<<
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 231, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 240, __pyx_L1_error)
   }
 
-  /* "src/lxml/saxparser.pxi":225
+  /* "src/lxml/saxparser.pxi":234
  *         return 0
  * 
  *     cdef int flushEvents(self) except -1:             # <<<<<<<<<<<<<<
@@ -128937,7 +128943,7 @@ static int __pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":233
+/* "src/lxml/saxparser.pxi":242
  *             _pushSaxNsEndEvents(self)
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -128950,7 +128956,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("_handleSaxException", 0);
 
-  /* "src/lxml/saxparser.pxi":234
+  /* "src/lxml/saxparser.pxi":243
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -128960,7 +128966,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
   __pyx_t_1 = ((__pyx_v_c_ctxt->errNo == XML_ERR_OK) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":235
+    /* "src/lxml/saxparser.pxi":244
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<<
@@ -128969,7 +128975,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
     __pyx_v_c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
 
-    /* "src/lxml/saxparser.pxi":234
+    /* "src/lxml/saxparser.pxi":243
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
  *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -128978,7 +128984,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
   }
 
-  /* "src/lxml/saxparser.pxi":237
+  /* "src/lxml/saxparser.pxi":246
  *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
  *         # stop parsing immediately
  *         c_ctxt.wellFormed = 0             # <<<<<<<<<<<<<<
@@ -128987,7 +128993,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
   __pyx_v_c_ctxt->wellFormed = 0;
 
-  /* "src/lxml/saxparser.pxi":238
+  /* "src/lxml/saxparser.pxi":247
  *         # stop parsing immediately
  *         c_ctxt.wellFormed = 0
  *         c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<<
@@ -128996,7 +129002,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
   __pyx_v_c_ctxt->disableSAX = 1;
 
-  /* "src/lxml/saxparser.pxi":239
+  /* "src/lxml/saxparser.pxi":248
  *         c_ctxt.wellFormed = 0
  *         c_ctxt.disableSAX = 1
  *         c_ctxt.instate = xmlparser.XML_PARSER_EOF             # <<<<<<<<<<<<<<
@@ -129005,7 +129011,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
   __pyx_v_c_ctxt->instate = XML_PARSER_EOF;
 
-  /* "src/lxml/saxparser.pxi":240
+  /* "src/lxml/saxparser.pxi":249
  *         c_ctxt.disableSAX = 1
  *         c_ctxt.instate = xmlparser.XML_PARSER_EOF
  *         self._store_raised()             # <<<<<<<<<<<<<<
@@ -129014,7 +129020,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
  */
   ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));
 
-  /* "src/lxml/saxparser.pxi":233
+  /* "src/lxml/saxparser.pxi":242
  *             _pushSaxNsEndEvents(self)
  * 
  *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -129026,7 +129032,7 @@ static void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/saxparser.pxi":250
+/* "src/lxml/saxparser.pxi":259
  *     cdef int _event_index
  * 
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -129059,14 +129065,14 @@ static int __pyx_pf_4lxml_5etree_20_ParseEventsIterator___cinit__(struct __pyx_o
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/saxparser.pxi":251
+  /* "src/lxml/saxparser.pxi":260
  * 
  *     def __cinit__(self):
  *         self._events = []             # <<<<<<<<<<<<<<
  *         self._event_index = 0
  * 
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 251, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 260, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_events);
@@ -129074,7 +129080,7 @@ static int __pyx_pf_4lxml_5etree_20_ParseEventsIterator___cinit__(struct __pyx_o
   __pyx_v_self->_events = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":252
+  /* "src/lxml/saxparser.pxi":261
  *     def __cinit__(self):
  *         self._events = []
  *         self._event_index = 0             # <<<<<<<<<<<<<<
@@ -129083,7 +129089,7 @@ static int __pyx_pf_4lxml_5etree_20_ParseEventsIterator___cinit__(struct __pyx_o
  */
   __pyx_v_self->_event_index = 0;
 
-  /* "src/lxml/saxparser.pxi":250
+  /* "src/lxml/saxparser.pxi":259
  *     cdef int _event_index
  * 
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -129103,7 +129109,7 @@ static int __pyx_pf_4lxml_5etree_20_ParseEventsIterator___cinit__(struct __pyx_o
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":254
+/* "src/lxml/saxparser.pxi":263
  *         self._event_index = 0
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -129129,7 +129135,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_2__iter__(struct _
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__iter__", 0);
 
-  /* "src/lxml/saxparser.pxi":255
+  /* "src/lxml/saxparser.pxi":264
  * 
  *     def __iter__(self):
  *         return self             # <<<<<<<<<<<<<<
@@ -129141,7 +129147,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_2__iter__(struct _
   __pyx_r = ((PyObject *)__pyx_v_self);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":254
+  /* "src/lxml/saxparser.pxi":263
  *         self._event_index = 0
  * 
  *     def __iter__(self):             # <<<<<<<<<<<<<<
@@ -129156,7 +129162,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_2__iter__(struct _
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":257
+/* "src/lxml/saxparser.pxi":266
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -129193,7 +129199,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__next__", 0);
 
-  /* "src/lxml/saxparser.pxi":258
+  /* "src/lxml/saxparser.pxi":267
  * 
  *     def __next__(self):
  *         cdef int event_index = self._event_index             # <<<<<<<<<<<<<<
@@ -129203,7 +129209,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   __pyx_t_1 = __pyx_v_self->_event_index;
   __pyx_v_event_index = __pyx_t_1;
 
-  /* "src/lxml/saxparser.pxi":259
+  /* "src/lxml/saxparser.pxi":268
  *     def __next__(self):
  *         cdef int event_index = self._event_index
  *         events = self._events             # <<<<<<<<<<<<<<
@@ -129215,7 +129221,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   __pyx_v_events = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "src/lxml/saxparser.pxi":260
+  /* "src/lxml/saxparser.pxi":269
  *         cdef int event_index = self._event_index
  *         events = self._events
  *         if event_index >= 2**10 or event_index * 2 >= len(events):             # <<<<<<<<<<<<<<
@@ -129230,15 +129236,15 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   }
   if (unlikely(__pyx_v_events == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(8, 260, __pyx_L1_error)
+    __PYX_ERR(3, 269, __pyx_L1_error)
   }
-  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(8, 260, __pyx_L1_error)
+  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 269, __pyx_L1_error)
   __pyx_t_4 = (((__pyx_v_event_index * 2) >= __pyx_t_5) != 0);
   __pyx_t_3 = __pyx_t_4;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "src/lxml/saxparser.pxi":261
+    /* "src/lxml/saxparser.pxi":270
  *         events = self._events
  *         if event_index >= 2**10 or event_index * 2 >= len(events):
  *             if event_index:             # <<<<<<<<<<<<<<
@@ -129248,7 +129254,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
     __pyx_t_3 = (__pyx_v_event_index != 0);
     if (__pyx_t_3) {
 
-      /* "src/lxml/saxparser.pxi":263
+      /* "src/lxml/saxparser.pxi":272
  *             if event_index:
  *                 # clean up from time to time
  *                 del events[:event_index]             # <<<<<<<<<<<<<<
@@ -129257,11 +129263,11 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
       if (unlikely(__pyx_v_events == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(8, 263, __pyx_L1_error)
+        __PYX_ERR(3, 272, __pyx_L1_error)
       }
-      if (__Pyx_PyObject_DelSlice(__pyx_v_events, 0, __pyx_v_event_index, NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(8, 263, __pyx_L1_error)
+      if (__Pyx_PyObject_DelSlice(__pyx_v_events, 0, __pyx_v_event_index, NULL, NULL, NULL, 0, 1, 1) < 0) __PYX_ERR(3, 272, __pyx_L1_error)
 
-      /* "src/lxml/saxparser.pxi":264
+      /* "src/lxml/saxparser.pxi":273
  *                 # clean up from time to time
  *                 del events[:event_index]
  *                 self._event_index = event_index = 0             # <<<<<<<<<<<<<<
@@ -129271,7 +129277,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
       __pyx_v_self->_event_index = 0;
       __pyx_v_event_index = 0;
 
-      /* "src/lxml/saxparser.pxi":261
+      /* "src/lxml/saxparser.pxi":270
  *         events = self._events
  *         if event_index >= 2**10 or event_index * 2 >= len(events):
  *             if event_index:             # <<<<<<<<<<<<<<
@@ -129280,7 +129286,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
     }
 
-    /* "src/lxml/saxparser.pxi":265
+    /* "src/lxml/saxparser.pxi":274
  *                 del events[:event_index]
  *                 self._event_index = event_index = 0
  *             if event_index >= len(events):             # <<<<<<<<<<<<<<
@@ -129289,13 +129295,13 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
     if (unlikely(__pyx_v_events == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(8, 265, __pyx_L1_error)
+      __PYX_ERR(3, 274, __pyx_L1_error)
     }
-    __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(8, 265, __pyx_L1_error)
+    __pyx_t_5 = PyList_GET_SIZE(__pyx_v_events); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(3, 274, __pyx_L1_error)
     __pyx_t_3 = ((__pyx_v_event_index >= __pyx_t_5) != 0);
     if (unlikely(__pyx_t_3)) {
 
-      /* "src/lxml/saxparser.pxi":266
+      /* "src/lxml/saxparser.pxi":275
  *                 self._event_index = event_index = 0
  *             if event_index >= len(events):
  *                 raise StopIteration             # <<<<<<<<<<<<<<
@@ -129303,9 +129309,9 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  *         self._event_index = event_index + 1
  */
       __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
-      __PYX_ERR(8, 266, __pyx_L1_error)
+      __PYX_ERR(3, 275, __pyx_L1_error)
 
-      /* "src/lxml/saxparser.pxi":265
+      /* "src/lxml/saxparser.pxi":274
  *                 del events[:event_index]
  *                 self._event_index = event_index = 0
  *             if event_index >= len(events):             # <<<<<<<<<<<<<<
@@ -129314,7 +129320,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
     }
 
-    /* "src/lxml/saxparser.pxi":260
+    /* "src/lxml/saxparser.pxi":269
  *         cdef int event_index = self._event_index
  *         events = self._events
  *         if event_index >= 2**10 or event_index * 2 >= len(events):             # <<<<<<<<<<<<<<
@@ -129323,7 +129329,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
   }
 
-  /* "src/lxml/saxparser.pxi":267
+  /* "src/lxml/saxparser.pxi":276
  *             if event_index >= len(events):
  *                 raise StopIteration
  *         item = events[event_index]             # <<<<<<<<<<<<<<
@@ -129332,14 +129338,14 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
   if (unlikely(__pyx_v_events == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(8, 267, __pyx_L1_error)
+    __PYX_ERR(3, 276, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_events, __pyx_v_event_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 267, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_events, __pyx_v_event_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 276, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_v_item = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "src/lxml/saxparser.pxi":268
+  /* "src/lxml/saxparser.pxi":277
  *                 raise StopIteration
  *         item = events[event_index]
  *         self._event_index = event_index + 1             # <<<<<<<<<<<<<<
@@ -129348,7 +129354,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
  */
   __pyx_v_self->_event_index = (__pyx_v_event_index + 1);
 
-  /* "src/lxml/saxparser.pxi":269
+  /* "src/lxml/saxparser.pxi":278
  *         item = events[event_index]
  *         self._event_index = event_index + 1
  *         return item             # <<<<<<<<<<<<<<
@@ -129360,7 +129366,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   __pyx_r = __pyx_v_item;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":257
+  /* "src/lxml/saxparser.pxi":266
  *         return self
  * 
  *     def __next__(self):             # <<<<<<<<<<<<<<
@@ -129381,7 +129387,7 @@ static PyObject *__pyx_pf_4lxml_5etree_20_ParseEventsIterator_4__next__(struct _
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":272
+/* "src/lxml/saxparser.pxi":281
  * 
  * 
  * cdef list _build_prefix_uri_list(_SaxParserContext context, int c_nb_namespaces,             # <<<<<<<<<<<<<<
@@ -129406,19 +129412,19 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_build_prefix_uri_list", 0);
 
-  /* "src/lxml/saxparser.pxi":276
+  /* "src/lxml/saxparser.pxi":285
  *     "Build [(prefix, uri)] list of declared namespaces."
  *     cdef int i
  *     namespaces = []             # <<<<<<<<<<<<<<
  *     for i in xrange(c_nb_namespaces):
  *         namespaces.append((funicodeOrEmpty(c_namespaces[0]), funicode(c_namespaces[1])))
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 276, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 285, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_namespaces = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":277
+  /* "src/lxml/saxparser.pxi":286
  *     cdef int i
  *     namespaces = []
  *     for i in xrange(c_nb_namespaces):             # <<<<<<<<<<<<<<
@@ -129430,18 +129436,18 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
   for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
     __pyx_v_i = __pyx_t_4;
 
-    /* "src/lxml/saxparser.pxi":278
+    /* "src/lxml/saxparser.pxi":287
  *     namespaces = []
  *     for i in xrange(c_nb_namespaces):
  *         namespaces.append((funicodeOrEmpty(c_namespaces[0]), funicode(c_namespaces[1])))             # <<<<<<<<<<<<<<
  *         c_namespaces += 2
  *     return namespaces
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrEmpty((__pyx_v_c_namespaces[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 278, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_funicodeOrEmpty((__pyx_v_c_namespaces[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 287, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 278, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[1])); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 287, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 278, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 287, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_GIVEREF(__pyx_t_1);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
@@ -129449,10 +129455,10 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
     PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
     __pyx_t_1 = 0;
     __pyx_t_5 = 0;
-    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 278, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_namespaces, __pyx_t_6); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 287, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "src/lxml/saxparser.pxi":279
+    /* "src/lxml/saxparser.pxi":288
  *     for i in xrange(c_nb_namespaces):
  *         namespaces.append((funicodeOrEmpty(c_namespaces[0]), funicode(c_namespaces[1])))
  *         c_namespaces += 2             # <<<<<<<<<<<<<<
@@ -129462,7 +129468,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
     __pyx_v_c_namespaces = (__pyx_v_c_namespaces + 2);
   }
 
-  /* "src/lxml/saxparser.pxi":280
+  /* "src/lxml/saxparser.pxi":289
  *         namespaces.append((funicodeOrEmpty(c_namespaces[0]), funicode(c_namespaces[1])))
  *         c_namespaces += 2
  *     return namespaces             # <<<<<<<<<<<<<<
@@ -129474,7 +129480,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
   __pyx_r = __pyx_v_namespaces;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":272
+  /* "src/lxml/saxparser.pxi":281
  * 
  * 
  * cdef list _build_prefix_uri_list(_SaxParserContext context, int c_nb_namespaces,             # <<<<<<<<<<<<<<
@@ -129496,7 +129502,7 @@ static PyObject *__pyx_f_4lxml_5etree__build_prefix_uri_list(CYTHON_UNUSED struc
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":283
+/* "src/lxml/saxparser.pxi":292
  * 
  * 
  * cdef void _handleSaxStart(             # <<<<<<<<<<<<<<
@@ -129533,7 +129539,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
   #endif
   __Pyx_RefNannySetupContext("_handleSaxStart", 0);
 
-  /* "src/lxml/saxparser.pxi":291
+  /* "src/lxml/saxparser.pxi":300
  *     cdef int i
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -129542,7 +129548,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":292
+  /* "src/lxml/saxparser.pxi":301
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -129560,7 +129566,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":293
+    /* "src/lxml/saxparser.pxi":302
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -129569,7 +129575,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":292
+    /* "src/lxml/saxparser.pxi":301
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -129578,7 +129584,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
   }
 
-  /* "src/lxml/saxparser.pxi":294
+  /* "src/lxml/saxparser.pxi":303
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -129590,7 +129596,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":295
+  /* "src/lxml/saxparser.pxi":304
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     cdef int event_filter = context._event_filter             # <<<<<<<<<<<<<<
@@ -129600,7 +129606,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
   __pyx_t_4 = __pyx_v_context->_event_filter;
   __pyx_v_event_filter = __pyx_t_4;
 
-  /* "src/lxml/saxparser.pxi":296
+  /* "src/lxml/saxparser.pxi":305
  *     context = <_SaxParserContext>c_ctxt._private
  *     cdef int event_filter = context._event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -129617,7 +129623,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
       __Pyx_XGOTREF(__pyx_t_7);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":297
+        /* "src/lxml/saxparser.pxi":306
  *     cdef int event_filter = context._event_filter
  *     try:
  *         if (c_nb_namespaces and             # <<<<<<<<<<<<<<
@@ -129631,7 +129637,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
           goto __pyx_L16_bool_binop_done;
         }
 
-        /* "src/lxml/saxparser.pxi":298
+        /* "src/lxml/saxparser.pxi":307
  *     try:
  *         if (c_nb_namespaces and
  *                 event_filter & (PARSE_EVENT_FILTER_START_NS |             # <<<<<<<<<<<<<<
@@ -129642,7 +129648,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         __pyx_t_1 = __pyx_t_2;
         __pyx_L16_bool_binop_done:;
 
-        /* "src/lxml/saxparser.pxi":297
+        /* "src/lxml/saxparser.pxi":306
  *     cdef int event_filter = context._event_filter
  *     try:
  *         if (c_nb_namespaces and             # <<<<<<<<<<<<<<
@@ -129651,19 +129657,19 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":300
+          /* "src/lxml/saxparser.pxi":309
  *                 event_filter & (PARSE_EVENT_FILTER_START_NS |
  *                                 PARSE_EVENT_FILTER_END_NS)):
  *             declared_namespaces = _build_prefix_uri_list(             # <<<<<<<<<<<<<<
  *                 context, c_nb_namespaces, c_namespaces)
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  */
-          __pyx_t_3 = __pyx_f_4lxml_5etree__build_prefix_uri_list(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 300, __pyx_L9_error)
+          __pyx_t_3 = __pyx_f_4lxml_5etree__build_prefix_uri_list(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 309, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_declared_namespaces = ((PyObject*)__pyx_t_3);
           __pyx_t_3 = 0;
 
-          /* "src/lxml/saxparser.pxi":302
+          /* "src/lxml/saxparser.pxi":311
  *             declared_namespaces = _build_prefix_uri_list(
  *                 context, c_nb_namespaces, c_namespaces)
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:             # <<<<<<<<<<<<<<
@@ -129673,7 +129679,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
           __pyx_t_1 = ((__pyx_v_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START_NS) != 0);
           if (__pyx_t_1) {
 
-            /* "src/lxml/saxparser.pxi":303
+            /* "src/lxml/saxparser.pxi":312
  *                 context, c_nb_namespaces, c_namespaces)
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -129682,21 +129688,21 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
             if (unlikely(__pyx_v_declared_namespaces == Py_None)) {
               PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-              __PYX_ERR(8, 303, __pyx_L9_error)
+              __PYX_ERR(3, 312, __pyx_L9_error)
             }
             __pyx_t_3 = __pyx_v_declared_namespaces; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
             for (;;) {
               if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(8, 303, __pyx_L9_error)
+              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 312, __pyx_L9_error)
               #else
-              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 303, __pyx_L9_error)
+              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 312, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               #endif
               __Pyx_XDECREF_SET(__pyx_v_prefix_uri_tuple, __pyx_t_9);
               __pyx_t_9 = 0;
 
-              /* "src/lxml/saxparser.pxi":304
+              /* "src/lxml/saxparser.pxi":313
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:
  *                     context.events_iterator._events.append(("start-ns", prefix_uri_tuple))             # <<<<<<<<<<<<<<
@@ -129705,9 +129711,9 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
               if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
                 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-                __PYX_ERR(8, 304, __pyx_L9_error)
+                __PYX_ERR(3, 313, __pyx_L9_error)
               }
-              __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 304, __pyx_L9_error)
+              __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 313, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               __Pyx_INCREF(__pyx_kp_s_start_ns);
               __Pyx_GIVEREF(__pyx_kp_s_start_ns);
@@ -129715,10 +129721,10 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
               __Pyx_INCREF(__pyx_v_prefix_uri_tuple);
               __Pyx_GIVEREF(__pyx_v_prefix_uri_tuple);
               PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_prefix_uri_tuple);
-              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(8, 304, __pyx_L9_error)
+              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 313, __pyx_L9_error)
               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-              /* "src/lxml/saxparser.pxi":303
+              /* "src/lxml/saxparser.pxi":312
  *                 context, c_nb_namespaces, c_namespaces)
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -129728,7 +129734,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
             }
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":302
+            /* "src/lxml/saxparser.pxi":311
  *             declared_namespaces = _build_prefix_uri_list(
  *                 context, c_nb_namespaces, c_namespaces)
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:             # <<<<<<<<<<<<<<
@@ -129737,7 +129743,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
           }
 
-          /* "src/lxml/saxparser.pxi":297
+          /* "src/lxml/saxparser.pxi":306
  *     cdef int event_filter = context._event_filter
  *     try:
  *         if (c_nb_namespaces and             # <<<<<<<<<<<<<<
@@ -129747,7 +129753,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
           goto __pyx_L15;
         }
 
-        /* "src/lxml/saxparser.pxi":306
+        /* "src/lxml/saxparser.pxi":315
  *                     context.events_iterator._events.append(("start-ns", prefix_uri_tuple))
  *         else:
  *             declared_namespaces = None             # <<<<<<<<<<<<<<
@@ -129760,7 +129766,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         }
         __pyx_L15:;
 
-        /* "src/lxml/saxparser.pxi":308
+        /* "src/lxml/saxparser.pxi":317
  *             declared_namespaces = None
  * 
  *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,             # <<<<<<<<<<<<<<
@@ -129769,7 +129775,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
         __pyx_v_context->_origSaxStart(__pyx_v_c_ctxt, __pyx_v_c_localname, __pyx_v_c_prefix, __pyx_v_c_namespace, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces, __pyx_v_c_nb_attributes, __pyx_v_c_nb_defaulted, __pyx_v_c_attributes);
 
-        /* "src/lxml/saxparser.pxi":311
+        /* "src/lxml/saxparser.pxi":320
  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
  *                               c_nb_defaulted, c_attributes)
  *         if c_ctxt.html:             # <<<<<<<<<<<<<<
@@ -129779,7 +129785,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         __pyx_t_1 = (__pyx_v_c_ctxt->html != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":312
+          /* "src/lxml/saxparser.pxi":321
  *                               c_nb_defaulted, c_attributes)
  *         if c_ctxt.html:
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)             # <<<<<<<<<<<<<<
@@ -129788,7 +129794,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
           (void)(__pyx_f_4lxml_5etree__fixHtmlDictNodeNames(__pyx_v_c_ctxt->dict, __pyx_v_c_ctxt->node));
 
-          /* "src/lxml/saxparser.pxi":311
+          /* "src/lxml/saxparser.pxi":320
  *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
  *                               c_nb_defaulted, c_attributes)
  *         if c_ctxt.html:             # <<<<<<<<<<<<<<
@@ -129797,7 +129803,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
         }
 
-        /* "src/lxml/saxparser.pxi":314
+        /* "src/lxml/saxparser.pxi":323
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)
  * 
  *         if event_filter & PARSE_EVENT_FILTER_END_NS:             # <<<<<<<<<<<<<<
@@ -129807,7 +129813,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         __pyx_t_1 = ((__pyx_v_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END_NS) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":315
+          /* "src/lxml/saxparser.pxi":324
  * 
  *         if event_filter & PARSE_EVENT_FILTER_END_NS:
  *             context._ns_stack.append(declared_namespaces)             # <<<<<<<<<<<<<<
@@ -129816,11 +129822,11 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
           if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
             PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-            __PYX_ERR(8, 315, __pyx_L9_error)
+            __PYX_ERR(3, 324, __pyx_L9_error)
           }
-          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_v_declared_namespaces); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(8, 315, __pyx_L9_error)
+          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_v_declared_namespaces); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 324, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":314
+          /* "src/lxml/saxparser.pxi":323
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)
  * 
  *         if event_filter & PARSE_EVENT_FILTER_END_NS:             # <<<<<<<<<<<<<<
@@ -129829,7 +129835,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
         }
 
-        /* "src/lxml/saxparser.pxi":316
+        /* "src/lxml/saxparser.pxi":325
  *         if event_filter & PARSE_EVENT_FILTER_END_NS:
  *             context._ns_stack.append(declared_namespaces)
  *         if event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -129839,16 +129845,16 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
         __pyx_t_1 = ((__pyx_v_event_filter & (__pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START)) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":318
+          /* "src/lxml/saxparser.pxi":327
  *         if event_filter & (PARSE_EVENT_FILTER_END |
  *                            PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, c_namespace, c_localname, None)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-          __pyx_t_4 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, Py_None); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 318, __pyx_L9_error)
+          __pyx_t_4 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, Py_None); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 327, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":316
+          /* "src/lxml/saxparser.pxi":325
  *         if event_filter & PARSE_EVENT_FILTER_END_NS:
  *             context._ns_stack.append(declared_namespaces)
  *         if event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -129857,7 +129863,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
         }
 
-        /* "src/lxml/saxparser.pxi":296
+        /* "src/lxml/saxparser.pxi":305
  *     context = <_SaxParserContext>c_ctxt._private
  *     cdef int event_filter = context._event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -129873,7 +129879,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-      /* "src/lxml/saxparser.pxi":319
+      /* "src/lxml/saxparser.pxi":328
  *                            PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, c_namespace, c_localname, None)
  *     except:             # <<<<<<<<<<<<<<
@@ -129882,12 +129888,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxStart", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(8, 319, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_11) < 0) __PYX_ERR(3, 328, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GOTREF(__pyx_t_11);
 
-        /* "src/lxml/saxparser.pxi":320
+        /* "src/lxml/saxparser.pxi":329
  *             _pushSaxStartEvent(context, c_ctxt, c_namespace, c_localname, None)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -129902,7 +129908,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":296
+      /* "src/lxml/saxparser.pxi":305
  *     context = <_SaxParserContext>c_ctxt._private
  *     cdef int event_filter = context._event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -129923,7 +129929,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
     }
   }
 
-  /* "src/lxml/saxparser.pxi":322
+  /* "src/lxml/saxparser.pxi":331
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -129968,7 +129974,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
     }
   }
 
-  /* "src/lxml/saxparser.pxi":283
+  /* "src/lxml/saxparser.pxi":292
  * 
  * 
  * cdef void _handleSaxStart(             # <<<<<<<<<<<<<<
@@ -129987,7 +129993,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStart(void *__pyx_v_ctxt, const xmlCh
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":325
+/* "src/lxml/saxparser.pxi":334
  * 
  * 
  * cdef void _handleSaxTargetStart(             # <<<<<<<<<<<<<<
@@ -130039,7 +130045,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   #endif
   __Pyx_RefNannySetupContext("_handleSaxTargetStart", 0);
 
-  /* "src/lxml/saxparser.pxi":333
+  /* "src/lxml/saxparser.pxi":342
  *     cdef int i
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -130048,7 +130054,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":334
+  /* "src/lxml/saxparser.pxi":343
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -130066,7 +130072,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":335
+    /* "src/lxml/saxparser.pxi":344
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -130075,7 +130081,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":334
+    /* "src/lxml/saxparser.pxi":343
  *     cdef size_t c_len
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -130084,7 +130090,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
   }
 
-  /* "src/lxml/saxparser.pxi":336
+  /* "src/lxml/saxparser.pxi":345
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -130096,7 +130102,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":338
+  /* "src/lxml/saxparser.pxi":347
  *     context = <_SaxParserContext>c_ctxt._private
  * 
  *     cdef int event_filter = context._event_filter             # <<<<<<<<<<<<<<
@@ -130106,7 +130112,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   __pyx_t_4 = __pyx_v_context->_event_filter;
   __pyx_v_event_filter = __pyx_t_4;
 
-  /* "src/lxml/saxparser.pxi":339
+  /* "src/lxml/saxparser.pxi":348
  * 
  *     cdef int event_filter = context._event_filter
  *     cdef int sax_event_filter = context._target._sax_event_filter             # <<<<<<<<<<<<<<
@@ -130116,7 +130122,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   __pyx_t_4 = __pyx_v_context->_target->_sax_event_filter;
   __pyx_v_sax_event_filter = __pyx_t_4;
 
-  /* "src/lxml/saxparser.pxi":340
+  /* "src/lxml/saxparser.pxi":349
  *     cdef int event_filter = context._event_filter
  *     cdef int sax_event_filter = context._target._sax_event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -130133,7 +130139,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
       __Pyx_XGOTREF(__pyx_t_7);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":341
+        /* "src/lxml/saxparser.pxi":350
  *     cdef int sax_event_filter = context._target._sax_event_filter
  *     try:
  *         if c_nb_namespaces:             # <<<<<<<<<<<<<<
@@ -130143,19 +130149,19 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         __pyx_t_1 = (__pyx_v_c_nb_namespaces != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":342
+          /* "src/lxml/saxparser.pxi":351
  *     try:
  *         if c_nb_namespaces:
  *             declared_namespaces = _build_prefix_uri_list(             # <<<<<<<<<<<<<<
  *                 context, c_nb_namespaces, c_namespaces)
  * 
  */
-          __pyx_t_3 = __pyx_f_4lxml_5etree__build_prefix_uri_list(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 342, __pyx_L9_error)
+          __pyx_t_3 = __pyx_f_4lxml_5etree__build_prefix_uri_list(__pyx_v_context, __pyx_v_c_nb_namespaces, __pyx_v_c_namespaces); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 351, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_declared_namespaces = ((PyObject*)__pyx_t_3);
           __pyx_t_3 = 0;
 
-          /* "src/lxml/saxparser.pxi":345
+          /* "src/lxml/saxparser.pxi":354
  *                 context, c_nb_namespaces, c_namespaces)
  * 
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:             # <<<<<<<<<<<<<<
@@ -130165,7 +130171,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           __pyx_t_1 = ((__pyx_v_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START_NS) != 0);
           if (__pyx_t_1) {
 
-            /* "src/lxml/saxparser.pxi":346
+            /* "src/lxml/saxparser.pxi":355
  * 
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -130174,21 +130180,21 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
             if (unlikely(__pyx_v_declared_namespaces == Py_None)) {
               PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-              __PYX_ERR(8, 346, __pyx_L9_error)
+              __PYX_ERR(3, 355, __pyx_L9_error)
             }
             __pyx_t_3 = __pyx_v_declared_namespaces; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
             for (;;) {
               if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(8, 346, __pyx_L9_error)
+              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 355, __pyx_L9_error)
               #else
-              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 346, __pyx_L9_error)
+              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 355, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               #endif
               __Pyx_XDECREF_SET(__pyx_v_prefix_uri_tuple, __pyx_t_9);
               __pyx_t_9 = 0;
 
-              /* "src/lxml/saxparser.pxi":347
+              /* "src/lxml/saxparser.pxi":356
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:
  *                     context.events_iterator._events.append(("start-ns", prefix_uri_tuple))             # <<<<<<<<<<<<<<
@@ -130197,9 +130203,9 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
               if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
                 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-                __PYX_ERR(8, 347, __pyx_L9_error)
+                __PYX_ERR(3, 356, __pyx_L9_error)
               }
-              __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 347, __pyx_L9_error)
+              __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 356, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               __Pyx_INCREF(__pyx_kp_s_start_ns);
               __Pyx_GIVEREF(__pyx_kp_s_start_ns);
@@ -130207,10 +130213,10 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
               __Pyx_INCREF(__pyx_v_prefix_uri_tuple);
               __Pyx_GIVEREF(__pyx_v_prefix_uri_tuple);
               PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_prefix_uri_tuple);
-              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(8, 347, __pyx_L9_error)
+              __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 356, __pyx_L9_error)
               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-              /* "src/lxml/saxparser.pxi":346
+              /* "src/lxml/saxparser.pxi":355
  * 
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:
  *                 for prefix_uri_tuple in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -130220,7 +130226,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             }
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":345
+            /* "src/lxml/saxparser.pxi":354
  *                 context, c_nb_namespaces, c_namespaces)
  * 
  *             if event_filter & PARSE_EVENT_FILTER_START_NS:             # <<<<<<<<<<<<<<
@@ -130229,7 +130235,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
           }
 
-          /* "src/lxml/saxparser.pxi":349
+          /* "src/lxml/saxparser.pxi":358
  *                     context.events_iterator._events.append(("start-ns", prefix_uri_tuple))
  * 
  *             if sax_event_filter & SAX_EVENT_START_NS:             # <<<<<<<<<<<<<<
@@ -130239,7 +130245,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           __pyx_t_1 = ((__pyx_v_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_START_NS) != 0);
           if (__pyx_t_1) {
 
-            /* "src/lxml/saxparser.pxi":350
+            /* "src/lxml/saxparser.pxi":359
  * 
  *             if sax_event_filter & SAX_EVENT_START_NS:
  *                 for prefix, uri in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -130248,15 +130254,15 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
             if (unlikely(__pyx_v_declared_namespaces == Py_None)) {
               PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-              __PYX_ERR(8, 350, __pyx_L9_error)
+              __PYX_ERR(3, 359, __pyx_L9_error)
             }
             __pyx_t_3 = __pyx_v_declared_namespaces; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
             for (;;) {
               if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
               #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(8, 350, __pyx_L9_error)
+              __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(3, 359, __pyx_L9_error)
               #else
-              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 350, __pyx_L9_error)
+              __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 359, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               #endif
               if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
@@ -130265,7 +130271,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 if (unlikely(size != 2)) {
                   if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                   else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-                  __PYX_ERR(8, 350, __pyx_L9_error)
+                  __PYX_ERR(3, 359, __pyx_L9_error)
                 }
                 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                 if (likely(PyTuple_CheckExact(sequence))) {
@@ -130278,15 +130284,15 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 __Pyx_INCREF(__pyx_t_11);
                 __Pyx_INCREF(__pyx_t_12);
                 #else
-                __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(8, 350, __pyx_L9_error)
+                __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 359, __pyx_L9_error)
                 __Pyx_GOTREF(__pyx_t_11);
-                __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(8, 350, __pyx_L9_error)
+                __pyx_t_12 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 359, __pyx_L9_error)
                 __Pyx_GOTREF(__pyx_t_12);
                 #endif
                 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
               } else {
                 Py_ssize_t index = -1;
-                __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(8, 350, __pyx_L9_error)
+                __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(3, 359, __pyx_L9_error)
                 __Pyx_GOTREF(__pyx_t_13);
                 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                 __pyx_t_14 = Py_TYPE(__pyx_t_13)->tp_iternext;
@@ -130294,7 +130300,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 __Pyx_GOTREF(__pyx_t_11);
                 index = 1; __pyx_t_12 = __pyx_t_14(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L22_unpacking_failed;
                 __Pyx_GOTREF(__pyx_t_12);
-                if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(8, 350, __pyx_L9_error)
+                if (__Pyx_IternextUnpackEndCheck(__pyx_t_14(__pyx_t_13), 2) < 0) __PYX_ERR(3, 359, __pyx_L9_error)
                 __pyx_t_14 = NULL;
                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                 goto __pyx_L23_unpacking_done;
@@ -130302,7 +130308,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                 __pyx_t_14 = NULL;
                 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-                __PYX_ERR(8, 350, __pyx_L9_error)
+                __PYX_ERR(3, 359, __pyx_L9_error)
                 __pyx_L23_unpacking_done:;
               }
               __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_11);
@@ -130310,18 +130316,18 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
               __Pyx_XDECREF_SET(__pyx_v_uri, __pyx_t_12);
               __pyx_t_12 = 0;
 
-              /* "src/lxml/saxparser.pxi":351
+              /* "src/lxml/saxparser.pxi":360
  *             if sax_event_filter & SAX_EVENT_START_NS:
  *                 for prefix, uri in declared_namespaces:
  *                     context._target._handleSaxStartNs(prefix, uri)             # <<<<<<<<<<<<<<
  *                 #if not context._target._sax_event_filter & SAX_EVENT_START:
  *                 #    # *Only* collecting start-ns events.
  */
-              __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStartNs(__pyx_v_context->_target, __pyx_v_prefix, __pyx_v_uri); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 351, __pyx_L9_error)
+              __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStartNs(__pyx_v_context->_target, __pyx_v_prefix, __pyx_v_uri); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 360, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_9);
               __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-              /* "src/lxml/saxparser.pxi":350
+              /* "src/lxml/saxparser.pxi":359
  * 
  *             if sax_event_filter & SAX_EVENT_START_NS:
  *                 for prefix, uri in declared_namespaces:             # <<<<<<<<<<<<<<
@@ -130331,7 +130337,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             }
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":349
+            /* "src/lxml/saxparser.pxi":358
  *                     context.events_iterator._events.append(("start-ns", prefix_uri_tuple))
  * 
  *             if sax_event_filter & SAX_EVENT_START_NS:             # <<<<<<<<<<<<<<
@@ -130340,7 +130346,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
           }
 
-          /* "src/lxml/saxparser.pxi":341
+          /* "src/lxml/saxparser.pxi":350
  *     cdef int sax_event_filter = context._target._sax_event_filter
  *     try:
  *         if c_nb_namespaces:             # <<<<<<<<<<<<<<
@@ -130350,7 +130356,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           goto __pyx_L15;
         }
 
-        /* "src/lxml/saxparser.pxi":356
+        /* "src/lxml/saxparser.pxi":365
  *                 #    return
  *         else:
  *             declared_namespaces = None             # <<<<<<<<<<<<<<
@@ -130363,7 +130369,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         }
         __pyx_L15:;
 
-        /* "src/lxml/saxparser.pxi":358
+        /* "src/lxml/saxparser.pxi":367
  *             declared_namespaces = None
  * 
  *         if sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<<
@@ -130373,7 +130379,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         __pyx_t_1 = ((__pyx_v_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_START) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":359
+          /* "src/lxml/saxparser.pxi":368
  * 
  *         if sax_event_filter & SAX_EVENT_START:
  *             if c_nb_defaulted > 0:             # <<<<<<<<<<<<<<
@@ -130383,7 +130389,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           __pyx_t_1 = ((__pyx_v_c_nb_defaulted > 0) != 0);
           if (__pyx_t_1) {
 
-            /* "src/lxml/saxparser.pxi":361
+            /* "src/lxml/saxparser.pxi":370
  *             if c_nb_defaulted > 0:
  *                 # only add default attributes if we asked for them
  *                 if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:             # <<<<<<<<<<<<<<
@@ -130393,7 +130399,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             __pyx_t_1 = (((__pyx_v_c_ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0) != 0);
             if (__pyx_t_1) {
 
-              /* "src/lxml/saxparser.pxi":362
+              /* "src/lxml/saxparser.pxi":371
  *                 # only add default attributes if we asked for them
  *                 if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
  *                     c_nb_attributes -= c_nb_defaulted             # <<<<<<<<<<<<<<
@@ -130402,7 +130408,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
               __pyx_v_c_nb_attributes = (__pyx_v_c_nb_attributes - __pyx_v_c_nb_defaulted);
 
-              /* "src/lxml/saxparser.pxi":361
+              /* "src/lxml/saxparser.pxi":370
  *             if c_nb_defaulted > 0:
  *                 # only add default attributes if we asked for them
  *                 if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:             # <<<<<<<<<<<<<<
@@ -130411,7 +130417,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
             }
 
-            /* "src/lxml/saxparser.pxi":359
+            /* "src/lxml/saxparser.pxi":368
  * 
  *         if sax_event_filter & SAX_EVENT_START:
  *             if c_nb_defaulted > 0:             # <<<<<<<<<<<<<<
@@ -130420,7 +130426,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
           }
 
-          /* "src/lxml/saxparser.pxi":363
+          /* "src/lxml/saxparser.pxi":372
  *                 if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
  *                     c_nb_attributes -= c_nb_defaulted
  *             if c_nb_attributes == 0:             # <<<<<<<<<<<<<<
@@ -130430,7 +130436,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           __pyx_t_1 = ((__pyx_v_c_nb_attributes == 0) != 0);
           if (__pyx_t_1) {
 
-            /* "src/lxml/saxparser.pxi":364
+            /* "src/lxml/saxparser.pxi":373
  *                     c_nb_attributes -= c_nb_defaulted
  *             if c_nb_attributes == 0:
  *                 attrib = IMMUTABLE_EMPTY_MAPPING             # <<<<<<<<<<<<<<
@@ -130440,7 +130446,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             __Pyx_INCREF(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
             __pyx_v_attrib = __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING;
 
-            /* "src/lxml/saxparser.pxi":363
+            /* "src/lxml/saxparser.pxi":372
  *                 if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
  *                     c_nb_attributes -= c_nb_defaulted
  *             if c_nb_attributes == 0:             # <<<<<<<<<<<<<<
@@ -130450,7 +130456,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             goto __pyx_L27;
           }
 
-          /* "src/lxml/saxparser.pxi":366
+          /* "src/lxml/saxparser.pxi":375
  *                 attrib = IMMUTABLE_EMPTY_MAPPING
  *             else:
  *                 attrib = {}             # <<<<<<<<<<<<<<
@@ -130458,12 +130464,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *                     name = _namespacedNameFromNsName(
  */
           /*else*/ {
-            __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 366, __pyx_L9_error)
+            __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 375, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_3);
             __pyx_v_attrib = __pyx_t_3;
             __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":367
+            /* "src/lxml/saxparser.pxi":376
  *             else:
  *                 attrib = {}
  *                 for i in xrange(c_nb_attributes):             # <<<<<<<<<<<<<<
@@ -130475,19 +130481,19 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
             for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
               __pyx_v_i = __pyx_t_16;
 
-              /* "src/lxml/saxparser.pxi":368
+              /* "src/lxml/saxparser.pxi":377
  *                 attrib = {}
  *                 for i in xrange(c_nb_attributes):
  *                     name = _namespacedNameFromNsName(             # <<<<<<<<<<<<<<
  *                         c_attributes[2], c_attributes[0])
  *                     if c_attributes[3] is NULL:
  */
-              __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName((__pyx_v_c_attributes[2]), (__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 368, __pyx_L9_error)
+              __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName((__pyx_v_c_attributes[2]), (__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 377, __pyx_L9_error)
               __Pyx_GOTREF(__pyx_t_3);
               __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
               __pyx_t_3 = 0;
 
-              /* "src/lxml/saxparser.pxi":370
+              /* "src/lxml/saxparser.pxi":379
  *                     name = _namespacedNameFromNsName(
  *                         c_attributes[2], c_attributes[0])
  *                     if c_attributes[3] is NULL:             # <<<<<<<<<<<<<<
@@ -130497,7 +130503,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
               __pyx_t_1 = (((__pyx_v_c_attributes[3]) == NULL) != 0);
               if (__pyx_t_1) {
 
-                /* "src/lxml/saxparser.pxi":371
+                /* "src/lxml/saxparser.pxi":380
  *                         c_attributes[2], c_attributes[0])
  *                     if c_attributes[3] is NULL:
  *                         value = ''             # <<<<<<<<<<<<<<
@@ -130507,7 +130513,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 __Pyx_INCREF(__pyx_kp_s__12);
                 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_kp_s__12);
 
-                /* "src/lxml/saxparser.pxi":370
+                /* "src/lxml/saxparser.pxi":379
  *                     name = _namespacedNameFromNsName(
  *                         c_attributes[2], c_attributes[0])
  *                     if c_attributes[3] is NULL:             # <<<<<<<<<<<<<<
@@ -130517,7 +130523,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
                 goto __pyx_L30;
               }
 
-              /* "src/lxml/saxparser.pxi":373
+              /* "src/lxml/saxparser.pxi":382
  *                         value = ''
  *                     else:
  *                         c_len = c_attributes[4] - c_attributes[3]             # <<<<<<<<<<<<<<
@@ -130527,30 +130533,30 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
               /*else*/ {
                 __pyx_v_c_len = ((__pyx_v_c_attributes[4]) - (__pyx_v_c_attributes[3]));
 
-                /* "src/lxml/saxparser.pxi":374
+                /* "src/lxml/saxparser.pxi":383
  *                     else:
  *                         c_len = c_attributes[4] - c_attributes[3]
  *                         value = c_attributes[3][:c_len].decode('utf8')             # <<<<<<<<<<<<<<
  *                     attrib[name] = value
  *                     c_attributes += 5
  */
-                __pyx_t_3 = __Pyx_decode_c_string(((char const *)(__pyx_v_c_attributes[3])), 0, __pyx_v_c_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 374, __pyx_L9_error)
+                __pyx_t_3 = __Pyx_decode_c_string(((char const *)(__pyx_v_c_attributes[3])), 0, __pyx_v_c_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 383, __pyx_L9_error)
                 __Pyx_GOTREF(__pyx_t_3);
                 __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
                 __pyx_t_3 = 0;
               }
               __pyx_L30:;
 
-              /* "src/lxml/saxparser.pxi":375
+              /* "src/lxml/saxparser.pxi":384
  *                         c_len = c_attributes[4] - c_attributes[3]
  *                         value = c_attributes[3][:c_len].decode('utf8')
  *                     attrib[name] = value             # <<<<<<<<<<<<<<
  *                     c_attributes += 5
  * 
  */
-              if (unlikely(PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(8, 375, __pyx_L9_error)
+              if (unlikely(PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_v_value) < 0)) __PYX_ERR(3, 384, __pyx_L9_error)
 
-              /* "src/lxml/saxparser.pxi":376
+              /* "src/lxml/saxparser.pxi":385
  *                         value = c_attributes[3][:c_len].decode('utf8')
  *                     attrib[name] = value
  *                     c_attributes += 5             # <<<<<<<<<<<<<<
@@ -130562,7 +130568,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           }
           __pyx_L27:;
 
-          /* "src/lxml/saxparser.pxi":378
+          /* "src/lxml/saxparser.pxi":387
  *                     c_attributes += 5
  * 
  *             nsmap = dict(declared_namespaces) if c_nb_namespaces else IMMUTABLE_EMPTY_MAPPING             # <<<<<<<<<<<<<<
@@ -130570,7 +130576,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  *             element = _callTargetSaxStart(
  */
           if ((__pyx_v_c_nb_namespaces != 0)) {
-            __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_declared_namespaces); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 378, __pyx_L9_error)
+            __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_v_declared_namespaces); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 387, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_9);
             __pyx_t_3 = __pyx_t_9;
             __pyx_t_9 = 0;
@@ -130581,30 +130587,30 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           __pyx_v_nsmap = __pyx_t_3;
           __pyx_t_3 = 0;
 
-          /* "src/lxml/saxparser.pxi":382
+          /* "src/lxml/saxparser.pxi":391
  *             element = _callTargetSaxStart(
  *                 context, c_ctxt,
  *                 _namespacedNameFromNsName(c_namespace, c_localname),             # <<<<<<<<<<<<<<
  *                 attrib, nsmap)
  *         else:
  */
-          __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 382, __pyx_L9_error)
+          __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 391, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
 
-          /* "src/lxml/saxparser.pxi":380
+          /* "src/lxml/saxparser.pxi":389
  *             nsmap = dict(declared_namespaces) if c_nb_namespaces else IMMUTABLE_EMPTY_MAPPING
  * 
  *             element = _callTargetSaxStart(             # <<<<<<<<<<<<<<
  *                 context, c_ctxt,
  *                 _namespacedNameFromNsName(c_namespace, c_localname),
  */
-          __pyx_t_9 = __pyx_f_4lxml_5etree__callTargetSaxStart(__pyx_v_context, __pyx_v_c_ctxt, __pyx_t_3, __pyx_v_attrib, __pyx_v_nsmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(8, 380, __pyx_L9_error)
+          __pyx_t_9 = __pyx_f_4lxml_5etree__callTargetSaxStart(__pyx_v_context, __pyx_v_c_ctxt, __pyx_t_3, __pyx_v_attrib, __pyx_v_nsmap); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 389, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_9);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           __pyx_v_element = __pyx_t_9;
           __pyx_t_9 = 0;
 
-          /* "src/lxml/saxparser.pxi":358
+          /* "src/lxml/saxparser.pxi":367
  *             declared_namespaces = None
  * 
  *         if sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<<
@@ -130614,7 +130620,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           goto __pyx_L24;
         }
 
-        /* "src/lxml/saxparser.pxi":385
+        /* "src/lxml/saxparser.pxi":394
  *                 attrib, nsmap)
  *         else:
  *             element = None             # <<<<<<<<<<<<<<
@@ -130627,7 +130633,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         }
         __pyx_L24:;
 
-        /* "src/lxml/saxparser.pxi":387
+        /* "src/lxml/saxparser.pxi":396
  *             element = None
  * 
  *         if (event_filter & PARSE_EVENT_FILTER_END_NS or             # <<<<<<<<<<<<<<
@@ -130641,7 +130647,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
           goto __pyx_L32_bool_binop_done;
         }
 
-        /* "src/lxml/saxparser.pxi":388
+        /* "src/lxml/saxparser.pxi":397
  * 
  *         if (event_filter & PARSE_EVENT_FILTER_END_NS or
  *                 sax_event_filter & SAX_EVENT_END_NS):             # <<<<<<<<<<<<<<
@@ -130652,7 +130658,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         __pyx_t_1 = __pyx_t_2;
         __pyx_L32_bool_binop_done:;
 
-        /* "src/lxml/saxparser.pxi":387
+        /* "src/lxml/saxparser.pxi":396
  *             element = None
  * 
  *         if (event_filter & PARSE_EVENT_FILTER_END_NS or             # <<<<<<<<<<<<<<
@@ -130661,7 +130667,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":389
+          /* "src/lxml/saxparser.pxi":398
  *         if (event_filter & PARSE_EVENT_FILTER_END_NS or
  *                 sax_event_filter & SAX_EVENT_END_NS):
  *             context._ns_stack.append(declared_namespaces)             # <<<<<<<<<<<<<<
@@ -130670,11 +130676,11 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
           if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
             PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-            __PYX_ERR(8, 389, __pyx_L9_error)
+            __PYX_ERR(3, 398, __pyx_L9_error)
           }
-          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_v_declared_namespaces); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(8, 389, __pyx_L9_error)
+          __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_context->_ns_stack, __pyx_v_declared_namespaces); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 398, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":387
+          /* "src/lxml/saxparser.pxi":396
  *             element = None
  * 
  *         if (event_filter & PARSE_EVENT_FILTER_END_NS or             # <<<<<<<<<<<<<<
@@ -130683,7 +130689,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
         }
 
-        /* "src/lxml/saxparser.pxi":390
+        /* "src/lxml/saxparser.pxi":399
  *                 sax_event_filter & SAX_EVENT_END_NS):
  *             context._ns_stack.append(declared_namespaces)
  *         if event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -130693,16 +130699,16 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
         __pyx_t_1 = ((__pyx_v_event_filter & (__pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START)) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":392
+          /* "src/lxml/saxparser.pxi":401
  *         if event_filter & (PARSE_EVENT_FILTER_END |
  *                            PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, c_namespace,             # <<<<<<<<<<<<<<
  *                                c_localname, element)
  *     except:
  */
-          __pyx_t_4 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_element); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 392, __pyx_L9_error)
+          __pyx_t_4 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_element); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 401, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":390
+          /* "src/lxml/saxparser.pxi":399
  *                 sax_event_filter & SAX_EVENT_END_NS):
  *             context._ns_stack.append(declared_namespaces)
  *         if event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -130711,7 +130717,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
         }
 
-        /* "src/lxml/saxparser.pxi":340
+        /* "src/lxml/saxparser.pxi":349
  *     cdef int event_filter = context._event_filter
  *     cdef int sax_event_filter = context._target._sax_event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -130730,7 +130736,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
-      /* "src/lxml/saxparser.pxi":394
+      /* "src/lxml/saxparser.pxi":403
  *             _pushSaxStartEvent(context, c_ctxt, c_namespace,
  *                                c_localname, element)
  *     except:             # <<<<<<<<<<<<<<
@@ -130739,12 +130745,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxTargetStart", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_12) < 0) __PYX_ERR(8, 394, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_12) < 0) __PYX_ERR(3, 403, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_12);
 
-        /* "src/lxml/saxparser.pxi":395
+        /* "src/lxml/saxparser.pxi":404
  *                                c_localname, element)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -130759,7 +130765,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":340
+      /* "src/lxml/saxparser.pxi":349
  *     cdef int event_filter = context._event_filter
  *     cdef int sax_event_filter = context._target._sax_event_filter
  *     try:             # <<<<<<<<<<<<<<
@@ -130780,7 +130786,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
     }
   }
 
-  /* "src/lxml/saxparser.pxi":397
+  /* "src/lxml/saxparser.pxi":406
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -130827,7 +130833,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
     }
   }
 
-  /* "src/lxml/saxparser.pxi":325
+  /* "src/lxml/saxparser.pxi":334
  * 
  * 
  * cdef void _handleSaxTargetStart(             # <<<<<<<<<<<<<<
@@ -130853,7 +130859,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStart(void *__pyx_v_ctxt, const
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":400
+/* "src/lxml/saxparser.pxi":409
  * 
  * 
  * cdef void _handleSaxStartNoNs(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -130885,7 +130891,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
   #endif
   __Pyx_RefNannySetupContext("_handleSaxStartNoNs", 0);
 
-  /* "src/lxml/saxparser.pxi":402
+  /* "src/lxml/saxparser.pxi":411
  * cdef void _handleSaxStartNoNs(void* ctxt, const_xmlChar* c_name,
  *                               const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -130894,7 +130900,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":403
+  /* "src/lxml/saxparser.pxi":412
  *                               const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -130912,7 +130918,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":404
+    /* "src/lxml/saxparser.pxi":413
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -130921,7 +130927,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":403
+    /* "src/lxml/saxparser.pxi":412
  *                               const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -130930,7 +130936,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
   }
 
-  /* "src/lxml/saxparser.pxi":405
+  /* "src/lxml/saxparser.pxi":414
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -130942,7 +130948,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":406
+  /* "src/lxml/saxparser.pxi":415
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -130959,7 +130965,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":407
+        /* "src/lxml/saxparser.pxi":416
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)             # <<<<<<<<<<<<<<
@@ -130968,7 +130974,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
         __pyx_v_context->_origSaxStartNoNs(__pyx_v_c_ctxt, __pyx_v_c_name, __pyx_v_c_attributes);
 
-        /* "src/lxml/saxparser.pxi":408
+        /* "src/lxml/saxparser.pxi":417
  *     try:
  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
  *         if c_ctxt.html:             # <<<<<<<<<<<<<<
@@ -130978,7 +130984,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
         __pyx_t_1 = (__pyx_v_c_ctxt->html != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":409
+          /* "src/lxml/saxparser.pxi":418
  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
  *         if c_ctxt.html:
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)             # <<<<<<<<<<<<<<
@@ -130987,7 +130993,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
           (void)(__pyx_f_4lxml_5etree__fixHtmlDictNodeNames(__pyx_v_c_ctxt->dict, __pyx_v_c_ctxt->node));
 
-          /* "src/lxml/saxparser.pxi":408
+          /* "src/lxml/saxparser.pxi":417
  *     try:
  *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
  *         if c_ctxt.html:             # <<<<<<<<<<<<<<
@@ -130996,7 +131002,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
         }
 
-        /* "src/lxml/saxparser.pxi":410
+        /* "src/lxml/saxparser.pxi":419
  *         if c_ctxt.html:
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -131006,16 +131012,16 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
         __pyx_t_1 = ((__pyx_v_context->_event_filter & (__pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START)) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":412
+          /* "src/lxml/saxparser.pxi":421
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |
  *                                     PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, None)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 412, __pyx_L9_error)
+          __pyx_t_7 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 421, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":410
+          /* "src/lxml/saxparser.pxi":419
  *         if c_ctxt.html:
  *             _fixHtmlDictNodeNames(c_ctxt.dict, c_ctxt.node)
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -131024,7 +131030,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
         }
 
-        /* "src/lxml/saxparser.pxi":406
+        /* "src/lxml/saxparser.pxi":415
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -131039,7 +131045,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
       __pyx_L9_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "src/lxml/saxparser.pxi":413
+      /* "src/lxml/saxparser.pxi":422
  *                                     PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, None)
  *     except:             # <<<<<<<<<<<<<<
@@ -131048,12 +131054,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxStartNoNs", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(8, 413, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(3, 422, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":414
+        /* "src/lxml/saxparser.pxi":423
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, None)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -131068,7 +131074,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":406
+      /* "src/lxml/saxparser.pxi":415
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -131089,7 +131095,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
     }
   }
 
-  /* "src/lxml/saxparser.pxi":416
+  /* "src/lxml/saxparser.pxi":425
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -131134,7 +131140,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
     }
   }
 
-  /* "src/lxml/saxparser.pxi":400
+  /* "src/lxml/saxparser.pxi":409
  * 
  * 
  * cdef void _handleSaxStartNoNs(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -131151,7 +131157,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt, const x
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":419
+/* "src/lxml/saxparser.pxi":428
  * 
  * 
  * cdef void _handleSaxTargetStartNoNs(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -131186,7 +131192,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
   #endif
   __Pyx_RefNannySetupContext("_handleSaxTargetStartNoNs", 0);
 
-  /* "src/lxml/saxparser.pxi":421
+  /* "src/lxml/saxparser.pxi":430
  * cdef void _handleSaxTargetStartNoNs(void* ctxt, const_xmlChar* c_name,
  *                                     const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -131195,7 +131201,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":422
+  /* "src/lxml/saxparser.pxi":431
  *                                     const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -131213,7 +131219,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":423
+    /* "src/lxml/saxparser.pxi":432
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -131222,7 +131228,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":422
+    /* "src/lxml/saxparser.pxi":431
  *                                     const_xmlChar** c_attributes) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -131231,7 +131237,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  */
   }
 
-  /* "src/lxml/saxparser.pxi":424
+  /* "src/lxml/saxparser.pxi":433
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -131243,7 +131249,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":425
+  /* "src/lxml/saxparser.pxi":434
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -131260,7 +131266,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":426
+        /* "src/lxml/saxparser.pxi":435
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if c_attributes is NULL:             # <<<<<<<<<<<<<<
@@ -131270,7 +131276,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
         __pyx_t_1 = ((__pyx_v_c_attributes == NULL) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":427
+          /* "src/lxml/saxparser.pxi":436
  *     try:
  *         if c_attributes is NULL:
  *             attrib = IMMUTABLE_EMPTY_MAPPING             # <<<<<<<<<<<<<<
@@ -131280,7 +131286,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
           __Pyx_INCREF(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
           __pyx_v_attrib = __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING;
 
-          /* "src/lxml/saxparser.pxi":426
+          /* "src/lxml/saxparser.pxi":435
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if c_attributes is NULL:             # <<<<<<<<<<<<<<
@@ -131290,7 +131296,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
           goto __pyx_L15;
         }
 
-        /* "src/lxml/saxparser.pxi":429
+        /* "src/lxml/saxparser.pxi":438
  *             attrib = IMMUTABLE_EMPTY_MAPPING
  *         else:
  *             attrib = {}             # <<<<<<<<<<<<<<
@@ -131298,12 +131304,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  *                 name = funicode(c_attributes[0])
  */
         /*else*/ {
-          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 429, __pyx_L9_error)
+          __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 438, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
           __pyx_v_attrib = __pyx_t_3;
           __pyx_t_3 = 0;
 
-          /* "src/lxml/saxparser.pxi":430
+          /* "src/lxml/saxparser.pxi":439
  *         else:
  *             attrib = {}
  *             while c_attributes[0] is not NULL:             # <<<<<<<<<<<<<<
@@ -131314,31 +131320,31 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
             __pyx_t_1 = (((__pyx_v_c_attributes[0]) != NULL) != 0);
             if (!__pyx_t_1) break;
 
-            /* "src/lxml/saxparser.pxi":431
+            /* "src/lxml/saxparser.pxi":440
  *             attrib = {}
  *             while c_attributes[0] is not NULL:
  *                 name = funicode(c_attributes[0])             # <<<<<<<<<<<<<<
  *                 attrib[name] = funicodeOrEmpty(c_attributes[1])
  *                 c_attributes += 2
  */
-            __pyx_t_3 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 431, __pyx_L9_error)
+            __pyx_t_3 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 440, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_3);
             __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
             __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":432
+            /* "src/lxml/saxparser.pxi":441
  *             while c_attributes[0] is not NULL:
  *                 name = funicode(c_attributes[0])
  *                 attrib[name] = funicodeOrEmpty(c_attributes[1])             # <<<<<<<<<<<<<<
  *                 c_attributes += 2
  *         element = _callTargetSaxStart(
  */
-            __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrEmpty((__pyx_v_c_attributes[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 432, __pyx_L9_error)
+            __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrEmpty((__pyx_v_c_attributes[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 441, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_3);
-            if (unlikely(PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_t_3) < 0)) __PYX_ERR(8, 432, __pyx_L9_error)
+            if (unlikely(PyObject_SetItem(__pyx_v_attrib, __pyx_v_name, __pyx_t_3) < 0)) __PYX_ERR(3, 441, __pyx_L9_error)
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-            /* "src/lxml/saxparser.pxi":433
+            /* "src/lxml/saxparser.pxi":442
  *                 name = funicode(c_attributes[0])
  *                 attrib[name] = funicodeOrEmpty(c_attributes[1])
  *                 c_attributes += 2             # <<<<<<<<<<<<<<
@@ -131350,17 +131356,17 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
         }
         __pyx_L15:;
 
-        /* "src/lxml/saxparser.pxi":435
+        /* "src/lxml/saxparser.pxi":444
  *                 c_attributes += 2
  *         element = _callTargetSaxStart(
  *             context, c_ctxt, funicode(c_name),             # <<<<<<<<<<<<<<
  *             attrib, IMMUTABLE_EMPTY_MAPPING)
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 435, __pyx_L9_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 444, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":436
+        /* "src/lxml/saxparser.pxi":445
  *         element = _callTargetSaxStart(
  *             context, c_ctxt, funicode(c_name),
  *             attrib, IMMUTABLE_EMPTY_MAPPING)             # <<<<<<<<<<<<<<
@@ -131370,21 +131376,21 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
         __pyx_t_7 = __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING;
         __Pyx_INCREF(__pyx_t_7);
 
-        /* "src/lxml/saxparser.pxi":434
+        /* "src/lxml/saxparser.pxi":443
  *                 attrib[name] = funicodeOrEmpty(c_attributes[1])
  *                 c_attributes += 2
  *         element = _callTargetSaxStart(             # <<<<<<<<<<<<<<
  *             context, c_ctxt, funicode(c_name),
  *             attrib, IMMUTABLE_EMPTY_MAPPING)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__callTargetSaxStart(__pyx_v_context, __pyx_v_c_ctxt, __pyx_t_3, __pyx_v_attrib, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 434, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__callTargetSaxStart(__pyx_v_context, __pyx_v_c_ctxt, __pyx_t_3, __pyx_v_attrib, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 443, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __pyx_v_element = __pyx_t_8;
         __pyx_t_8 = 0;
 
-        /* "src/lxml/saxparser.pxi":437
+        /* "src/lxml/saxparser.pxi":446
  *             context, c_ctxt, funicode(c_name),
  *             attrib, IMMUTABLE_EMPTY_MAPPING)
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -131394,16 +131400,16 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
         __pyx_t_1 = ((__pyx_v_context->_event_filter & (__pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END | __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START)) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":439
+          /* "src/lxml/saxparser.pxi":448
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |
  *                                     PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, element)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-          __pyx_t_9 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(8, 439, __pyx_L9_error)
+          __pyx_t_9 = __pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_context, __pyx_v_c_ctxt, NULL, __pyx_v_c_name, __pyx_v_element); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 448, __pyx_L9_error)
 
-          /* "src/lxml/saxparser.pxi":437
+          /* "src/lxml/saxparser.pxi":446
  *             context, c_ctxt, funicode(c_name),
  *             attrib, IMMUTABLE_EMPTY_MAPPING)
  *         if context._event_filter & (PARSE_EVENT_FILTER_END |             # <<<<<<<<<<<<<<
@@ -131412,7 +131418,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  */
         }
 
-        /* "src/lxml/saxparser.pxi":425
+        /* "src/lxml/saxparser.pxi":434
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -131429,7 +131435,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "src/lxml/saxparser.pxi":440
+      /* "src/lxml/saxparser.pxi":449
  *                                     PARSE_EVENT_FILTER_START):
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, element)
  *     except:             # <<<<<<<<<<<<<<
@@ -131438,12 +131444,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxTargetStartNoNs", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(8, 440, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(3, 449, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":441
+        /* "src/lxml/saxparser.pxi":450
  *             _pushSaxStartEvent(context, c_ctxt, NULL, c_name, element)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -131458,7 +131464,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":425
+      /* "src/lxml/saxparser.pxi":434
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -131479,7 +131485,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
     }
   }
 
-  /* "src/lxml/saxparser.pxi":443
+  /* "src/lxml/saxparser.pxi":452
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -131524,7 +131530,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
     }
   }
 
-  /* "src/lxml/saxparser.pxi":419
+  /* "src/lxml/saxparser.pxi":428
  * 
  * 
  * cdef void _handleSaxTargetStartNoNs(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -131544,7 +131550,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetStartNoNs(void *__pyx_v_ctxt, c
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":446
+/* "src/lxml/saxparser.pxi":455
  * 
  * 
  * cdef _callTargetSaxStart(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -131566,19 +131572,19 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_callTargetSaxStart", 0);
 
-  /* "src/lxml/saxparser.pxi":449
+  /* "src/lxml/saxparser.pxi":458
  *                          xmlparser.xmlParserCtxt* c_ctxt,
  *                          tag, attrib, nsmap):
  *     element = context._target._handleSaxStart(tag, attrib, nsmap)             # <<<<<<<<<<<<<<
  *     if element is not None and c_ctxt.input is not NULL:
  *         if isinstance(element, _Element):
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStart(__pyx_v_context->_target, __pyx_v_tag, __pyx_v_attrib, __pyx_v_nsmap); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 449, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxStart(__pyx_v_context->_target, __pyx_v_tag, __pyx_v_attrib, __pyx_v_nsmap); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 458, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_element = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":450
+  /* "src/lxml/saxparser.pxi":459
  *                          tag, attrib, nsmap):
  *     element = context._target._handleSaxStart(tag, attrib, nsmap)
  *     if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<<
@@ -131597,7 +131603,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":451
+    /* "src/lxml/saxparser.pxi":460
  *     element = context._target._handleSaxStart(tag, attrib, nsmap)
  *     if element is not None and c_ctxt.input is not NULL:
  *         if isinstance(element, _Element):             # <<<<<<<<<<<<<<
@@ -131608,7 +131614,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
     __pyx_t_4 = (__pyx_t_2 != 0);
     if (__pyx_t_4) {
 
-      /* "src/lxml/saxparser.pxi":454
+      /* "src/lxml/saxparser.pxi":463
  *             (<_Element>element)._c_node.line = (
  *                 <unsigned short>c_ctxt.input.line
  *                 if c_ctxt.input.line < 65535 else 65535)             # <<<<<<<<<<<<<<
@@ -131617,7 +131623,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
  */
       if (((__pyx_v_c_ctxt->input->line < 0xFFFF) != 0)) {
 
-        /* "src/lxml/saxparser.pxi":453
+        /* "src/lxml/saxparser.pxi":462
  *         if isinstance(element, _Element):
  *             (<_Element>element)._c_node.line = (
  *                 <unsigned short>c_ctxt.input.line             # <<<<<<<<<<<<<<
@@ -131629,7 +131635,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
         __pyx_t_5 = 0xFFFF;
       }
 
-      /* "src/lxml/saxparser.pxi":452
+      /* "src/lxml/saxparser.pxi":461
  *     if element is not None and c_ctxt.input is not NULL:
  *         if isinstance(element, _Element):
  *             (<_Element>element)._c_node.line = (             # <<<<<<<<<<<<<<
@@ -131638,7 +131644,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
  */
       ((struct LxmlElement *)__pyx_v_element)->_c_node->line = __pyx_t_5;
 
-      /* "src/lxml/saxparser.pxi":451
+      /* "src/lxml/saxparser.pxi":460
  *     element = context._target._handleSaxStart(tag, attrib, nsmap)
  *     if element is not None and c_ctxt.input is not NULL:
  *         if isinstance(element, _Element):             # <<<<<<<<<<<<<<
@@ -131647,7 +131653,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
  */
     }
 
-    /* "src/lxml/saxparser.pxi":450
+    /* "src/lxml/saxparser.pxi":459
  *                          tag, attrib, nsmap):
  *     element = context._target._handleSaxStart(tag, attrib, nsmap)
  *     if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<<
@@ -131656,7 +131662,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":455
+  /* "src/lxml/saxparser.pxi":464
  *                 <unsigned short>c_ctxt.input.line
  *                 if c_ctxt.input.line < 65535 else 65535)
  *     return element             # <<<<<<<<<<<<<<
@@ -131668,7 +131674,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
   __pyx_r = __pyx_v_element;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":446
+  /* "src/lxml/saxparser.pxi":455
  * 
  * 
  * cdef _callTargetSaxStart(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -131688,7 +131694,7 @@ static PyObject *__pyx_f_4lxml_5etree__callTargetSaxStart(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":458
+/* "src/lxml/saxparser.pxi":467
  * 
  * 
  * cdef int _pushSaxStartEvent(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -131711,7 +131717,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
   __Pyx_RefNannySetupContext("_pushSaxStartEvent", 0);
   __Pyx_INCREF(__pyx_v_node);
 
-  /* "src/lxml/saxparser.pxi":462
+  /* "src/lxml/saxparser.pxi":471
  *                             const_xmlChar* c_href,
  *                             const_xmlChar* c_name, node) except -1:
  *     if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -131726,7 +131732,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
     goto __pyx_L4_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":463
+  /* "src/lxml/saxparser.pxi":472
  *                             const_xmlChar* c_name, node) except -1:
  *     if (context._matcher is None or
  *             context._matcher.matchesNsTag(c_href, c_name)):             # <<<<<<<<<<<<<<
@@ -131737,7 +131743,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
   __pyx_t_1 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
 
-  /* "src/lxml/saxparser.pxi":462
+  /* "src/lxml/saxparser.pxi":471
  *                             const_xmlChar* c_href,
  *                             const_xmlChar* c_name, node) except -1:
  *     if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -131746,7 +131752,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":464
+    /* "src/lxml/saxparser.pxi":473
  *     if (context._matcher is None or
  *             context._matcher.matchesNsTag(c_href, c_name)):
  *         if node is None and context._target is None:             # <<<<<<<<<<<<<<
@@ -131766,7 +131772,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
     __pyx_L7_bool_binop_done:;
     if (__pyx_t_1) {
 
-      /* "src/lxml/saxparser.pxi":465
+      /* "src/lxml/saxparser.pxi":474
  *             context._matcher.matchesNsTag(c_href, c_name)):
  *         if node is None and context._target is None:
  *             assert context._doc is not None             # <<<<<<<<<<<<<<
@@ -131778,12 +131784,12 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
         __pyx_t_1 = (((PyObject *)__pyx_v_context->__pyx_base._doc) != Py_None);
         if (unlikely(!(__pyx_t_1 != 0))) {
           PyErr_SetNone(PyExc_AssertionError);
-          __PYX_ERR(8, 465, __pyx_L1_error)
+          __PYX_ERR(3, 474, __pyx_L1_error)
         }
       }
       #endif
 
-      /* "src/lxml/saxparser.pxi":466
+      /* "src/lxml/saxparser.pxi":475
  *         if node is None and context._target is None:
  *             assert context._doc is not None
  *             node = _elementFactory(context._doc, c_ctxt.node)             # <<<<<<<<<<<<<<
@@ -131792,13 +131798,13 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
       __pyx_t_4 = ((PyObject *)__pyx_v_context->__pyx_base._doc);
       __Pyx_INCREF(__pyx_t_4);
-      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_ctxt->node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 466, __pyx_L1_error)
+      __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_4), __pyx_v_c_ctxt->node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 475, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF_SET(__pyx_v_node, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "src/lxml/saxparser.pxi":464
+      /* "src/lxml/saxparser.pxi":473
  *     if (context._matcher is None or
  *             context._matcher.matchesNsTag(c_href, c_name)):
  *         if node is None and context._target is None:             # <<<<<<<<<<<<<<
@@ -131807,7 +131813,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
     }
 
-    /* "src/lxml/saxparser.pxi":467
+    /* "src/lxml/saxparser.pxi":476
  *             assert context._doc is not None
  *             node = _elementFactory(context._doc, c_ctxt.node)
  *         if context._event_filter & PARSE_EVENT_FILTER_START:             # <<<<<<<<<<<<<<
@@ -131817,7 +131823,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
     __pyx_t_1 = ((__pyx_v_context->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_START) != 0);
     if (__pyx_t_1) {
 
-      /* "src/lxml/saxparser.pxi":468
+      /* "src/lxml/saxparser.pxi":477
  *             node = _elementFactory(context._doc, c_ctxt.node)
  *         if context._event_filter & PARSE_EVENT_FILTER_START:
  *             context.events_iterator._events.append(('start', node))             # <<<<<<<<<<<<<<
@@ -131826,9 +131832,9 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-        __PYX_ERR(8, 468, __pyx_L1_error)
+        __PYX_ERR(3, 477, __pyx_L1_error)
       }
-      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 468, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 477, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_n_s_start);
       __Pyx_GIVEREF(__pyx_n_s_start);
@@ -131836,10 +131842,10 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
       __Pyx_INCREF(__pyx_v_node);
       __Pyx_GIVEREF(__pyx_v_node);
       PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_node);
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 468, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_5); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 477, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "src/lxml/saxparser.pxi":467
+      /* "src/lxml/saxparser.pxi":476
  *             assert context._doc is not None
  *             node = _elementFactory(context._doc, c_ctxt.node)
  *         if context._event_filter & PARSE_EVENT_FILTER_START:             # <<<<<<<<<<<<<<
@@ -131848,7 +131854,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
     }
 
-    /* "src/lxml/saxparser.pxi":469
+    /* "src/lxml/saxparser.pxi":478
  *         if context._event_filter & PARSE_EVENT_FILTER_START:
  *             context.events_iterator._events.append(('start', node))
  *         if (context._target is None and             # <<<<<<<<<<<<<<
@@ -131863,7 +131869,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
       goto __pyx_L11_bool_binop_done;
     }
 
-    /* "src/lxml/saxparser.pxi":470
+    /* "src/lxml/saxparser.pxi":479
  *             context.events_iterator._events.append(('start', node))
  *         if (context._target is None and
  *                 context._event_filter & PARSE_EVENT_FILTER_END):             # <<<<<<<<<<<<<<
@@ -131874,7 +131880,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
     __pyx_t_1 = __pyx_t_2;
     __pyx_L11_bool_binop_done:;
 
-    /* "src/lxml/saxparser.pxi":469
+    /* "src/lxml/saxparser.pxi":478
  *         if context._event_filter & PARSE_EVENT_FILTER_START:
  *             context.events_iterator._events.append(('start', node))
  *         if (context._target is None and             # <<<<<<<<<<<<<<
@@ -131883,7 +131889,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
     if (__pyx_t_1) {
 
-      /* "src/lxml/saxparser.pxi":471
+      /* "src/lxml/saxparser.pxi":480
  *         if (context._target is None and
  *                 context._event_filter & PARSE_EVENT_FILTER_END):
  *             context._node_stack.append(node)             # <<<<<<<<<<<<<<
@@ -131892,11 +131898,11 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
       if (unlikely(__pyx_v_context->_node_stack == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-        __PYX_ERR(8, 471, __pyx_L1_error)
+        __PYX_ERR(3, 480, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->_node_stack, __pyx_v_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(8, 471, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_context->_node_stack, __pyx_v_node); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 480, __pyx_L1_error)
 
-      /* "src/lxml/saxparser.pxi":469
+      /* "src/lxml/saxparser.pxi":478
  *         if context._event_filter & PARSE_EVENT_FILTER_START:
  *             context.events_iterator._events.append(('start', node))
  *         if (context._target is None and             # <<<<<<<<<<<<<<
@@ -131905,7 +131911,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
     }
 
-    /* "src/lxml/saxparser.pxi":462
+    /* "src/lxml/saxparser.pxi":471
  *                             const_xmlChar* c_href,
  *                             const_xmlChar* c_name, node) except -1:
  *     if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -131914,7 +131920,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
  */
   }
 
-  /* "src/lxml/saxparser.pxi":472
+  /* "src/lxml/saxparser.pxi":481
  *                 context._event_filter & PARSE_EVENT_FILTER_END):
  *             context._node_stack.append(node)
  *     return 0             # <<<<<<<<<<<<<<
@@ -131924,7 +131930,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":458
+  /* "src/lxml/saxparser.pxi":467
  * 
  * 
  * cdef int _pushSaxStartEvent(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -131944,7 +131950,7 @@ static int __pyx_f_4lxml_5etree__pushSaxStartEvent(struct __pyx_obj_4lxml_5etree
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":475
+/* "src/lxml/saxparser.pxi":484
  * 
  * 
  * cdef void _handleSaxEnd(void* ctxt, const_xmlChar* c_localname,             # <<<<<<<<<<<<<<
@@ -131977,7 +131983,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
   #endif
   __Pyx_RefNannySetupContext("_handleSaxEnd", 0);
 
-  /* "src/lxml/saxparser.pxi":478
+  /* "src/lxml/saxparser.pxi":487
  *                         const_xmlChar* c_prefix,
  *                         const_xmlChar* c_namespace) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -131986,7 +131992,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":479
+  /* "src/lxml/saxparser.pxi":488
  *                         const_xmlChar* c_namespace) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -132004,7 +132010,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":480
+    /* "src/lxml/saxparser.pxi":489
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -132013,7 +132019,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":479
+    /* "src/lxml/saxparser.pxi":488
  *                         const_xmlChar* c_namespace) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -132022,7 +132028,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  */
   }
 
-  /* "src/lxml/saxparser.pxi":481
+  /* "src/lxml/saxparser.pxi":490
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -132034,7 +132040,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":482
+  /* "src/lxml/saxparser.pxi":491
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132051,7 +132057,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":483
+        /* "src/lxml/saxparser.pxi":492
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if context._target is not None:             # <<<<<<<<<<<<<<
@@ -132062,7 +132068,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
         __pyx_t_2 = (__pyx_t_1 != 0);
         if (__pyx_t_2) {
 
-          /* "src/lxml/saxparser.pxi":484
+          /* "src/lxml/saxparser.pxi":493
  *     try:
  *         if context._target is not None:
  *             if context._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<<
@@ -132072,30 +132078,30 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
           __pyx_t_2 = ((__pyx_v_context->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_END) != 0);
           if (__pyx_t_2) {
 
-            /* "src/lxml/saxparser.pxi":486
+            /* "src/lxml/saxparser.pxi":495
  *             if context._target._sax_event_filter & SAX_EVENT_END:
  *                 node = context._target._handleSaxEnd(
  *                     _namespacedNameFromNsName(c_namespace, c_localname))             # <<<<<<<<<<<<<<
  *             else:
  *                 node = None
  */
-            __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 486, __pyx_L9_error)
+            __pyx_t_3 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace, __pyx_v_c_localname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 495, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_3);
 
-            /* "src/lxml/saxparser.pxi":485
+            /* "src/lxml/saxparser.pxi":494
  *         if context._target is not None:
  *             if context._target._sax_event_filter & SAX_EVENT_END:
  *                 node = context._target._handleSaxEnd(             # <<<<<<<<<<<<<<
  *                     _namespacedNameFromNsName(c_namespace, c_localname))
  *             else:
  */
-            __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 485, __pyx_L9_error)
+            __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 494, __pyx_L9_error)
             __Pyx_GOTREF(__pyx_t_7);
             __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
             __pyx_v_node = __pyx_t_7;
             __pyx_t_7 = 0;
 
-            /* "src/lxml/saxparser.pxi":484
+            /* "src/lxml/saxparser.pxi":493
  *     try:
  *         if context._target is not None:
  *             if context._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<<
@@ -132105,7 +132111,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
             goto __pyx_L16;
           }
 
-          /* "src/lxml/saxparser.pxi":488
+          /* "src/lxml/saxparser.pxi":497
  *                     _namespacedNameFromNsName(c_namespace, c_localname))
  *             else:
  *                 node = None             # <<<<<<<<<<<<<<
@@ -132118,7 +132124,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
           }
           __pyx_L16:;
 
-          /* "src/lxml/saxparser.pxi":483
+          /* "src/lxml/saxparser.pxi":492
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if context._target is not None:             # <<<<<<<<<<<<<<
@@ -132128,7 +132134,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
           goto __pyx_L15;
         }
 
-        /* "src/lxml/saxparser.pxi":490
+        /* "src/lxml/saxparser.pxi":499
  *                 node = None
  *         else:
  *             context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)             # <<<<<<<<<<<<<<
@@ -132138,7 +132144,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
         /*else*/ {
           __pyx_v_context->_origSaxEnd(__pyx_v_c_ctxt, __pyx_v_c_localname, __pyx_v_c_prefix, __pyx_v_c_namespace);
 
-          /* "src/lxml/saxparser.pxi":491
+          /* "src/lxml/saxparser.pxi":500
  *         else:
  *             context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
  *             node = None             # <<<<<<<<<<<<<<
@@ -132150,25 +132156,25 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
         }
         __pyx_L15:;
 
-        /* "src/lxml/saxparser.pxi":492
+        /* "src/lxml/saxparser.pxi":501
  *             context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
  *             node = None
  *         _pushSaxEndEvent(context, c_namespace, c_localname, node)             # <<<<<<<<<<<<<<
  *         _pushSaxNsEndEvents(context)
  *     except:
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 492, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, __pyx_v_c_namespace, __pyx_v_c_localname, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 501, __pyx_L9_error)
 
-        /* "src/lxml/saxparser.pxi":493
+        /* "src/lxml/saxparser.pxi":502
  *             node = None
  *         _pushSaxEndEvent(context, c_namespace, c_localname, node)
  *         _pushSaxNsEndEvents(context)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 493, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxNsEndEvents(__pyx_v_context); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 502, __pyx_L9_error)
 
-        /* "src/lxml/saxparser.pxi":482
+        /* "src/lxml/saxparser.pxi":491
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132184,7 +132190,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "src/lxml/saxparser.pxi":494
+      /* "src/lxml/saxparser.pxi":503
  *         _pushSaxEndEvent(context, c_namespace, c_localname, node)
  *         _pushSaxNsEndEvents(context)
  *     except:             # <<<<<<<<<<<<<<
@@ -132193,12 +132199,12 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxEnd", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(8, 494, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(3, 503, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":495
+        /* "src/lxml/saxparser.pxi":504
  *         _pushSaxNsEndEvents(context)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -132213,7 +132219,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":482
+      /* "src/lxml/saxparser.pxi":491
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132234,7 +132240,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
     }
   }
 
-  /* "src/lxml/saxparser.pxi":497
+  /* "src/lxml/saxparser.pxi":506
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -132279,7 +132285,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
     }
   }
 
-  /* "src/lxml/saxparser.pxi":475
+  /* "src/lxml/saxparser.pxi":484
  * 
  * 
  * cdef void _handleSaxEnd(void* ctxt, const_xmlChar* c_localname,             # <<<<<<<<<<<<<<
@@ -132297,7 +132303,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEnd(void *__pyx_v_ctxt, const xmlChar
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":500
+/* "src/lxml/saxparser.pxi":509
  * 
  * 
  * cdef void _handleSaxEndNoNs(void* ctxt, const_xmlChar* c_name) with gil:             # <<<<<<<<<<<<<<
@@ -132330,7 +132336,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
   #endif
   __Pyx_RefNannySetupContext("_handleSaxEndNoNs", 0);
 
-  /* "src/lxml/saxparser.pxi":501
+  /* "src/lxml/saxparser.pxi":510
  * 
  * cdef void _handleSaxEndNoNs(void* ctxt, const_xmlChar* c_name) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -132339,7 +132345,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":502
+  /* "src/lxml/saxparser.pxi":511
  * cdef void _handleSaxEndNoNs(void* ctxt, const_xmlChar* c_name) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -132357,7 +132363,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":503
+    /* "src/lxml/saxparser.pxi":512
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -132366,7 +132372,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":502
+    /* "src/lxml/saxparser.pxi":511
  * cdef void _handleSaxEndNoNs(void* ctxt, const_xmlChar* c_name) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -132375,7 +132381,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":504
+  /* "src/lxml/saxparser.pxi":513
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -132387,7 +132393,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":505
+  /* "src/lxml/saxparser.pxi":514
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132404,7 +132410,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":506
+        /* "src/lxml/saxparser.pxi":515
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if context._target is not None:             # <<<<<<<<<<<<<<
@@ -132415,22 +132421,22 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
         __pyx_t_2 = (__pyx_t_1 != 0);
         if (__pyx_t_2) {
 
-          /* "src/lxml/saxparser.pxi":507
+          /* "src/lxml/saxparser.pxi":516
  *     try:
  *         if context._target is not None:
  *             node = context._target._handleSaxEnd(funicode(c_name))             # <<<<<<<<<<<<<<
  *         else:
  *             context._origSaxEndNoNs(c_ctxt, c_name)
  */
-          __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 507, __pyx_L9_error)
+          __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 516, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_3);
-          __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 507, __pyx_L9_error)
+          __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 516, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_7);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
           __pyx_v_node = __pyx_t_7;
           __pyx_t_7 = 0;
 
-          /* "src/lxml/saxparser.pxi":506
+          /* "src/lxml/saxparser.pxi":515
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         if context._target is not None:             # <<<<<<<<<<<<<<
@@ -132440,7 +132446,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
           goto __pyx_L15;
         }
 
-        /* "src/lxml/saxparser.pxi":509
+        /* "src/lxml/saxparser.pxi":518
  *             node = context._target._handleSaxEnd(funicode(c_name))
  *         else:
  *             context._origSaxEndNoNs(c_ctxt, c_name)             # <<<<<<<<<<<<<<
@@ -132450,7 +132456,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
         /*else*/ {
           __pyx_v_context->_origSaxEndNoNs(__pyx_v_c_ctxt, __pyx_v_c_name);
 
-          /* "src/lxml/saxparser.pxi":510
+          /* "src/lxml/saxparser.pxi":519
  *         else:
  *             context._origSaxEndNoNs(c_ctxt, c_name)
  *             node = None             # <<<<<<<<<<<<<<
@@ -132462,16 +132468,16 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
         }
         __pyx_L15:;
 
-        /* "src/lxml/saxparser.pxi":511
+        /* "src/lxml/saxparser.pxi":520
  *             context._origSaxEndNoNs(c_ctxt, c_name)
  *             node = None
  *         _pushSaxEndEvent(context, NULL, c_name, node)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, NULL, __pyx_v_c_name, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 511, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_context, NULL, __pyx_v_c_name, __pyx_v_node); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 520, __pyx_L9_error)
 
-        /* "src/lxml/saxparser.pxi":505
+        /* "src/lxml/saxparser.pxi":514
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132487,7 +132493,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "src/lxml/saxparser.pxi":512
+      /* "src/lxml/saxparser.pxi":521
  *             node = None
  *         _pushSaxEndEvent(context, NULL, c_name, node)
  *     except:             # <<<<<<<<<<<<<<
@@ -132496,12 +132502,12 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxEndNoNs", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(8, 512, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(3, 521, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":513
+        /* "src/lxml/saxparser.pxi":522
  *         _pushSaxEndEvent(context, NULL, c_name, node)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -132516,7 +132522,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":505
+      /* "src/lxml/saxparser.pxi":514
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -132537,7 +132543,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":515
+  /* "src/lxml/saxparser.pxi":524
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -132582,7 +132588,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":500
+  /* "src/lxml/saxparser.pxi":509
  * 
  * 
  * cdef void _handleSaxEndNoNs(void* ctxt, const_xmlChar* c_name) with gil:             # <<<<<<<<<<<<<<
@@ -132600,7 +132606,7 @@ static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt, const xml
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":518
+/* "src/lxml/saxparser.pxi":527
  * 
  * 
  * cdef int _pushSaxNsEndEvents(_SaxParserContext context) except -1:             # <<<<<<<<<<<<<<
@@ -132628,7 +132634,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_pushSaxNsEndEvents", 0);
 
-  /* "src/lxml/saxparser.pxi":519
+  /* "src/lxml/saxparser.pxi":528
  * 
  * cdef int _pushSaxNsEndEvents(_SaxParserContext context) except -1:
  *     cdef bint build_events = context._event_filter & PARSE_EVENT_FILTER_END_NS             # <<<<<<<<<<<<<<
@@ -132637,7 +132643,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
   __pyx_v_build_events = (__pyx_v_context->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END_NS);
 
-  /* "src/lxml/saxparser.pxi":521
+  /* "src/lxml/saxparser.pxi":530
  *     cdef bint build_events = context._event_filter & PARSE_EVENT_FILTER_END_NS
  *     cdef bint call_target = (
  *         context._target is not None             # <<<<<<<<<<<<<<
@@ -132652,7 +132658,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
     goto __pyx_L3_bool_binop_done;
   }
 
-  /* "src/lxml/saxparser.pxi":522
+  /* "src/lxml/saxparser.pxi":531
  *     cdef bint call_target = (
  *         context._target is not None
  *         and context._target._sax_event_filter & SAX_EVENT_END_NS)             # <<<<<<<<<<<<<<
@@ -132664,7 +132670,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   __pyx_L3_bool_binop_done:;
   __pyx_v_call_target = __pyx_t_1;
 
-  /* "src/lxml/saxparser.pxi":523
+  /* "src/lxml/saxparser.pxi":532
  *         context._target is not None
  *         and context._target._sax_event_filter & SAX_EVENT_END_NS)
  *     if not build_events and not call_target:             # <<<<<<<<<<<<<<
@@ -132682,7 +132688,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   __pyx_L6_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":524
+    /* "src/lxml/saxparser.pxi":533
  *         and context._target._sax_event_filter & SAX_EVENT_END_NS)
  *     if not build_events and not call_target:
  *         return 0             # <<<<<<<<<<<<<<
@@ -132692,7 +132698,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":523
+    /* "src/lxml/saxparser.pxi":532
  *         context._target is not None
  *         and context._target._sax_event_filter & SAX_EVENT_END_NS)
  *     if not build_events and not call_target:             # <<<<<<<<<<<<<<
@@ -132701,7 +132707,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
   }
 
-  /* "src/lxml/saxparser.pxi":526
+  /* "src/lxml/saxparser.pxi":535
  *         return 0
  * 
  *     cdef list declared_namespaces = context._ns_stack.pop()             # <<<<<<<<<<<<<<
@@ -132710,15 +132716,15 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
   if (unlikely(__pyx_v_context->_ns_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-    __PYX_ERR(8, 526, __pyx_L1_error)
+    __PYX_ERR(3, 535, __pyx_L1_error)
   }
-  __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_context->_ns_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 526, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_context->_ns_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 535, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(8, 526, __pyx_L1_error)
+  if (!(likely(PyList_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(3, 535, __pyx_L1_error)
   __pyx_v_declared_namespaces = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/saxparser.pxi":527
+  /* "src/lxml/saxparser.pxi":536
  * 
  *     cdef list declared_namespaces = context._ns_stack.pop()
  *     if declared_namespaces is None:             # <<<<<<<<<<<<<<
@@ -132729,7 +132735,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   __pyx_t_3 = (__pyx_t_1 != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/saxparser.pxi":528
+    /* "src/lxml/saxparser.pxi":537
  *     cdef list declared_namespaces = context._ns_stack.pop()
  *     if declared_namespaces is None:
  *         return 0             # <<<<<<<<<<<<<<
@@ -132739,7 +132745,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
     __pyx_r = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":527
+    /* "src/lxml/saxparser.pxi":536
  * 
  *     cdef list declared_namespaces = context._ns_stack.pop()
  *     if declared_namespaces is None:             # <<<<<<<<<<<<<<
@@ -132748,7 +132754,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
   }
 
-  /* "src/lxml/saxparser.pxi":531
+  /* "src/lxml/saxparser.pxi":540
  * 
  *     cdef tuple prefix_uri
  *     for prefix_uri in reversed(declared_namespaces):             # <<<<<<<<<<<<<<
@@ -132757,23 +132763,23 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
   if (unlikely(__pyx_v_declared_namespaces == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(8, 531, __pyx_L1_error)
+    __PYX_ERR(3, 540, __pyx_L1_error)
   }
   __pyx_t_4 = __pyx_v_declared_namespaces; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = PyList_GET_SIZE(__pyx_t_4) - 1;
   for (;;) {
     if (__pyx_t_5 < 0) break;
     if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5--; if (unlikely(0 < 0)) __PYX_ERR(8, 531, __pyx_L1_error)
+    __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5--; if (unlikely(0 < 0)) __PYX_ERR(3, 540, __pyx_L1_error)
     #else
-    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5--; if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 531, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5--; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 540, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     #endif
-    if (!(likely(PyTuple_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(8, 531, __pyx_L1_error)
+    if (!(likely(PyTuple_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 540, __pyx_L1_error)
     __Pyx_XDECREF_SET(__pyx_v_prefix_uri, ((PyObject*)__pyx_t_6));
     __pyx_t_6 = 0;
 
-    /* "src/lxml/saxparser.pxi":532
+    /* "src/lxml/saxparser.pxi":541
  *     cdef tuple prefix_uri
  *     for prefix_uri in reversed(declared_namespaces):
  *         if call_target:             # <<<<<<<<<<<<<<
@@ -132783,7 +132789,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
     __pyx_t_3 = (__pyx_v_call_target != 0);
     if (__pyx_t_3) {
 
-      /* "src/lxml/saxparser.pxi":533
+      /* "src/lxml/saxparser.pxi":542
  *     for prefix_uri in reversed(declared_namespaces):
  *         if call_target:
  *             context._target._handleSaxEndNs(prefix_uri[0])             # <<<<<<<<<<<<<<
@@ -132792,16 +132798,16 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
       if (unlikely(__pyx_v_prefix_uri == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(8, 533, __pyx_L1_error)
+        __PYX_ERR(3, 542, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_prefix_uri, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 533, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v_prefix_uri, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 542, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEndNs(__pyx_v_context->_target, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 533, __pyx_L1_error)
+      __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEndNs(__pyx_v_context->_target, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 542, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "src/lxml/saxparser.pxi":532
+      /* "src/lxml/saxparser.pxi":541
  *     cdef tuple prefix_uri
  *     for prefix_uri in reversed(declared_namespaces):
  *         if call_target:             # <<<<<<<<<<<<<<
@@ -132810,7 +132816,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
     }
 
-    /* "src/lxml/saxparser.pxi":534
+    /* "src/lxml/saxparser.pxi":543
  *         if call_target:
  *             context._target._handleSaxEndNs(prefix_uri[0])
  *         if build_events:             # <<<<<<<<<<<<<<
@@ -132820,7 +132826,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
     __pyx_t_3 = (__pyx_v_build_events != 0);
     if (__pyx_t_3) {
 
-      /* "src/lxml/saxparser.pxi":535
+      /* "src/lxml/saxparser.pxi":544
  *             context._target._handleSaxEndNs(prefix_uri[0])
  *         if build_events:
  *             context.events_iterator._events.append(('end-ns', None))             # <<<<<<<<<<<<<<
@@ -132829,11 +132835,11 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-        __PYX_ERR(8, 535, __pyx_L1_error)
+        __PYX_ERR(3, 544, __pyx_L1_error)
       }
-      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_tuple__59); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 535, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_tuple__59); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 544, __pyx_L1_error)
 
-      /* "src/lxml/saxparser.pxi":534
+      /* "src/lxml/saxparser.pxi":543
  *         if call_target:
  *             context._target._handleSaxEndNs(prefix_uri[0])
  *         if build_events:             # <<<<<<<<<<<<<<
@@ -132842,7 +132848,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
  */
     }
 
-    /* "src/lxml/saxparser.pxi":531
+    /* "src/lxml/saxparser.pxi":540
  * 
  *     cdef tuple prefix_uri
  *     for prefix_uri in reversed(declared_namespaces):             # <<<<<<<<<<<<<<
@@ -132852,7 +132858,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "src/lxml/saxparser.pxi":537
+  /* "src/lxml/saxparser.pxi":546
  *             context.events_iterator._events.append(('end-ns', None))
  * 
  *     return 0             # <<<<<<<<<<<<<<
@@ -132862,7 +132868,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":518
+  /* "src/lxml/saxparser.pxi":527
  * 
  * 
  * cdef int _pushSaxNsEndEvents(_SaxParserContext context) except -1:             # <<<<<<<<<<<<<<
@@ -132884,7 +132890,7 @@ static int __pyx_f_4lxml_5etree__pushSaxNsEndEvents(struct __pyx_obj_4lxml_5etre
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":540
+/* "src/lxml/saxparser.pxi":549
  * 
  * 
  * cdef int _pushSaxEndEvent(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -132906,7 +132912,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
   __Pyx_RefNannySetupContext("_pushSaxEndEvent", 0);
   __Pyx_INCREF(__pyx_v_node);
 
-  /* "src/lxml/saxparser.pxi":543
+  /* "src/lxml/saxparser.pxi":552
  *                           const_xmlChar* c_href,
  *                           const_xmlChar* c_name, node) except -1:
  *     if context._event_filter & PARSE_EVENT_FILTER_END:             # <<<<<<<<<<<<<<
@@ -132916,7 +132922,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
   __pyx_t_1 = ((__pyx_v_context->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_END) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":544
+    /* "src/lxml/saxparser.pxi":553
  *                           const_xmlChar* c_name, node) except -1:
  *     if context._event_filter & PARSE_EVENT_FILTER_END:
  *         if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -132931,7 +132937,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
       goto __pyx_L5_bool_binop_done;
     }
 
-    /* "src/lxml/saxparser.pxi":545
+    /* "src/lxml/saxparser.pxi":554
  *     if context._event_filter & PARSE_EVENT_FILTER_END:
  *         if (context._matcher is None or
  *                 context._matcher.matchesNsTag(c_href, c_name)):             # <<<<<<<<<<<<<<
@@ -132942,7 +132948,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
     __pyx_t_1 = __pyx_t_3;
     __pyx_L5_bool_binop_done:;
 
-    /* "src/lxml/saxparser.pxi":544
+    /* "src/lxml/saxparser.pxi":553
  *                           const_xmlChar* c_name, node) except -1:
  *     if context._event_filter & PARSE_EVENT_FILTER_END:
  *         if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -132951,7 +132957,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
     if (__pyx_t_1) {
 
-      /* "src/lxml/saxparser.pxi":546
+      /* "src/lxml/saxparser.pxi":555
  *         if (context._matcher is None or
  *                 context._matcher.matchesNsTag(c_href, c_name)):
  *             if context._target is None:             # <<<<<<<<<<<<<<
@@ -132962,7 +132968,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
       __pyx_t_3 = (__pyx_t_1 != 0);
       if (__pyx_t_3) {
 
-        /* "src/lxml/saxparser.pxi":547
+        /* "src/lxml/saxparser.pxi":556
  *                 context._matcher.matchesNsTag(c_href, c_name)):
  *             if context._target is None:
  *                 node = context._node_stack.pop()             # <<<<<<<<<<<<<<
@@ -132971,14 +132977,14 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
         if (unlikely(__pyx_v_context->_node_stack == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-          __PYX_ERR(8, 547, __pyx_L1_error)
+          __PYX_ERR(3, 556, __pyx_L1_error)
         }
-        __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_context->_node_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 547, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_context->_node_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 556, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_node, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "src/lxml/saxparser.pxi":546
+        /* "src/lxml/saxparser.pxi":555
  *         if (context._matcher is None or
  *                 context._matcher.matchesNsTag(c_href, c_name)):
  *             if context._target is None:             # <<<<<<<<<<<<<<
@@ -132987,7 +132993,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
       }
 
-      /* "src/lxml/saxparser.pxi":548
+      /* "src/lxml/saxparser.pxi":557
  *             if context._target is None:
  *                 node = context._node_stack.pop()
  *             context.events_iterator._events.append(('end', node))             # <<<<<<<<<<<<<<
@@ -132996,9 +133002,9 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
       if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-        __PYX_ERR(8, 548, __pyx_L1_error)
+        __PYX_ERR(3, 557, __pyx_L1_error)
       }
-      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 548, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 557, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_n_s_end);
       __Pyx_GIVEREF(__pyx_n_s_end);
@@ -133006,10 +133012,10 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
       __Pyx_INCREF(__pyx_v_node);
       __Pyx_GIVEREF(__pyx_v_node);
       PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_node);
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 548, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 557, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "src/lxml/saxparser.pxi":544
+      /* "src/lxml/saxparser.pxi":553
  *                           const_xmlChar* c_name, node) except -1:
  *     if context._event_filter & PARSE_EVENT_FILTER_END:
  *         if (context._matcher is None or             # <<<<<<<<<<<<<<
@@ -133018,7 +133024,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
     }
 
-    /* "src/lxml/saxparser.pxi":543
+    /* "src/lxml/saxparser.pxi":552
  *                           const_xmlChar* c_href,
  *                           const_xmlChar* c_name, node) except -1:
  *     if context._event_filter & PARSE_EVENT_FILTER_END:             # <<<<<<<<<<<<<<
@@ -133027,7 +133033,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
  */
   }
 
-  /* "src/lxml/saxparser.pxi":549
+  /* "src/lxml/saxparser.pxi":558
  *                 node = context._node_stack.pop()
  *             context.events_iterator._events.append(('end', node))
  *     return 0             # <<<<<<<<<<<<<<
@@ -133037,7 +133043,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":540
+  /* "src/lxml/saxparser.pxi":549
  * 
  * 
  * cdef int _pushSaxEndEvent(_SaxParserContext context,             # <<<<<<<<<<<<<<
@@ -133056,7 +133062,7 @@ static int __pyx_f_4lxml_5etree__pushSaxEndEvent(struct __pyx_obj_4lxml_5etree__
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":552
+/* "src/lxml/saxparser.pxi":561
  * 
  * 
  * cdef void _handleSaxData(void* ctxt, const_xmlChar* c_data, int data_len) with gil:             # <<<<<<<<<<<<<<
@@ -133088,7 +133094,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
   #endif
   __Pyx_RefNannySetupContext("_handleSaxData", 0);
 
-  /* "src/lxml/saxparser.pxi":554
+  /* "src/lxml/saxparser.pxi":563
  * cdef void _handleSaxData(void* ctxt, const_xmlChar* c_data, int data_len) with gil:
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -133097,7 +133103,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":555
+  /* "src/lxml/saxparser.pxi":564
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133115,7 +133121,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":556
+    /* "src/lxml/saxparser.pxi":565
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -133124,7 +133130,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":555
+    /* "src/lxml/saxparser.pxi":564
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133133,7 +133139,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  */
   }
 
-  /* "src/lxml/saxparser.pxi":557
+  /* "src/lxml/saxparser.pxi":566
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -133145,7 +133151,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":558
+  /* "src/lxml/saxparser.pxi":567
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133162,27 +133168,27 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":560
+        /* "src/lxml/saxparser.pxi":569
  *     try:
  *         context._target._handleSaxData(
  *             c_data[:data_len].decode('utf8'))             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_3 = __Pyx_decode_c_string(((char const *)__pyx_v_c_data), 0, __pyx_v_data_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 560, __pyx_L9_error)
+        __pyx_t_3 = __Pyx_decode_c_string(((char const *)__pyx_v_c_data), 0, __pyx_v_data_len, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 569, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":559
+        /* "src/lxml/saxparser.pxi":568
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         context._target._handleSaxData(             # <<<<<<<<<<<<<<
  *             c_data[:data_len].decode('utf8'))
  *     except:
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 559, __pyx_L9_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 568, __pyx_L9_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-        /* "src/lxml/saxparser.pxi":558
+        /* "src/lxml/saxparser.pxi":567
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133197,7 +133203,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
       __pyx_L9_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "src/lxml/saxparser.pxi":561
+      /* "src/lxml/saxparser.pxi":570
  *         context._target._handleSaxData(
  *             c_data[:data_len].decode('utf8'))
  *     except:             # <<<<<<<<<<<<<<
@@ -133206,12 +133212,12 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxData", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(8, 561, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(3, 570, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":562
+        /* "src/lxml/saxparser.pxi":571
  *             c_data[:data_len].decode('utf8'))
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -133226,7 +133232,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":558
+      /* "src/lxml/saxparser.pxi":567
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133247,7 +133253,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
     }
   }
 
-  /* "src/lxml/saxparser.pxi":564
+  /* "src/lxml/saxparser.pxi":573
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -133292,7 +133298,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
     }
   }
 
-  /* "src/lxml/saxparser.pxi":552
+  /* "src/lxml/saxparser.pxi":561
  * 
  * 
  * cdef void _handleSaxData(void* ctxt, const_xmlChar* c_data, int data_len) with gil:             # <<<<<<<<<<<<<<
@@ -133309,7 +133315,7 @@ static void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt, const xmlCha
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":567
+/* "src/lxml/saxparser.pxi":576
  * 
  * 
  * cdef void _handleSaxTargetDoctype(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -133341,7 +133347,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
   #endif
   __Pyx_RefNannySetupContext("_handleSaxTargetDoctype", 0);
 
-  /* "src/lxml/saxparser.pxi":571
+  /* "src/lxml/saxparser.pxi":580
  *                                   const_xmlChar* c_system) with gil:
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -133350,7 +133356,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":572
+  /* "src/lxml/saxparser.pxi":581
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133368,7 +133374,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":573
+    /* "src/lxml/saxparser.pxi":582
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -133377,7 +133383,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":572
+    /* "src/lxml/saxparser.pxi":581
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133386,7 +133392,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  */
   }
 
-  /* "src/lxml/saxparser.pxi":574
+  /* "src/lxml/saxparser.pxi":583
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -133398,7 +133404,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":575
+  /* "src/lxml/saxparser.pxi":584
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133415,49 +133421,49 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":577
+        /* "src/lxml/saxparser.pxi":586
  *     try:
  *         context._target._handleSaxDoctype(
  *             funicodeOrNone(c_name),             # <<<<<<<<<<<<<<
  *             funicodeOrNone(c_public),
  *             funicodeOrNone(c_system))
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 577, __pyx_L9_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 586, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":578
+        /* "src/lxml/saxparser.pxi":587
  *         context._target._handleSaxDoctype(
  *             funicodeOrNone(c_name),
  *             funicodeOrNone(c_public),             # <<<<<<<<<<<<<<
  *             funicodeOrNone(c_system))
  *     except:
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_public); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 578, __pyx_L9_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_public); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 587, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "src/lxml/saxparser.pxi":579
+        /* "src/lxml/saxparser.pxi":588
  *             funicodeOrNone(c_name),
  *             funicodeOrNone(c_public),
  *             funicodeOrNone(c_system))             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_system); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 579, __pyx_L9_error)
+        __pyx_t_8 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_system); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 588, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_8);
 
-        /* "src/lxml/saxparser.pxi":576
+        /* "src/lxml/saxparser.pxi":585
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         context._target._handleSaxDoctype(             # <<<<<<<<<<<<<<
  *             funicodeOrNone(c_name),
  *             funicodeOrNone(c_public),
  */
-        __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(8, 576, __pyx_L9_error)
+        __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 585, __pyx_L9_error)
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-        /* "src/lxml/saxparser.pxi":575
+        /* "src/lxml/saxparser.pxi":584
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133474,7 +133480,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "src/lxml/saxparser.pxi":580
+      /* "src/lxml/saxparser.pxi":589
  *             funicodeOrNone(c_public),
  *             funicodeOrNone(c_system))
  *     except:             # <<<<<<<<<<<<<<
@@ -133483,12 +133489,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxTargetDoctype", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(8, 580, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(3, 589, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":581
+        /* "src/lxml/saxparser.pxi":590
  *             funicodeOrNone(c_system))
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -133503,7 +133509,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":575
+      /* "src/lxml/saxparser.pxi":584
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133524,7 +133530,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
     }
   }
 
-  /* "src/lxml/saxparser.pxi":583
+  /* "src/lxml/saxparser.pxi":592
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -133569,7 +133575,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
     }
   }
 
-  /* "src/lxml/saxparser.pxi":567
+  /* "src/lxml/saxparser.pxi":576
  * 
  * 
  * cdef void _handleSaxTargetDoctype(void* ctxt, const_xmlChar* c_name,             # <<<<<<<<<<<<<<
@@ -133586,7 +133592,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetDoctype(void *__pyx_v_ctxt, con
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":586
+/* "src/lxml/saxparser.pxi":595
  * 
  * 
  * cdef void _handleSaxStartDocument(void* ctxt) with gil:             # <<<<<<<<<<<<<<
@@ -133620,7 +133626,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
   #endif
   __Pyx_RefNannySetupContext("_handleSaxStartDocument", 0);
 
-  /* "src/lxml/saxparser.pxi":587
+  /* "src/lxml/saxparser.pxi":596
  * 
  * cdef void _handleSaxStartDocument(void* ctxt) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -133629,7 +133635,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":588
+  /* "src/lxml/saxparser.pxi":597
  * cdef void _handleSaxStartDocument(void* ctxt) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133647,7 +133653,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":589
+    /* "src/lxml/saxparser.pxi":598
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -133656,7 +133662,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":588
+    /* "src/lxml/saxparser.pxi":597
  * cdef void _handleSaxStartDocument(void* ctxt) with gil:
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133665,7 +133671,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  */
   }
 
-  /* "src/lxml/saxparser.pxi":590
+  /* "src/lxml/saxparser.pxi":599
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -133677,7 +133683,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":591
+  /* "src/lxml/saxparser.pxi":600
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxStartDocument(ctxt)             # <<<<<<<<<<<<<<
@@ -133686,7 +133692,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  */
   __pyx_v_context->_origSaxStartDocument(__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":592
+  /* "src/lxml/saxparser.pxi":601
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxStartDocument(ctxt)
  *     c_doc = c_ctxt.myDoc             # <<<<<<<<<<<<<<
@@ -133696,7 +133702,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
   __pyx_t_4 = __pyx_v_c_ctxt->myDoc;
   __pyx_v_c_doc = __pyx_t_4;
 
-  /* "src/lxml/saxparser.pxi":593
+  /* "src/lxml/saxparser.pxi":602
  *     context._origSaxStartDocument(ctxt)
  *     c_doc = c_ctxt.myDoc
  *     try:             # <<<<<<<<<<<<<<
@@ -133713,16 +133719,16 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
       __Pyx_XGOTREF(__pyx_t_7);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":594
+        /* "src/lxml/saxparser.pxi":603
  *     c_doc = c_ctxt.myDoc
  *     try:
  *         context.startDocument(c_doc)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->startDocument(__pyx_v_context, __pyx_v_c_doc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 594, __pyx_L9_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->startDocument(__pyx_v_context, __pyx_v_c_doc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 603, __pyx_L9_error)
 
-        /* "src/lxml/saxparser.pxi":593
+        /* "src/lxml/saxparser.pxi":602
  *     context._origSaxStartDocument(ctxt)
  *     c_doc = c_ctxt.myDoc
  *     try:             # <<<<<<<<<<<<<<
@@ -133737,7 +133743,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
       __pyx_L9_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "src/lxml/saxparser.pxi":595
+      /* "src/lxml/saxparser.pxi":604
  *     try:
  *         context.startDocument(c_doc)
  *     except:             # <<<<<<<<<<<<<<
@@ -133746,12 +133752,12 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxStartDocument", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(8, 595, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_9, &__pyx_t_10) < 0) __PYX_ERR(3, 604, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_GOTREF(__pyx_t_10);
 
-        /* "src/lxml/saxparser.pxi":596
+        /* "src/lxml/saxparser.pxi":605
  *         context.startDocument(c_doc)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -133766,7 +133772,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":593
+      /* "src/lxml/saxparser.pxi":602
  *     context._origSaxStartDocument(ctxt)
  *     c_doc = c_ctxt.myDoc
  *     try:             # <<<<<<<<<<<<<<
@@ -133787,7 +133793,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
     }
   }
 
-  /* "src/lxml/saxparser.pxi":598
+  /* "src/lxml/saxparser.pxi":607
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -133832,7 +133838,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
     }
   }
 
-  /* "src/lxml/saxparser.pxi":586
+  /* "src/lxml/saxparser.pxi":595
  * 
  * 
  * cdef void _handleSaxStartDocument(void* ctxt) with gil:             # <<<<<<<<<<<<<<
@@ -133849,7 +133855,7 @@ static void __pyx_f_4lxml_5etree__handleSaxStartDocument(void *__pyx_v_ctxt) {
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":601
+/* "src/lxml/saxparser.pxi":610
  * 
  * 
  * cdef void _handleSaxTargetPI(void* ctxt, const_xmlChar* c_target,             # <<<<<<<<<<<<<<
@@ -133882,7 +133888,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
   #endif
   __Pyx_RefNannySetupContext("_handleSaxTargetPI", 0);
 
-  /* "src/lxml/saxparser.pxi":604
+  /* "src/lxml/saxparser.pxi":613
  *                              const_xmlChar* c_data) with gil:
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -133891,7 +133897,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":605
+  /* "src/lxml/saxparser.pxi":614
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133909,7 +133915,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":606
+    /* "src/lxml/saxparser.pxi":615
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -133918,7 +133924,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":605
+    /* "src/lxml/saxparser.pxi":614
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -133927,7 +133933,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
   }
 
-  /* "src/lxml/saxparser.pxi":607
+  /* "src/lxml/saxparser.pxi":616
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -133939,7 +133945,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":608
+  /* "src/lxml/saxparser.pxi":617
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -133956,41 +133962,41 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":610
+        /* "src/lxml/saxparser.pxi":619
  *     try:
  *         pi = context._target._handleSaxPi(
  *             funicodeOrNone(c_target),             # <<<<<<<<<<<<<<
  *             funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 610, __pyx_L9_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrNone(__pyx_v_c_target); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 619, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":611
+        /* "src/lxml/saxparser.pxi":620
  *         pi = context._target._handleSaxPi(
  *             funicodeOrNone(c_target),
  *             funicodeOrEmpty(c_data))             # <<<<<<<<<<<<<<
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:
  *             context.events_iterator._events.append(('pi', pi))
  */
-        __pyx_t_7 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_c_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 611, __pyx_L9_error)
+        __pyx_t_7 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_c_data); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 620, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_7);
 
-        /* "src/lxml/saxparser.pxi":609
+        /* "src/lxml/saxparser.pxi":618
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         pi = context._target._handleSaxPi(             # <<<<<<<<<<<<<<
  *             funicodeOrNone(c_target),
  *             funicodeOrEmpty(c_data))
  */
-        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxPi(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 609, __pyx_L9_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxPi(__pyx_v_context->_target, __pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 618, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         __pyx_v_pi = __pyx_t_8;
         __pyx_t_8 = 0;
 
-        /* "src/lxml/saxparser.pxi":612
+        /* "src/lxml/saxparser.pxi":621
  *             funicodeOrNone(c_target),
  *             funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:             # <<<<<<<<<<<<<<
@@ -134000,7 +134006,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
         __pyx_t_1 = ((__pyx_v_context->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_PI) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":613
+          /* "src/lxml/saxparser.pxi":622
  *             funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:
  *             context.events_iterator._events.append(('pi', pi))             # <<<<<<<<<<<<<<
@@ -134009,9 +134015,9 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
           if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
             PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-            __PYX_ERR(8, 613, __pyx_L9_error)
+            __PYX_ERR(3, 622, __pyx_L9_error)
           }
-          __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(8, 613, __pyx_L9_error)
+          __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 622, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_8);
           __Pyx_INCREF(__pyx_n_s_pi);
           __Pyx_GIVEREF(__pyx_n_s_pi);
@@ -134019,10 +134025,10 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
           __Pyx_INCREF(__pyx_v_pi);
           __Pyx_GIVEREF(__pyx_v_pi);
           PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_pi);
-          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(8, 613, __pyx_L9_error)
+          __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 622, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-          /* "src/lxml/saxparser.pxi":612
+          /* "src/lxml/saxparser.pxi":621
  *             funicodeOrNone(c_target),
  *             funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:             # <<<<<<<<<<<<<<
@@ -134031,7 +134037,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
         }
 
-        /* "src/lxml/saxparser.pxi":608
+        /* "src/lxml/saxparser.pxi":617
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -134048,7 +134054,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "src/lxml/saxparser.pxi":614
+      /* "src/lxml/saxparser.pxi":623
  *         if context._event_filter & PARSE_EVENT_FILTER_PI:
  *             context.events_iterator._events.append(('pi', pi))
  *     except:             # <<<<<<<<<<<<<<
@@ -134057,12 +134063,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxTargetPI", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(8, 614, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_3) < 0) __PYX_ERR(3, 623, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
 
-        /* "src/lxml/saxparser.pxi":615
+        /* "src/lxml/saxparser.pxi":624
  *             context.events_iterator._events.append(('pi', pi))
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134077,7 +134083,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":608
+      /* "src/lxml/saxparser.pxi":617
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -134098,7 +134104,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
     }
   }
 
-  /* "src/lxml/saxparser.pxi":617
+  /* "src/lxml/saxparser.pxi":626
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -134143,7 +134149,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
     }
   }
 
-  /* "src/lxml/saxparser.pxi":601
+  /* "src/lxml/saxparser.pxi":610
  * 
  * 
  * cdef void _handleSaxTargetPI(void* ctxt, const_xmlChar* c_target,             # <<<<<<<<<<<<<<
@@ -134161,7 +134167,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetPI(void *__pyx_v_ctxt, const xm
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":620
+/* "src/lxml/saxparser.pxi":629
  * 
  * 
  * cdef void _handleSaxPIEvent(void* ctxt, const_xmlChar* target,             # <<<<<<<<<<<<<<
@@ -134194,7 +134200,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
   #endif
   __Pyx_RefNannySetupContext("_handleSaxPIEvent", 0);
 
-  /* "src/lxml/saxparser.pxi":623
+  /* "src/lxml/saxparser.pxi":632
  *                             const_xmlChar* data) with gil:
  *     # can only be called when collecting pi events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -134203,7 +134209,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":624
+  /* "src/lxml/saxparser.pxi":633
  *     # can only be called when collecting pi events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134221,7 +134227,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":625
+    /* "src/lxml/saxparser.pxi":634
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -134230,7 +134236,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":624
+    /* "src/lxml/saxparser.pxi":633
  *     # can only be called when collecting pi events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134239,7 +134245,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":626
+  /* "src/lxml/saxparser.pxi":635
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -134251,7 +134257,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":627
+  /* "src/lxml/saxparser.pxi":636
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxPI(ctxt, target, data)             # <<<<<<<<<<<<<<
@@ -134260,7 +134266,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_context->_origSaxPI(__pyx_v_ctxt, __pyx_v_target, __pyx_v_data);
 
-  /* "src/lxml/saxparser.pxi":628
+  /* "src/lxml/saxparser.pxi":637
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxPI(ctxt, target, data)
  *     c_node = _findLastEventNode(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134269,7 +134275,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__findLastEventNode(__pyx_v_c_ctxt);
 
-  /* "src/lxml/saxparser.pxi":629
+  /* "src/lxml/saxparser.pxi":638
  *     context._origSaxPI(ctxt, target, data)
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -134279,7 +134285,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":630
+    /* "src/lxml/saxparser.pxi":639
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:
  *         return             # <<<<<<<<<<<<<<
@@ -134288,7 +134294,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":629
+    /* "src/lxml/saxparser.pxi":638
  *     context._origSaxPI(ctxt, target, data)
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -134297,7 +134303,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":631
+  /* "src/lxml/saxparser.pxi":640
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134314,16 +134320,16 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":632
+        /* "src/lxml/saxparser.pxi":641
  *         return
  *     try:
  *         context.pushEvent('pi', c_node)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_pi, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 632, __pyx_L10_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_pi, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 641, __pyx_L10_error)
 
-        /* "src/lxml/saxparser.pxi":631
+        /* "src/lxml/saxparser.pxi":640
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134338,7 +134344,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
       __pyx_L10_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "src/lxml/saxparser.pxi":633
+      /* "src/lxml/saxparser.pxi":642
  *     try:
  *         context.pushEvent('pi', c_node)
  *     except:             # <<<<<<<<<<<<<<
@@ -134347,12 +134353,12 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxPIEvent", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(8, 633, __pyx_L12_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(3, 642, __pyx_L12_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":634
+        /* "src/lxml/saxparser.pxi":643
  *         context.pushEvent('pi', c_node)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134367,7 +134373,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
       }
       __pyx_L12_except_error:;
 
-      /* "src/lxml/saxparser.pxi":631
+      /* "src/lxml/saxparser.pxi":640
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134388,7 +134394,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":636
+  /* "src/lxml/saxparser.pxi":645
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -134433,7 +134439,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":620
+  /* "src/lxml/saxparser.pxi":629
  * 
  * 
  * cdef void _handleSaxPIEvent(void* ctxt, const_xmlChar* target,             # <<<<<<<<<<<<<<
@@ -134450,7 +134456,7 @@ static void __pyx_f_4lxml_5etree__handleSaxPIEvent(void *__pyx_v_ctxt, const xml
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":639
+/* "src/lxml/saxparser.pxi":648
  * 
  * 
  * cdef void _handleSaxTargetComment(void* ctxt, const_xmlChar* c_data) with gil:             # <<<<<<<<<<<<<<
@@ -134483,7 +134489,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
   #endif
   __Pyx_RefNannySetupContext("_handleSaxTargetComment", 0);
 
-  /* "src/lxml/saxparser.pxi":641
+  /* "src/lxml/saxparser.pxi":650
  * cdef void _handleSaxTargetComment(void* ctxt, const_xmlChar* c_data) with gil:
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -134492,7 +134498,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":642
+  /* "src/lxml/saxparser.pxi":651
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134510,7 +134516,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":643
+    /* "src/lxml/saxparser.pxi":652
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -134519,7 +134525,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":642
+    /* "src/lxml/saxparser.pxi":651
  *     # can only be called if parsing with a target
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134528,7 +134534,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
   }
 
-  /* "src/lxml/saxparser.pxi":644
+  /* "src/lxml/saxparser.pxi":653
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -134540,7 +134546,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":645
+  /* "src/lxml/saxparser.pxi":654
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -134557,22 +134563,22 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":646
+        /* "src/lxml/saxparser.pxi":655
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:
  *         comment = context._target._handleSaxComment(funicodeOrEmpty(c_data))             # <<<<<<<<<<<<<<
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:
  *             context.events_iterator._events.append(('comment', comment))
  */
-        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_c_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 646, __pyx_L9_error)
+        __pyx_t_3 = __pyx_f_4lxml_5etree_funicodeOrEmpty(__pyx_v_c_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 655, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_3);
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxComment(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 646, __pyx_L9_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxComment(__pyx_v_context->_target, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 655, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
         __pyx_v_comment = __pyx_t_7;
         __pyx_t_7 = 0;
 
-        /* "src/lxml/saxparser.pxi":647
+        /* "src/lxml/saxparser.pxi":656
  *     try:
  *         comment = context._target._handleSaxComment(funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:             # <<<<<<<<<<<<<<
@@ -134582,7 +134588,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
         __pyx_t_1 = ((__pyx_v_context->_event_filter & __pyx_e_4lxml_5etree_PARSE_EVENT_FILTER_COMMENT) != 0);
         if (__pyx_t_1) {
 
-          /* "src/lxml/saxparser.pxi":648
+          /* "src/lxml/saxparser.pxi":657
  *         comment = context._target._handleSaxComment(funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:
  *             context.events_iterator._events.append(('comment', comment))             # <<<<<<<<<<<<<<
@@ -134591,9 +134597,9 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
           if (unlikely(__pyx_v_context->events_iterator->_events == Py_None)) {
             PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-            __PYX_ERR(8, 648, __pyx_L9_error)
+            __PYX_ERR(3, 657, __pyx_L9_error)
           }
-          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 648, __pyx_L9_error)
+          __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 657, __pyx_L9_error)
           __Pyx_GOTREF(__pyx_t_7);
           __Pyx_INCREF(__pyx_n_s_comment);
           __Pyx_GIVEREF(__pyx_n_s_comment);
@@ -134601,10 +134607,10 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
           __Pyx_INCREF(__pyx_v_comment);
           __Pyx_GIVEREF(__pyx_v_comment);
           PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_comment);
-          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 648, __pyx_L9_error)
+          __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_context->events_iterator->_events, __pyx_t_7); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 657, __pyx_L9_error)
           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-          /* "src/lxml/saxparser.pxi":647
+          /* "src/lxml/saxparser.pxi":656
  *     try:
  *         comment = context._target._handleSaxComment(funicodeOrEmpty(c_data))
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:             # <<<<<<<<<<<<<<
@@ -134613,7 +134619,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
         }
 
-        /* "src/lxml/saxparser.pxi":645
+        /* "src/lxml/saxparser.pxi":654
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -134629,7 +134635,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "src/lxml/saxparser.pxi":649
+      /* "src/lxml/saxparser.pxi":658
  *         if context._event_filter & PARSE_EVENT_FILTER_COMMENT:
  *             context.events_iterator._events.append(('comment', comment))
  *     except:             # <<<<<<<<<<<<<<
@@ -134638,12 +134644,12 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxTargetComment", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(8, 649, __pyx_L11_except_error)
+        if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_3, &__pyx_t_9) < 0) __PYX_ERR(3, 658, __pyx_L11_except_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":650
+        /* "src/lxml/saxparser.pxi":659
  *             context.events_iterator._events.append(('comment', comment))
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134658,7 +134664,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
       }
       __pyx_L11_except_error:;
 
-      /* "src/lxml/saxparser.pxi":645
+      /* "src/lxml/saxparser.pxi":654
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     try:             # <<<<<<<<<<<<<<
@@ -134679,7 +134685,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
     }
   }
 
-  /* "src/lxml/saxparser.pxi":652
+  /* "src/lxml/saxparser.pxi":661
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -134724,7 +134730,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
     }
   }
 
-  /* "src/lxml/saxparser.pxi":639
+  /* "src/lxml/saxparser.pxi":648
  * 
  * 
  * cdef void _handleSaxTargetComment(void* ctxt, const_xmlChar* c_data) with gil:             # <<<<<<<<<<<<<<
@@ -134742,7 +134748,7 @@ static void __pyx_f_4lxml_5etree__handleSaxTargetComment(void *__pyx_v_ctxt, con
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":655
+/* "src/lxml/saxparser.pxi":664
  * 
  * 
  * cdef void _handleSaxComment(void* ctxt, const_xmlChar* text) with gil:             # <<<<<<<<<<<<<<
@@ -134775,7 +134781,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
   #endif
   __Pyx_RefNannySetupContext("_handleSaxComment", 0);
 
-  /* "src/lxml/saxparser.pxi":657
+  /* "src/lxml/saxparser.pxi":666
  * cdef void _handleSaxComment(void* ctxt, const_xmlChar* text) with gil:
  *     # can only be called when collecting comment events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<<
@@ -134784,7 +134790,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);
 
-  /* "src/lxml/saxparser.pxi":658
+  /* "src/lxml/saxparser.pxi":667
  *     # can only be called when collecting comment events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134802,7 +134808,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":659
+    /* "src/lxml/saxparser.pxi":668
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return             # <<<<<<<<<<<<<<
@@ -134811,7 +134817,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":658
+    /* "src/lxml/saxparser.pxi":667
  *     # can only be called when collecting comment events
  *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:             # <<<<<<<<<<<<<<
@@ -134820,7 +134826,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":660
+  /* "src/lxml/saxparser.pxi":669
  *     if c_ctxt._private is NULL or c_ctxt.disableSAX:
  *         return
  *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<<
@@ -134832,7 +134838,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/saxparser.pxi":661
+  /* "src/lxml/saxparser.pxi":670
  *         return
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxComment(ctxt, text)             # <<<<<<<<<<<<<<
@@ -134841,7 +134847,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_context->_origSaxComment(__pyx_v_ctxt, __pyx_v_text);
 
-  /* "src/lxml/saxparser.pxi":662
+  /* "src/lxml/saxparser.pxi":671
  *     context = <_SaxParserContext>c_ctxt._private
  *     context._origSaxComment(ctxt, text)
  *     c_node = _findLastEventNode(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134850,7 +134856,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
   __pyx_v_c_node = __pyx_f_4lxml_5etree__findLastEventNode(__pyx_v_c_ctxt);
 
-  /* "src/lxml/saxparser.pxi":663
+  /* "src/lxml/saxparser.pxi":672
  *     context._origSaxComment(ctxt, text)
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -134860,7 +134866,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
   __pyx_t_1 = ((__pyx_v_c_node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":664
+    /* "src/lxml/saxparser.pxi":673
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:
  *         return             # <<<<<<<<<<<<<<
@@ -134869,7 +134875,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":663
+    /* "src/lxml/saxparser.pxi":672
  *     context._origSaxComment(ctxt, text)
  *     c_node = _findLastEventNode(c_ctxt)
  *     if c_node is NULL:             # <<<<<<<<<<<<<<
@@ -134878,7 +134884,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
   }
 
-  /* "src/lxml/saxparser.pxi":665
+  /* "src/lxml/saxparser.pxi":674
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134895,16 +134901,16 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
       __Pyx_XGOTREF(__pyx_t_6);
       /*try:*/ {
 
-        /* "src/lxml/saxparser.pxi":666
+        /* "src/lxml/saxparser.pxi":675
  *         return
  *     try:
  *         context.pushEvent('comment', c_node)             # <<<<<<<<<<<<<<
  *     except:
  *         context._handleSaxException(c_ctxt)
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_comment, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(8, 666, __pyx_L10_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->pushEvent(__pyx_v_context, __pyx_n_s_comment, __pyx_v_c_node); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 675, __pyx_L10_error)
 
-        /* "src/lxml/saxparser.pxi":665
+        /* "src/lxml/saxparser.pxi":674
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134919,7 +134925,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
       __pyx_L10_error:;
       __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-      /* "src/lxml/saxparser.pxi":667
+      /* "src/lxml/saxparser.pxi":676
  *     try:
  *         context.pushEvent('comment', c_node)
  *     except:             # <<<<<<<<<<<<<<
@@ -134928,12 +134934,12 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._handleSaxComment", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(8, 667, __pyx_L12_except_error)
+        if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(3, 676, __pyx_L12_except_error)
         __Pyx_GOTREF(__pyx_t_3);
         __Pyx_GOTREF(__pyx_t_8);
         __Pyx_GOTREF(__pyx_t_9);
 
-        /* "src/lxml/saxparser.pxi":668
+        /* "src/lxml/saxparser.pxi":677
  *         context.pushEvent('comment', c_node)
  *     except:
  *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<<
@@ -134948,7 +134954,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
       }
       __pyx_L12_except_error:;
 
-      /* "src/lxml/saxparser.pxi":665
+      /* "src/lxml/saxparser.pxi":674
  *     if c_node is NULL:
  *         return
  *     try:             # <<<<<<<<<<<<<<
@@ -134969,7 +134975,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":670
+  /* "src/lxml/saxparser.pxi":679
  *         context._handleSaxException(c_ctxt)
  *     finally:
  *         return  # swallow any further exceptions             # <<<<<<<<<<<<<<
@@ -135014,7 +135020,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
     }
   }
 
-  /* "src/lxml/saxparser.pxi":655
+  /* "src/lxml/saxparser.pxi":664
  * 
  * 
  * cdef void _handleSaxComment(void* ctxt, const_xmlChar* text) with gil:             # <<<<<<<<<<<<<<
@@ -135031,7 +135037,7 @@ static void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt, const xml
   #endif
 }
 
-/* "src/lxml/saxparser.pxi":673
+/* "src/lxml/saxparser.pxi":682
  * 
  * 
  * cdef inline xmlNode* _findLastEventNode(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -135045,7 +135051,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("_findLastEventNode", 0);
 
-  /* "src/lxml/saxparser.pxi":675
+  /* "src/lxml/saxparser.pxi":684
  * cdef inline xmlNode* _findLastEventNode(xmlparser.xmlParserCtxt* c_ctxt):
  *     # this mimics what libxml2 creates for comments/PIs
  *     if c_ctxt.inSubset == 1:             # <<<<<<<<<<<<<<
@@ -135055,7 +135061,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   __pyx_t_1 = ((__pyx_v_c_ctxt->inSubset == 1) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":676
+    /* "src/lxml/saxparser.pxi":685
  *     # this mimics what libxml2 creates for comments/PIs
  *     if c_ctxt.inSubset == 1:
  *         return c_ctxt.myDoc.intSubset.last             # <<<<<<<<<<<<<<
@@ -135065,7 +135071,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
     __pyx_r = __pyx_v_c_ctxt->myDoc->intSubset->last;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":675
+    /* "src/lxml/saxparser.pxi":684
  * cdef inline xmlNode* _findLastEventNode(xmlparser.xmlParserCtxt* c_ctxt):
  *     # this mimics what libxml2 creates for comments/PIs
  *     if c_ctxt.inSubset == 1:             # <<<<<<<<<<<<<<
@@ -135074,7 +135080,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
  */
   }
 
-  /* "src/lxml/saxparser.pxi":677
+  /* "src/lxml/saxparser.pxi":686
  *     if c_ctxt.inSubset == 1:
  *         return c_ctxt.myDoc.intSubset.last
  *     elif c_ctxt.inSubset == 2:             # <<<<<<<<<<<<<<
@@ -135084,7 +135090,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   __pyx_t_1 = ((__pyx_v_c_ctxt->inSubset == 2) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":678
+    /* "src/lxml/saxparser.pxi":687
  *         return c_ctxt.myDoc.intSubset.last
  *     elif c_ctxt.inSubset == 2:
  *         return c_ctxt.myDoc.extSubset.last             # <<<<<<<<<<<<<<
@@ -135094,7 +135100,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
     __pyx_r = __pyx_v_c_ctxt->myDoc->extSubset->last;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":677
+    /* "src/lxml/saxparser.pxi":686
  *     if c_ctxt.inSubset == 1:
  *         return c_ctxt.myDoc.intSubset.last
  *     elif c_ctxt.inSubset == 2:             # <<<<<<<<<<<<<<
@@ -135103,7 +135109,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
  */
   }
 
-  /* "src/lxml/saxparser.pxi":679
+  /* "src/lxml/saxparser.pxi":688
  *     elif c_ctxt.inSubset == 2:
  *         return c_ctxt.myDoc.extSubset.last
  *     elif c_ctxt.node is NULL:             # <<<<<<<<<<<<<<
@@ -135113,7 +135119,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   __pyx_t_1 = ((__pyx_v_c_ctxt->node == NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":680
+    /* "src/lxml/saxparser.pxi":689
  *         return c_ctxt.myDoc.extSubset.last
  *     elif c_ctxt.node is NULL:
  *         return c_ctxt.myDoc.last             # <<<<<<<<<<<<<<
@@ -135123,7 +135129,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
     __pyx_r = __pyx_v_c_ctxt->myDoc->last;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":679
+    /* "src/lxml/saxparser.pxi":688
  *     elif c_ctxt.inSubset == 2:
  *         return c_ctxt.myDoc.extSubset.last
  *     elif c_ctxt.node is NULL:             # <<<<<<<<<<<<<<
@@ -135132,7 +135138,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
  */
   }
 
-  /* "src/lxml/saxparser.pxi":681
+  /* "src/lxml/saxparser.pxi":690
  *     elif c_ctxt.node is NULL:
  *         return c_ctxt.myDoc.last
  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -135142,7 +135148,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   __pyx_t_1 = ((__pyx_v_c_ctxt->node->type == XML_ELEMENT_NODE) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":682
+    /* "src/lxml/saxparser.pxi":691
  *         return c_ctxt.myDoc.last
  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:
  *         return c_ctxt.node.last             # <<<<<<<<<<<<<<
@@ -135152,7 +135158,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
     __pyx_r = __pyx_v_c_ctxt->node->last;
     goto __pyx_L0;
 
-    /* "src/lxml/saxparser.pxi":681
+    /* "src/lxml/saxparser.pxi":690
  *     elif c_ctxt.node is NULL:
  *         return c_ctxt.myDoc.last
  *     elif c_ctxt.node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -135161,7 +135167,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
  */
   }
 
-  /* "src/lxml/saxparser.pxi":684
+  /* "src/lxml/saxparser.pxi":693
  *         return c_ctxt.node.last
  *     else:
  *         return c_ctxt.node.next             # <<<<<<<<<<<<<<
@@ -135173,7 +135179,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
     goto __pyx_L0;
   }
 
-  /* "src/lxml/saxparser.pxi":673
+  /* "src/lxml/saxparser.pxi":682
  * 
  * 
  * cdef inline xmlNode* _findLastEventNode(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<<
@@ -135187,7 +135193,7 @@ static CYTHON_INLINE xmlNode *__pyx_f_4lxml_5etree__findLastEventNode(xmlParserC
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":718
+/* "src/lxml/saxparser.pxi":727
  *     cdef bint _insert_pis
  * 
  *     def __init__(self, *, element_factory=None, parser=None,             # <<<<<<<<<<<<<<
@@ -135216,7 +135222,7 @@ static int __pyx_pw_4lxml_5etree_11TreeBuilder_1__init__(PyObject *__pyx_v_self,
     values[0] = ((PyObject *)Py_None);
     values[1] = ((PyObject *)Py_None);
 
-    /* "src/lxml/saxparser.pxi":719
+    /* "src/lxml/saxparser.pxi":728
  * 
  *     def __init__(self, *, element_factory=None, parser=None,
  *                  comment_factory=None, pi_factory=None,             # <<<<<<<<<<<<<<
@@ -135241,7 +135247,7 @@ static int __pyx_pw_4lxml_5etree_11TreeBuilder_1__init__(PyObject *__pyx_v_self,
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(8, 718, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(3, 727, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
       goto __pyx_L5_argtuple_error;
@@ -135252,10 +135258,10 @@ static int __pyx_pw_4lxml_5etree_11TreeBuilder_1__init__(PyObject *__pyx_v_self,
     __pyx_v_comment_factory = values[2];
     __pyx_v_pi_factory = values[3];
     if (values[4]) {
-      __pyx_v_insert_comments = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_insert_comments == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 720, __pyx_L3_error)
+      __pyx_v_insert_comments = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_insert_comments == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 729, __pyx_L3_error)
     } else {
 
-      /* "src/lxml/saxparser.pxi":720
+      /* "src/lxml/saxparser.pxi":729
  *     def __init__(self, *, element_factory=None, parser=None,
  *                  comment_factory=None, pi_factory=None,
  *                  bint insert_comments=True, bint insert_pis=True):             # <<<<<<<<<<<<<<
@@ -135265,14 +135271,14 @@ static int __pyx_pw_4lxml_5etree_11TreeBuilder_1__init__(PyObject *__pyx_v_self,
       __pyx_v_insert_comments = ((int)1);
     }
     if (values[5]) {
-      __pyx_v_insert_pis = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_insert_pis == (int)-1) && PyErr_Occurred())) __PYX_ERR(8, 720, __pyx_L3_error)
+      __pyx_v_insert_pis = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_insert_pis == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 729, __pyx_L3_error)
     } else {
       __pyx_v_insert_pis = ((int)1);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 718, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 727, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.TreeBuilder.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -135280,7 +135286,7 @@ static int __pyx_pw_4lxml_5etree_11TreeBuilder_1__init__(PyObject *__pyx_v_self,
   __pyx_L4_argument_unpacking_done:;
   __pyx_r = __pyx_pf_4lxml_5etree_11TreeBuilder___init__(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self), __pyx_v_element_factory, __pyx_v_parser, __pyx_v_comment_factory, __pyx_v_pi_factory, __pyx_v_insert_comments, __pyx_v_insert_pis);
 
-  /* "src/lxml/saxparser.pxi":718
+  /* "src/lxml/saxparser.pxi":727
  *     cdef bint _insert_pis
  * 
  *     def __init__(self, *, element_factory=None, parser=None,             # <<<<<<<<<<<<<<
@@ -135304,7 +135310,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/saxparser.pxi":721
+  /* "src/lxml/saxparser.pxi":730
  *                  comment_factory=None, pi_factory=None,
  *                  bint insert_comments=True, bint insert_pis=True):
  *         self._sax_event_filter = \             # <<<<<<<<<<<<<<
@@ -135313,14 +135319,14 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
  */
   __pyx_v_self->__pyx_base._sax_event_filter = ((((__pyx_e_4lxml_5etree_SAX_EVENT_START | __pyx_e_4lxml_5etree_SAX_EVENT_END) | __pyx_e_4lxml_5etree_SAX_EVENT_DATA) | __pyx_e_4lxml_5etree_SAX_EVENT_PI) | __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
 
-  /* "src/lxml/saxparser.pxi":724
+  /* "src/lxml/saxparser.pxi":733
  *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
  *             SAX_EVENT_PI | SAX_EVENT_COMMENT
  *         self._data = [] # data collector             # <<<<<<<<<<<<<<
  *         self._element_stack = [] # element stack
  *         self._element_stack_pop = self._element_stack.pop
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 724, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 733, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_data);
@@ -135328,14 +135334,14 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":725
+  /* "src/lxml/saxparser.pxi":734
  *             SAX_EVENT_PI | SAX_EVENT_COMMENT
  *         self._data = [] # data collector
  *         self._element_stack = [] # element stack             # <<<<<<<<<<<<<<
  *         self._element_stack_pop = self._element_stack.pop
  *         self._last = None # last element
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 725, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 734, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_element_stack);
@@ -135343,14 +135349,14 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_element_stack = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":726
+  /* "src/lxml/saxparser.pxi":735
  *         self._data = [] # data collector
  *         self._element_stack = [] # element stack
  *         self._element_stack_pop = self._element_stack.pop             # <<<<<<<<<<<<<<
  *         self._last = None # last element
  *         self._in_tail = 0 # true if we're after an end tag
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_element_stack, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 726, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_element_stack, __pyx_n_s_pop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 735, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_element_stack_pop);
@@ -135358,7 +135364,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_element_stack_pop = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":727
+  /* "src/lxml/saxparser.pxi":736
  *         self._element_stack = [] # element stack
  *         self._element_stack_pop = self._element_stack.pop
  *         self._last = None # last element             # <<<<<<<<<<<<<<
@@ -135371,7 +135377,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
   __pyx_v_self->_last = ((struct LxmlElement *)Py_None);
 
-  /* "src/lxml/saxparser.pxi":728
+  /* "src/lxml/saxparser.pxi":737
  *         self._element_stack_pop = self._element_stack.pop
  *         self._last = None # last element
  *         self._in_tail = 0 # true if we're after an end tag             # <<<<<<<<<<<<<<
@@ -135380,7 +135386,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
  */
   __pyx_v_self->_in_tail = 0;
 
-  /* "src/lxml/saxparser.pxi":729
+  /* "src/lxml/saxparser.pxi":738
  *         self._last = None # last element
  *         self._in_tail = 0 # true if we're after an end tag
  *         self._factory = element_factory             # <<<<<<<<<<<<<<
@@ -135393,7 +135399,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __Pyx_DECREF(__pyx_v_self->_factory);
   __pyx_v_self->_factory = __pyx_v_element_factory;
 
-  /* "src/lxml/saxparser.pxi":730
+  /* "src/lxml/saxparser.pxi":739
  *         self._in_tail = 0 # true if we're after an end tag
  *         self._factory = element_factory
  *         self._comment_factory = comment_factory if comment_factory is not None else Comment             # <<<<<<<<<<<<<<
@@ -135405,7 +135411,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
     __Pyx_INCREF(__pyx_v_comment_factory);
     __pyx_t_1 = __pyx_v_comment_factory;
   } else {
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Comment); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 730, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Comment); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 739, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -135416,7 +135422,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_comment_factory = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":731
+  /* "src/lxml/saxparser.pxi":740
  *         self._factory = element_factory
  *         self._comment_factory = comment_factory if comment_factory is not None else Comment
  *         self._pi_factory = pi_factory if pi_factory is not None else ProcessingInstruction             # <<<<<<<<<<<<<<
@@ -135428,7 +135434,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
     __Pyx_INCREF(__pyx_v_pi_factory);
     __pyx_t_1 = __pyx_v_pi_factory;
   } else {
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 731, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ProcessingInstruction); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 740, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_1 = __pyx_t_3;
     __pyx_t_3 = 0;
@@ -135439,7 +135445,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_pi_factory = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":732
+  /* "src/lxml/saxparser.pxi":741
  *         self._comment_factory = comment_factory if comment_factory is not None else Comment
  *         self._pi_factory = pi_factory if pi_factory is not None else ProcessingInstruction
  *         self._insert_comments = insert_comments             # <<<<<<<<<<<<<<
@@ -135448,7 +135454,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
  */
   __pyx_v_self->_insert_comments = __pyx_v_insert_comments;
 
-  /* "src/lxml/saxparser.pxi":733
+  /* "src/lxml/saxparser.pxi":742
  *         self._pi_factory = pi_factory if pi_factory is not None else ProcessingInstruction
  *         self._insert_comments = insert_comments
  *         self._insert_pis = insert_pis             # <<<<<<<<<<<<<<
@@ -135457,14 +135463,14 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
  */
   __pyx_v_self->_insert_pis = __pyx_v_insert_pis;
 
-  /* "src/lxml/saxparser.pxi":734
+  /* "src/lxml/saxparser.pxi":743
  *         self._insert_comments = insert_comments
  *         self._insert_pis = insert_pis
  *         self._parser = parser             # <<<<<<<<<<<<<<
  * 
  *     @cython.final
  */
-  if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(8, 734, __pyx_L1_error)
+  if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(3, 743, __pyx_L1_error)
   __pyx_t_1 = __pyx_v_parser;
   __Pyx_INCREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
@@ -135473,7 +135479,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   __pyx_v_self->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":718
+  /* "src/lxml/saxparser.pxi":727
  *     cdef bint _insert_pis
  * 
  *     def __init__(self, *, element_factory=None, parser=None,             # <<<<<<<<<<<<<<
@@ -135494,7 +135500,7 @@ static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(struct __pyx_obj_4lxml_5
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":737
+/* "src/lxml/saxparser.pxi":746
  * 
  *     @cython.final
  *     cdef int _flush(self) except -1:             # <<<<<<<<<<<<<<
@@ -135515,7 +135521,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_flush", 0);
 
-  /* "src/lxml/saxparser.pxi":738
+  /* "src/lxml/saxparser.pxi":747
  *     @cython.final
  *     cdef int _flush(self) except -1:
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -135525,7 +135531,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
   __pyx_t_1 = (__pyx_v_self->_data != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_data) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/saxparser.pxi":739
+    /* "src/lxml/saxparser.pxi":748
  *     cdef int _flush(self) except -1:
  *         if self._data:
  *             if self._last is not None:             # <<<<<<<<<<<<<<
@@ -135536,7 +135542,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/saxparser.pxi":740
+      /* "src/lxml/saxparser.pxi":749
  *         if self._data:
  *             if self._last is not None:
  *                 text = u"".join(self._data)             # <<<<<<<<<<<<<<
@@ -135545,13 +135551,13 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
  */
       __pyx_t_3 = __pyx_v_self->_data;
       __Pyx_INCREF(__pyx_t_3);
-      __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 740, __pyx_L1_error)
+      __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 749, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_v_text = ((PyObject*)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "src/lxml/saxparser.pxi":741
+      /* "src/lxml/saxparser.pxi":750
  *             if self._last is not None:
  *                 text = u"".join(self._data)
  *                 if self._in_tail:             # <<<<<<<<<<<<<<
@@ -135561,7 +135567,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
       __pyx_t_2 = (__pyx_v_self->_in_tail != 0);
       if (__pyx_t_2) {
 
-        /* "src/lxml/saxparser.pxi":742
+        /* "src/lxml/saxparser.pxi":751
  *                 text = u"".join(self._data)
  *                 if self._in_tail:
  *                     assert self._last.tail is None, u"internal error (tail)"             # <<<<<<<<<<<<<<
@@ -135570,27 +135576,27 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
  */
         #ifndef CYTHON_WITHOUT_ASSERTIONS
         if (unlikely(!Py_OptimizeFlag)) {
-          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tail); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 742, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tail); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 751, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_t_2 = (__pyx_t_4 == Py_None);
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
           if (unlikely(!(__pyx_t_2 != 0))) {
             PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_internal_error_tail);
-            __PYX_ERR(8, 742, __pyx_L1_error)
+            __PYX_ERR(3, 751, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "src/lxml/saxparser.pxi":743
+        /* "src/lxml/saxparser.pxi":752
  *                 if self._in_tail:
  *                     assert self._last.tail is None, u"internal error (tail)"
  *                     self._last.tail = text             # <<<<<<<<<<<<<<
  *                 else:
  *                     assert self._last.text is None, u"internal error (text)"
  */
-        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(8, 743, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(3, 752, __pyx_L1_error)
 
-        /* "src/lxml/saxparser.pxi":741
+        /* "src/lxml/saxparser.pxi":750
  *             if self._last is not None:
  *                 text = u"".join(self._data)
  *                 if self._in_tail:             # <<<<<<<<<<<<<<
@@ -135600,7 +135606,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
         goto __pyx_L5;
       }
 
-      /* "src/lxml/saxparser.pxi":745
+      /* "src/lxml/saxparser.pxi":754
  *                     self._last.tail = text
  *                 else:
  *                     assert self._last.text is None, u"internal error (text)"             # <<<<<<<<<<<<<<
@@ -135610,29 +135616,29 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
       /*else*/ {
         #ifndef CYTHON_WITHOUT_ASSERTIONS
         if (unlikely(!Py_OptimizeFlag)) {
-          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 745, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 754, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_t_2 = (__pyx_t_4 == Py_None);
           __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
           if (unlikely(!(__pyx_t_2 != 0))) {
             PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_internal_error_text);
-            __PYX_ERR(8, 745, __pyx_L1_error)
+            __PYX_ERR(3, 754, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "src/lxml/saxparser.pxi":746
+        /* "src/lxml/saxparser.pxi":755
  *                 else:
  *                     assert self._last.text is None, u"internal error (text)"
  *                     self._last.text = text             # <<<<<<<<<<<<<<
  *             del self._data[:]
  *         return 0
  */
-        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(8, 746, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(3, 755, __pyx_L1_error)
       }
       __pyx_L5:;
 
-      /* "src/lxml/saxparser.pxi":739
+      /* "src/lxml/saxparser.pxi":748
  *     cdef int _flush(self) except -1:
  *         if self._data:
  *             if self._last is not None:             # <<<<<<<<<<<<<<
@@ -135641,7 +135647,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
  */
     }
 
-    /* "src/lxml/saxparser.pxi":747
+    /* "src/lxml/saxparser.pxi":756
  *                     assert self._last.text is None, u"internal error (text)"
  *                     self._last.text = text
  *             del self._data[:]             # <<<<<<<<<<<<<<
@@ -135650,11 +135656,11 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
  */
     if (unlikely(__pyx_v_self->_data == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(8, 747, __pyx_L1_error)
+      __PYX_ERR(3, 756, __pyx_L1_error)
     }
-    if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(8, 747, __pyx_L1_error)
+    if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(3, 756, __pyx_L1_error)
 
-    /* "src/lxml/saxparser.pxi":738
+    /* "src/lxml/saxparser.pxi":747
  *     @cython.final
  *     cdef int _flush(self) except -1:
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -135663,7 +135669,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
  */
   }
 
-  /* "src/lxml/saxparser.pxi":748
+  /* "src/lxml/saxparser.pxi":757
  *                     self._last.text = text
  *             del self._data[:]
  *         return 0             # <<<<<<<<<<<<<<
@@ -135673,7 +135679,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
   __pyx_r = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":737
+  /* "src/lxml/saxparser.pxi":746
  * 
  *     @cython.final
  *     cdef int _flush(self) except -1:             # <<<<<<<<<<<<<<
@@ -135693,7 +135699,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etr
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":753
+/* "src/lxml/saxparser.pxi":762
  * 
  *     @cython.final
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
@@ -135717,16 +135723,16 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handleSaxStart", 0);
 
-  /* "src/lxml/saxparser.pxi":754
+  /* "src/lxml/saxparser.pxi":763
  *     @cython.final
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         self._flush()             # <<<<<<<<<<<<<<
  *         if self._factory is not None:
  *             self._last = self._factory(tag, attrib)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 754, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 763, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":755
+  /* "src/lxml/saxparser.pxi":764
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         self._flush()
  *         if self._factory is not None:             # <<<<<<<<<<<<<<
@@ -135737,7 +135743,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/saxparser.pxi":756
+    /* "src/lxml/saxparser.pxi":765
  *         self._flush()
  *         if self._factory is not None:
  *             self._last = self._factory(tag, attrib)             # <<<<<<<<<<<<<<
@@ -135760,7 +135766,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_5)) {
       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_tag, __pyx_v_attrib};
-      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 756, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 765, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
@@ -135768,13 +135774,13 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
       PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_tag, __pyx_v_attrib};
-      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 756, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 765, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
     #endif
     {
-      __pyx_t_7 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(8, 756, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 765, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       if (__pyx_t_6) {
         __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
@@ -135785,19 +135791,19 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
       __Pyx_INCREF(__pyx_v_attrib);
       __Pyx_GIVEREF(__pyx_v_attrib);
       PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_1, __pyx_v_attrib);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 756, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 765, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 756, __pyx_L1_error)
+    if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 765, __pyx_L1_error)
     __Pyx_GIVEREF(__pyx_t_4);
     __Pyx_GOTREF(__pyx_v_self->_last);
     __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/saxparser.pxi":757
+    /* "src/lxml/saxparser.pxi":766
  *         if self._factory is not None:
  *             self._last = self._factory(tag, attrib)
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -135807,7 +135813,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     __pyx_t_3 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
     if (__pyx_t_3) {
 
-      /* "src/lxml/saxparser.pxi":758
+      /* "src/lxml/saxparser.pxi":767
  *             self._last = self._factory(tag, attrib)
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
@@ -135816,18 +135822,18 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
       if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(8, 758, __pyx_L1_error)
+        __PYX_ERR(3, 767, __pyx_L1_error)
       }
-      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 758, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 767, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 758, __pyx_L1_error)
+      if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 767, __pyx_L1_error)
       __pyx_t_5 = ((PyObject *)__pyx_v_self->_last);
       __Pyx_INCREF(__pyx_t_5);
-      __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_4), ((struct LxmlElement *)__pyx_t_5)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 758, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_4), ((struct LxmlElement *)__pyx_t_5)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 767, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-      /* "src/lxml/saxparser.pxi":757
+      /* "src/lxml/saxparser.pxi":766
  *         if self._factory is not None:
  *             self._last = self._factory(tag, attrib)
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -135836,7 +135842,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
     }
 
-    /* "src/lxml/saxparser.pxi":755
+    /* "src/lxml/saxparser.pxi":764
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):
  *         self._flush()
  *         if self._factory is not None:             # <<<<<<<<<<<<<<
@@ -135846,7 +135852,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "src/lxml/saxparser.pxi":759
+  /* "src/lxml/saxparser.pxi":768
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  *         elif self._element_stack:             # <<<<<<<<<<<<<<
@@ -135856,7 +135862,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   __pyx_t_3 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/saxparser.pxi":761
+    /* "src/lxml/saxparser.pxi":770
  *         elif self._element_stack:
  *             self._last = _makeSubElement(
  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<<
@@ -135865,20 +135871,20 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
     if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(8, 761, __pyx_L1_error)
+      __PYX_ERR(3, 770, __pyx_L1_error)
     }
-    __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 761, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 770, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
-    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 761, __pyx_L1_error)
+    if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 770, __pyx_L1_error)
 
-    /* "src/lxml/saxparser.pxi":760
+    /* "src/lxml/saxparser.pxi":769
  *                 _appendChild(self._element_stack[-1], self._last)
  *         elif self._element_stack:
  *             self._last = _makeSubElement(             # <<<<<<<<<<<<<<
  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
  *         else:
  */
-    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(((struct LxmlElement *)__pyx_t_5), __pyx_v_tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, ((PyObject*)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(8, 760, __pyx_L1_error)
+    __pyx_t_4 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(((struct LxmlElement *)__pyx_t_5), __pyx_v_tag, Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, ((PyObject*)Py_None))); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 769, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GIVEREF(__pyx_t_4);
@@ -135887,7 +135893,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/saxparser.pxi":759
+    /* "src/lxml/saxparser.pxi":768
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  *         elif self._element_stack:             # <<<<<<<<<<<<<<
@@ -135897,7 +135903,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     goto __pyx_L3;
   }
 
-  /* "src/lxml/saxparser.pxi":763
+  /* "src/lxml/saxparser.pxi":772
  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
  *         else:
  *             self._last = _makeElement(             # <<<<<<<<<<<<<<
@@ -135906,7 +135912,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
   /*else*/ {
 
-    /* "src/lxml/saxparser.pxi":764
+    /* "src/lxml/saxparser.pxi":773
  *         else:
  *             self._last = _makeElement(
  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<<
@@ -135916,14 +135922,14 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
     __pyx_t_4 = ((PyObject *)__pyx_v_self->_parser);
     __Pyx_INCREF(__pyx_t_4);
 
-    /* "src/lxml/saxparser.pxi":763
+    /* "src/lxml/saxparser.pxi":772
  *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
  *         else:
  *             self._last = _makeElement(             # <<<<<<<<<<<<<<
  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
  *         self._element_stack.append(self._last)
  */
-    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v_tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_4), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, ((PyObject*)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(8, 763, __pyx_L1_error)
+    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__makeElement(__pyx_v_tag, NULL, ((struct LxmlDocument *)Py_None), ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_4), Py_None, Py_None, __pyx_v_attrib, __pyx_v_nsmap, ((PyObject*)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 772, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GIVEREF(__pyx_t_5);
@@ -135934,7 +135940,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   }
   __pyx_L3:;
 
-  /* "src/lxml/saxparser.pxi":765
+  /* "src/lxml/saxparser.pxi":774
  *             self._last = _makeElement(
  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
  *         self._element_stack.append(self._last)             # <<<<<<<<<<<<<<
@@ -135943,14 +135949,14 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(8, 765, __pyx_L1_error)
+    __PYX_ERR(3, 774, __pyx_L1_error)
   }
   __pyx_t_5 = ((PyObject *)__pyx_v_self->_last);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(8, 765, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 774, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/saxparser.pxi":766
+  /* "src/lxml/saxparser.pxi":775
  *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
  *         self._element_stack.append(self._last)
  *         self._in_tail = 0             # <<<<<<<<<<<<<<
@@ -135959,7 +135965,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
  */
   __pyx_v_self->_in_tail = 0;
 
-  /* "src/lxml/saxparser.pxi":767
+  /* "src/lxml/saxparser.pxi":776
  *         self._element_stack.append(self._last)
  *         self._in_tail = 0
  *         return self._last             # <<<<<<<<<<<<<<
@@ -135971,7 +135977,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   __pyx_r = ((PyObject *)__pyx_v_self->_last);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":753
+  /* "src/lxml/saxparser.pxi":762
  * 
  *     @cython.final
  *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<<
@@ -135993,7 +135999,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(struct __pyx
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":770
+/* "src/lxml/saxparser.pxi":779
  * 
  *     @cython.final
  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
@@ -136013,16 +136019,16 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handleSaxEnd", 0);
 
-  /* "src/lxml/saxparser.pxi":771
+  /* "src/lxml/saxparser.pxi":780
  *     @cython.final
  *     cdef _handleSaxEnd(self, tag):
  *         self._flush()             # <<<<<<<<<<<<<<
  *         self._last = self._element_stack_pop()
  *         self._in_tail = 1
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 771, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 780, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":772
+  /* "src/lxml/saxparser.pxi":781
  *     cdef _handleSaxEnd(self, tag):
  *         self._flush()
  *         self._last = self._element_stack_pop()             # <<<<<<<<<<<<<<
@@ -136042,17 +136048,17 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
   }
   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 772, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 781, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 772, __pyx_L1_error)
+  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 781, __pyx_L1_error)
   __Pyx_GIVEREF(__pyx_t_2);
   __Pyx_GOTREF(__pyx_v_self->_last);
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_last));
   __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "src/lxml/saxparser.pxi":773
+  /* "src/lxml/saxparser.pxi":782
  *         self._flush()
  *         self._last = self._element_stack_pop()
  *         self._in_tail = 1             # <<<<<<<<<<<<<<
@@ -136061,7 +136067,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
  */
   __pyx_v_self->_in_tail = 1;
 
-  /* "src/lxml/saxparser.pxi":774
+  /* "src/lxml/saxparser.pxi":783
  *         self._last = self._element_stack_pop()
  *         self._in_tail = 1
  *         return self._last             # <<<<<<<<<<<<<<
@@ -136073,7 +136079,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
   __pyx_r = ((PyObject *)__pyx_v_self->_last);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":770
+  /* "src/lxml/saxparser.pxi":779
  * 
  *     @cython.final
  *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<<
@@ -136094,7 +136100,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_o
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":777
+/* "src/lxml/saxparser.pxi":786
  * 
  *     @cython.final
  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
@@ -136111,7 +136117,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4l
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handleSaxData", 0);
 
-  /* "src/lxml/saxparser.pxi":778
+  /* "src/lxml/saxparser.pxi":787
  *     @cython.final
  *     cdef int _handleSaxData(self, data) except -1:
  *         self._data.append(data)             # <<<<<<<<<<<<<<
@@ -136120,11 +136126,11 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4l
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(8, 778, __pyx_L1_error)
+    __PYX_ERR(3, 787, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 778, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 787, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":777
+  /* "src/lxml/saxparser.pxi":786
  * 
  *     @cython.final
  *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<<
@@ -136143,7 +136149,7 @@ static int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4l
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":781
+/* "src/lxml/saxparser.pxi":790
  * 
  *     @cython.final
  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
@@ -136166,7 +136172,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handleSaxPi", 0);
 
-  /* "src/lxml/saxparser.pxi":782
+  /* "src/lxml/saxparser.pxi":791
  *     @cython.final
  *     cdef _handleSaxPi(self, target, data):
  *         elem = self._pi_factory(target, data)             # <<<<<<<<<<<<<<
@@ -136189,7 +136195,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_target, __pyx_v_data};
-    __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(8, 782, __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(3, 791, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -136197,13 +136203,13 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_target, __pyx_v_data};
-    __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(8, 782, __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(3, 791, __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(8, 782, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 791, __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;
@@ -136214,7 +136220,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
     __Pyx_INCREF(__pyx_v_data);
     __Pyx_GIVEREF(__pyx_v_data);
     PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_data);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 782, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 791, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -136222,7 +136228,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   __pyx_v_elem = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":783
+  /* "src/lxml/saxparser.pxi":792
  *     cdef _handleSaxPi(self, target, data):
  *         elem = self._pi_factory(target, data)
  *         if self._insert_pis:             # <<<<<<<<<<<<<<
@@ -136232,23 +136238,23 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   __pyx_t_6 = (__pyx_v_self->_insert_pis != 0);
   if (__pyx_t_6) {
 
-    /* "src/lxml/saxparser.pxi":784
+    /* "src/lxml/saxparser.pxi":793
  *         elem = self._pi_factory(target, data)
  *         if self._insert_pis:
  *             self._flush()             # <<<<<<<<<<<<<<
  *             self._last = elem
  *             if self._element_stack:
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 784, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 793, __pyx_L1_error)
 
-    /* "src/lxml/saxparser.pxi":785
+    /* "src/lxml/saxparser.pxi":794
  *         if self._insert_pis:
  *             self._flush()
  *             self._last = elem             # <<<<<<<<<<<<<<
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  */
-    if (!(likely(((__pyx_v_elem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_elem, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 785, __pyx_L1_error)
+    if (!(likely(((__pyx_v_elem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_elem, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 794, __pyx_L1_error)
     __pyx_t_1 = __pyx_v_elem;
     __Pyx_INCREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
@@ -136257,7 +136263,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "src/lxml/saxparser.pxi":786
+    /* "src/lxml/saxparser.pxi":795
  *             self._flush()
  *             self._last = elem
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -136267,7 +136273,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
     __pyx_t_6 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
     if (__pyx_t_6) {
 
-      /* "src/lxml/saxparser.pxi":787
+      /* "src/lxml/saxparser.pxi":796
  *             self._last = elem
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
@@ -136276,18 +136282,18 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
  */
       if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(8, 787, __pyx_L1_error)
+        __PYX_ERR(3, 796, __pyx_L1_error)
       }
-      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 787, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 796, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 787, __pyx_L1_error)
+      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 796, __pyx_L1_error)
       __pyx_t_2 = ((PyObject *)__pyx_v_self->_last);
       __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_4 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(8, 787, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 796, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-      /* "src/lxml/saxparser.pxi":786
+      /* "src/lxml/saxparser.pxi":795
  *             self._flush()
  *             self._last = elem
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -136296,7 +136302,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
  */
     }
 
-    /* "src/lxml/saxparser.pxi":788
+    /* "src/lxml/saxparser.pxi":797
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  *             self._in_tail = 1             # <<<<<<<<<<<<<<
@@ -136305,7 +136311,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
  */
     __pyx_v_self->_in_tail = 1;
 
-    /* "src/lxml/saxparser.pxi":783
+    /* "src/lxml/saxparser.pxi":792
  *     cdef _handleSaxPi(self, target, data):
  *         elem = self._pi_factory(target, data)
  *         if self._insert_pis:             # <<<<<<<<<<<<<<
@@ -136314,7 +136320,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
  */
   }
 
-  /* "src/lxml/saxparser.pxi":789
+  /* "src/lxml/saxparser.pxi":798
  *                 _appendChild(self._element_stack[-1], self._last)
  *             self._in_tail = 1
  *         return self._last             # <<<<<<<<<<<<<<
@@ -136326,7 +136332,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   __pyx_r = ((PyObject *)__pyx_v_self->_last);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":781
+  /* "src/lxml/saxparser.pxi":790
  * 
  *     @cython.final
  *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<<
@@ -136349,7 +136355,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":792
+/* "src/lxml/saxparser.pxi":801
  * 
  *     @cython.final
  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
@@ -136371,7 +136377,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handleSaxComment", 0);
 
-  /* "src/lxml/saxparser.pxi":793
+  /* "src/lxml/saxparser.pxi":802
  *     @cython.final
  *     cdef _handleSaxComment(self, comment):
  *         elem = self._comment_factory(comment)             # <<<<<<<<<<<<<<
@@ -136391,13 +136397,13 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_comment) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_comment);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 793, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 802, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_elem = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":794
+  /* "src/lxml/saxparser.pxi":803
  *     cdef _handleSaxComment(self, comment):
  *         elem = self._comment_factory(comment)
  *         if self._insert_comments:             # <<<<<<<<<<<<<<
@@ -136407,23 +136413,23 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
   __pyx_t_4 = (__pyx_v_self->_insert_comments != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/saxparser.pxi":795
+    /* "src/lxml/saxparser.pxi":804
  *         elem = self._comment_factory(comment)
  *         if self._insert_comments:
  *             self._flush()             # <<<<<<<<<<<<<<
  *             self._last = elem
  *             if self._element_stack:
  */
-    __pyx_t_5 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 795, __pyx_L1_error)
+    __pyx_t_5 = __pyx_f_4lxml_5etree_11TreeBuilder__flush(__pyx_v_self); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 804, __pyx_L1_error)
 
-    /* "src/lxml/saxparser.pxi":796
+    /* "src/lxml/saxparser.pxi":805
  *         if self._insert_comments:
  *             self._flush()
  *             self._last = elem             # <<<<<<<<<<<<<<
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  */
-    if (!(likely(((__pyx_v_elem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_elem, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 796, __pyx_L1_error)
+    if (!(likely(((__pyx_v_elem) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_elem, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 805, __pyx_L1_error)
     __pyx_t_1 = __pyx_v_elem;
     __Pyx_INCREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_1);
@@ -136432,7 +136438,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
     __pyx_v_self->_last = ((struct LxmlElement *)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "src/lxml/saxparser.pxi":797
+    /* "src/lxml/saxparser.pxi":806
  *             self._flush()
  *             self._last = elem
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -136442,7 +136448,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
     __pyx_t_4 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
     if (__pyx_t_4) {
 
-      /* "src/lxml/saxparser.pxi":798
+      /* "src/lxml/saxparser.pxi":807
  *             self._last = elem
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<<
@@ -136451,18 +136457,18 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
  */
       if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(8, 798, __pyx_L1_error)
+        __PYX_ERR(3, 807, __pyx_L1_error)
       }
-      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 798, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 807, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(8, 798, __pyx_L1_error)
+      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 807, __pyx_L1_error)
       __pyx_t_2 = ((PyObject *)__pyx_v_self->_last);
       __Pyx_INCREF(__pyx_t_2);
-      __pyx_t_5 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(8, 798, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_t_1), ((struct LxmlElement *)__pyx_t_2)); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 807, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-      /* "src/lxml/saxparser.pxi":797
+      /* "src/lxml/saxparser.pxi":806
  *             self._flush()
  *             self._last = elem
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -136471,7 +136477,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
  */
     }
 
-    /* "src/lxml/saxparser.pxi":799
+    /* "src/lxml/saxparser.pxi":808
  *             if self._element_stack:
  *                 _appendChild(self._element_stack[-1], self._last)
  *             self._in_tail = 1             # <<<<<<<<<<<<<<
@@ -136480,7 +136486,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
  */
     __pyx_v_self->_in_tail = 1;
 
-    /* "src/lxml/saxparser.pxi":794
+    /* "src/lxml/saxparser.pxi":803
  *     cdef _handleSaxComment(self, comment):
  *         elem = self._comment_factory(comment)
  *         if self._insert_comments:             # <<<<<<<<<<<<<<
@@ -136489,7 +136495,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
  */
   }
 
-  /* "src/lxml/saxparser.pxi":800
+  /* "src/lxml/saxparser.pxi":809
  *                 _appendChild(self._element_stack[-1], self._last)
  *             self._in_tail = 1
  *         return elem             # <<<<<<<<<<<<<<
@@ -136501,7 +136507,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
   __pyx_r = __pyx_v_elem;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":792
+  /* "src/lxml/saxparser.pxi":801
  * 
  *     @cython.final
  *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<<
@@ -136523,7 +136529,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":804
+/* "src/lxml/saxparser.pxi":813
  *     # Python level event handlers
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
@@ -136533,7 +136539,7 @@ static PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __p
 
 /* Python wrapper */
 static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_4lxml_5etree_11TreeBuilder_2close[] = "close(self)\n\n        Flushes the builder buffers, and returns the toplevel document\n        element.\n        ";
+static char __pyx_doc_4lxml_5etree_11TreeBuilder_2close[] = "close(self)\n\n        Flushes the builder buffers, and returns the toplevel document\n        element.  Raises XMLSyntaxError on inconsistencies.\n        ";
 static PyMethodDef __pyx_mdef_4lxml_5etree_11TreeBuilder_3close = {"close", (PyCFunction)__pyx_pw_4lxml_5etree_11TreeBuilder_3close, METH_NOARGS, __pyx_doc_4lxml_5etree_11TreeBuilder_2close};
 static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
   PyObject *__pyx_r = 0;
@@ -136550,48 +136556,113 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_2close(struct __pyx_obj_4lx
   PyObject *__pyx_r = NULL;
   __Pyx_RefNannyDeclarations
   int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_t_5;
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("close", 0);
 
-  /* "src/lxml/saxparser.pxi":810
- *         element.
+  /* "src/lxml/saxparser.pxi":819
+ *         element.  Raises XMLSyntaxError on inconsistencies.
  *         """
- *         assert not self._element_stack, u"missing end tags"             # <<<<<<<<<<<<<<
- *         assert self._last is not None, u"missing toplevel element"
- *         return self._last
+ *         if self._element_stack:             # <<<<<<<<<<<<<<
+ *             raise XMLSyntaxAssertionError("missing end tags")
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
  */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
-    if (unlikely(!((!__pyx_t_1) != 0))) {
-      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_missing_end_tags);
-      __PYX_ERR(8, 810, __pyx_L1_error)
+  __pyx_t_1 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
+  if (unlikely(__pyx_t_1)) {
+
+    /* "src/lxml/saxparser.pxi":820
+ *         """
+ *         if self._element_stack:
+ *             raise XMLSyntaxAssertionError("missing end tags")             # <<<<<<<<<<<<<<
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
+ *         if self._last is None:
+ */
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_XMLSyntaxAssertionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 820, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
     }
-  }
-  #endif
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_missing_end_tags) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_missing_end_tags);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 820, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(3, 820, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":811
+    /* "src/lxml/saxparser.pxi":819
+ *         element.  Raises XMLSyntaxError on inconsistencies.
  *         """
- *         assert not self._element_stack, u"missing end tags"
- *         assert self._last is not None, u"missing toplevel element"             # <<<<<<<<<<<<<<
+ *         if self._element_stack:             # <<<<<<<<<<<<<<
+ *             raise XMLSyntaxAssertionError("missing end tags")
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
+ */
+  }
+
+  /* "src/lxml/saxparser.pxi":822
+ *             raise XMLSyntaxAssertionError("missing end tags")
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
+ *         if self._last is None:             # <<<<<<<<<<<<<<
+ *             raise XMLSyntaxAssertionError("missing toplevel element")
+ *         return self._last
+ */
+  __pyx_t_1 = (((PyObject *)__pyx_v_self->_last) == Py_None);
+  __pyx_t_5 = (__pyx_t_1 != 0);
+  if (unlikely(__pyx_t_5)) {
+
+    /* "src/lxml/saxparser.pxi":823
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
+ *         if self._last is None:
+ *             raise XMLSyntaxAssertionError("missing toplevel element")             # <<<<<<<<<<<<<<
  *         return self._last
  * 
  */
-  #ifndef CYTHON_WITHOUT_ASSERTIONS
-  if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = (((PyObject *)__pyx_v_self->_last) != Py_None);
-    if (unlikely(!(__pyx_t_1 != 0))) {
-      PyErr_SetObject(PyExc_AssertionError, __pyx_kp_u_missing_toplevel_element);
-      __PYX_ERR(8, 811, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_XMLSyntaxAssertionError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 823, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = NULL;
+    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+      if (likely(__pyx_t_4)) {
+        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+        __Pyx_INCREF(__pyx_t_4);
+        __Pyx_INCREF(function);
+        __Pyx_DECREF_SET(__pyx_t_3, function);
+      }
     }
+    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_missing_toplevel_element) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_missing_toplevel_element);
+    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 823, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __PYX_ERR(3, 823, __pyx_L1_error)
+
+    /* "src/lxml/saxparser.pxi":822
+ *             raise XMLSyntaxAssertionError("missing end tags")
+ *         # TODO: this does not necessarily seem like an error case.  Why not just return None?
+ *         if self._last is None:             # <<<<<<<<<<<<<<
+ *             raise XMLSyntaxAssertionError("missing toplevel element")
+ *         return self._last
+ */
   }
-  #endif
 
-  /* "src/lxml/saxparser.pxi":812
- *         assert not self._element_stack, u"missing end tags"
- *         assert self._last is not None, u"missing toplevel element"
+  /* "src/lxml/saxparser.pxi":824
+ *         if self._last is None:
+ *             raise XMLSyntaxAssertionError("missing toplevel element")
  *         return self._last             # <<<<<<<<<<<<<<
  * 
  *     def data(self, data):
@@ -136601,7 +136672,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_2close(struct __pyx_obj_4lx
   __pyx_r = ((PyObject *)__pyx_v_self->_last);
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":804
+  /* "src/lxml/saxparser.pxi":813
  *     # Python level event handlers
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
@@ -136611,6 +136682,9 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_2close(struct __pyx_obj_4lx
 
   /* function exit code */
   __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
   __Pyx_AddTraceback("lxml.etree.TreeBuilder.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
@@ -136619,7 +136693,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_2close(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":814
+/* "src/lxml/saxparser.pxi":826
  *         return self._last
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
@@ -136651,16 +136725,16 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_4data(struct __pyx_obj_4lxm
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("data", 0);
 
-  /* "src/lxml/saxparser.pxi":820
+  /* "src/lxml/saxparser.pxi":832
  *         8-bit string containing ASCII text, or a Unicode string.
  *         """
  *         self._handleSaxData(data)             # <<<<<<<<<<<<<<
  * 
  *     def start(self, tag, attrs, nsmap=None):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(8, 820, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 832, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":814
+  /* "src/lxml/saxparser.pxi":826
  *         return self._last
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
@@ -136680,7 +136754,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_4data(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":822
+/* "src/lxml/saxparser.pxi":834
  *         self._handleSaxData(data)
  * 
  *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<<
@@ -136728,7 +136802,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_7start(PyObject *__pyx_v_se
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, 1); __PYX_ERR(8, 822, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, 1); __PYX_ERR(3, 834, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
@@ -136738,7 +136812,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_7start(PyObject *__pyx_v_se
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) __PYX_ERR(8, 822, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) __PYX_ERR(3, 834, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -136756,7 +136830,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_7start(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 822, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("start", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 834, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.TreeBuilder.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -136781,7 +136855,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
   __Pyx_RefNannySetupContext("start", 0);
   __Pyx_INCREF(__pyx_v_nsmap);
 
-  /* "src/lxml/saxparser.pxi":827
+  /* "src/lxml/saxparser.pxi":839
  *         Opens a new element.
  *         """
  *         if nsmap is None:             # <<<<<<<<<<<<<<
@@ -136792,7 +136866,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/saxparser.pxi":828
+    /* "src/lxml/saxparser.pxi":840
  *         """
  *         if nsmap is None:
  *             nsmap = IMMUTABLE_EMPTY_MAPPING             # <<<<<<<<<<<<<<
@@ -136802,7 +136876,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
     __Pyx_INCREF(__pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
     __Pyx_DECREF_SET(__pyx_v_nsmap, __pyx_v_4lxml_5etree_IMMUTABLE_EMPTY_MAPPING);
 
-    /* "src/lxml/saxparser.pxi":827
+    /* "src/lxml/saxparser.pxi":839
  *         Opens a new element.
  *         """
  *         if nsmap is None:             # <<<<<<<<<<<<<<
@@ -136811,7 +136885,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
  */
   }
 
-  /* "src/lxml/saxparser.pxi":829
+  /* "src/lxml/saxparser.pxi":841
  *         if nsmap is None:
  *             nsmap = IMMUTABLE_EMPTY_MAPPING
  *         return self._handleSaxStart(tag, attrs, nsmap)             # <<<<<<<<<<<<<<
@@ -136819,13 +136893,13 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
  *     def end(self, tag):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(8, 829, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag, __pyx_v_attrs, __pyx_v_nsmap); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_r = __pyx_t_3;
   __pyx_t_3 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":822
+  /* "src/lxml/saxparser.pxi":834
  *         self._handleSaxData(data)
  * 
  *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<<
@@ -136845,7 +136919,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_6start(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":831
+/* "src/lxml/saxparser.pxi":843
  *         return self._handleSaxStart(tag, attrs, nsmap)
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
@@ -136883,19 +136957,19 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("end", 0);
 
-  /* "src/lxml/saxparser.pxi":836
+  /* "src/lxml/saxparser.pxi":848
  *         Closes the current element.
  *         """
  *         element = self._handleSaxEnd(tag)             # <<<<<<<<<<<<<<
  *         assert self._last.tag == tag,\
  *             f"end tag mismatch (expected {self._last.tag}, got {tag})"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 836, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 848, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_element = __pyx_t_1;
   __pyx_t_1 = 0;
 
-  /* "src/lxml/saxparser.pxi":837
+  /* "src/lxml/saxparser.pxi":849
  *         """
  *         element = self._handleSaxEnd(tag)
  *         assert self._last.tag == tag,\             # <<<<<<<<<<<<<<
@@ -136904,22 +136978,22 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
  */
   #ifndef CYTHON_WITHOUT_ASSERTIONS
   if (unlikely(!Py_OptimizeFlag)) {
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 837, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 849, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 837, __pyx_L1_error)
+    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_v_tag, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 849, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(8, 837, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     if (unlikely(!__pyx_t_3)) {
 
-      /* "src/lxml/saxparser.pxi":838
+      /* "src/lxml/saxparser.pxi":850
  *         element = self._handleSaxEnd(tag)
  *         assert self._last.tag == tag,\
  *             f"end tag mismatch (expected {self._last.tag}, got {tag})"             # <<<<<<<<<<<<<<
  *         return element
  * 
  */
-      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 838, __pyx_L1_error)
+      __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 850, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_4 = 0;
       __pyx_t_5 = 127;
@@ -136927,9 +137001,9 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
       __pyx_t_4 += 27;
       __Pyx_GIVEREF(__pyx_kp_u_end_tag_mismatch_expected);
       PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_u_end_tag_mismatch_expected);
-      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 838, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_last), __pyx_n_s_tag); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 850, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 838, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 850, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
@@ -136941,7 +137015,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
       __pyx_t_4 += 6;
       __Pyx_GIVEREF(__pyx_kp_u_got);
       PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_kp_u_got);
-      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 838, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 850, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
       __pyx_t_4 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6);
@@ -136952,17 +137026,17 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
       __pyx_t_4 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__60);
       PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_kp_u__60);
-      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(8, 838, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_2, 5, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 850, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       PyErr_SetObject(PyExc_AssertionError, __pyx_t_6);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(8, 837, __pyx_L1_error)
+      __PYX_ERR(3, 849, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/saxparser.pxi":839
+  /* "src/lxml/saxparser.pxi":851
  *         assert self._last.tag == tag,\
  *             f"end tag mismatch (expected {self._last.tag}, got {tag})"
  *         return element             # <<<<<<<<<<<<<<
@@ -136974,7 +137048,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
   __pyx_r = __pyx_v_element;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":831
+  /* "src/lxml/saxparser.pxi":843
  *         return self._handleSaxStart(tag, attrs, nsmap)
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
@@ -136996,7 +137070,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_8end(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":841
+/* "src/lxml/saxparser.pxi":853
  *         return element
  * 
  *     def pi(self, target, data=None):             # <<<<<<<<<<<<<<
@@ -137045,7 +137119,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_11pi(PyObject *__pyx_v_self
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pi") < 0)) __PYX_ERR(8, 841, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pi") < 0)) __PYX_ERR(3, 853, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -137061,7 +137135,7 @@ static PyObject *__pyx_pw_4lxml_5etree_11TreeBuilder_11pi(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("pi", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(8, 841, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("pi", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 853, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.TreeBuilder.pi", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -137083,7 +137157,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_10pi(struct __pyx_obj_4lxml
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("pi", 0);
 
-  /* "src/lxml/saxparser.pxi":847
+  /* "src/lxml/saxparser.pxi":859
  *         (unless disabled) and returns it.
  *         """
  *         return self._handleSaxPi(target, data)             # <<<<<<<<<<<<<<
@@ -137091,13 +137165,13 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_10pi(struct __pyx_obj_4lxml
  *     def comment(self, comment):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 847, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_target, __pyx_v_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 859, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":841
+  /* "src/lxml/saxparser.pxi":853
  *         return element
  * 
  *     def pi(self, target, data=None):             # <<<<<<<<<<<<<<
@@ -137116,7 +137190,7 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_10pi(struct __pyx_obj_4lxml
   return __pyx_r;
 }
 
-/* "src/lxml/saxparser.pxi":849
+/* "src/lxml/saxparser.pxi":861
  *         return self._handleSaxPi(target, data)
  * 
  *     def comment(self, comment):             # <<<<<<<<<<<<<<
@@ -137148,19 +137222,19 @@ static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_12comment(struct __pyx_obj_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("comment", 0);
 
-  /* "src/lxml/saxparser.pxi":855
+  /* "src/lxml/saxparser.pxi":867
  *         and returns it.
  *         """
  *         return self._handleSaxComment(comment)             # <<<<<<<<<<<<<<
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 855, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)__pyx_v_self), __pyx_v_comment); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 867, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/saxparser.pxi":849
+  /* "src/lxml/saxparser.pxi":861
  *         return self._handleSaxPi(target, data)
  * 
  *     def comment(self, comment):             # <<<<<<<<<<<<<<
@@ -153751,7 +153825,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__qname(struct __pyx_obj
  *                 self._declared_ns_stack[-1].append((uri, prefix))
  *                 return f'{prefix}:{tag}' if prefix else tag, tag, uri             # <<<<<<<<<<<<<<
  * 
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')
+ *         if not uri:
  */
       __Pyx_XDECREF(__pyx_r);
       __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(9, 1079, __pyx_L1_error)
@@ -153825,11 +153899,54 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__qname(struct __pyx_obj
   /* "src/lxml/serializer.pxi":1081
  *                 return f'{prefix}:{tag}' if prefix else tag, tag, uri
  * 
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')             # <<<<<<<<<<<<<<
+ *         if not uri:             # <<<<<<<<<<<<<<
+ *             # As soon as a default namespace is defined,
+ *             # anything that has no namespace (and thus, no prefix) goes there.
+ */
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_uri); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(9, 1081, __pyx_L1_error)
+  __pyx_t_2 = ((!__pyx_t_11) != 0);
+  if (__pyx_t_2) {
+
+    /* "src/lxml/serializer.pxi":1084
+ *             # As soon as a default namespace is defined,
+ *             # anything that has no namespace (and thus, no prefix) goes there.
+ *             return tag, tag, uri             # <<<<<<<<<<<<<<
+ * 
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1084, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_INCREF(__pyx_v_tag);
+    __Pyx_GIVEREF(__pyx_v_tag);
+    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_tag);
+    __Pyx_INCREF(__pyx_v_tag);
+    __Pyx_GIVEREF(__pyx_v_tag);
+    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_tag);
+    __Pyx_INCREF(__pyx_v_uri);
+    __Pyx_GIVEREF(__pyx_v_uri);
+    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_uri);
+    __pyx_r = __pyx_t_4;
+    __pyx_t_4 = 0;
+    goto __pyx_L0;
+
+    /* "src/lxml/serializer.pxi":1081
+ *                 return f'{prefix}:{tag}' if prefix else tag, tag, uri
+ * 
+ *         if not uri:             # <<<<<<<<<<<<<<
+ *             # As soon as a default namespace is defined,
+ *             # anything that has no namespace (and thus, no prefix) goes there.
+ */
+  }
+
+  /* "src/lxml/serializer.pxi":1086
+ *             return tag, tag, uri
+ * 
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')             # <<<<<<<<<<<<<<
  * 
  *     def data(self, data):
  */
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1081, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_8 = 0;
   __pyx_t_13 = 127;
@@ -153837,26 +153954,37 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__qname(struct __pyx_obj
   __pyx_t_8 += 11;
   __Pyx_GIVEREF(__pyx_kp_u_Namespace);
   PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_Namespace);
-  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_uri, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1081, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_uri, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_13;
   __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
   __pyx_t_3 = 0;
+  __Pyx_INCREF(__pyx_kp_u_of_name);
+  __pyx_t_8 += 11;
+  __Pyx_GIVEREF(__pyx_kp_u_of_name);
+  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_of_name);
+  __pyx_t_3 = __Pyx_PyObject_FormatSimple(__pyx_v_tag, __pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1086, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_3);
+  __pyx_t_13 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) > __pyx_t_13) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) : __pyx_t_13;
+  __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3);
+  __Pyx_GIVEREF(__pyx_t_3);
+  PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3);
+  __pyx_t_3 = 0;
   __Pyx_INCREF(__pyx_kp_u_is_not_declared_in_scope);
   __pyx_t_8 += 26;
   __Pyx_GIVEREF(__pyx_kp_u_is_not_declared_in_scope);
-  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u_is_not_declared_in_scope);
-  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1081, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u_is_not_declared_in_scope);
+  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_8, __pyx_t_13); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1081, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1086, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_Raise(__pyx_t_4, 0, 0, 0);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __PYX_ERR(9, 1081, __pyx_L1_error)
+  __PYX_ERR(9, 1086, __pyx_L1_error)
 
   /* "src/lxml/serializer.pxi":1051
  *         raise ValueError(f'Prefix {prefix} of QName "{prefixed_name}" is not declared in scope')
@@ -153886,8 +154014,8 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__qname(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1083
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')
+/* "src/lxml/serializer.pxi":1088
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         if not self._ignored_depth:
@@ -153918,7 +154046,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_5data(struct __pyx_obj
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("data", 0);
 
-  /* "src/lxml/serializer.pxi":1084
+  /* "src/lxml/serializer.pxi":1089
  * 
  *     def data(self, data):
  *         if not self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -153928,7 +154056,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_5data(struct __pyx_obj
   __pyx_t_1 = ((!(__pyx_v_self->_ignored_depth != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1085
+    /* "src/lxml/serializer.pxi":1090
  *     def data(self, data):
  *         if not self._ignored_depth:
  *             self._data.append(data)             # <<<<<<<<<<<<<<
@@ -153937,11 +154065,11 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_5data(struct __pyx_obj
  */
     if (unlikely(__pyx_v_self->_data == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-      __PYX_ERR(9, 1085, __pyx_L1_error)
+      __PYX_ERR(9, 1090, __pyx_L1_error)
     }
-    __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 1085, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(9, 1090, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1084
+    /* "src/lxml/serializer.pxi":1089
  * 
  *     def data(self, data):
  *         if not self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -153950,8 +154078,8 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_5data(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1083
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')
+  /* "src/lxml/serializer.pxi":1088
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         if not self._ignored_depth:
@@ -153970,7 +154098,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_5data(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1087
+/* "src/lxml/serializer.pxi":1092
  *             self._data.append(data)
  * 
  *     cdef _flush(self):             # <<<<<<<<<<<<<<
@@ -154000,7 +154128,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_flush", 0);
 
-  /* "src/lxml/serializer.pxi":1088
+  /* "src/lxml/serializer.pxi":1093
  * 
  *     cdef _flush(self):
  *         data = u''.join(self._data)             # <<<<<<<<<<<<<<
@@ -154009,13 +154137,13 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
   __pyx_t_1 = __pyx_v_self->_data;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1088, __pyx_L1_error)
+  __pyx_t_2 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1093, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_data = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1089
+  /* "src/lxml/serializer.pxi":1094
  *     cdef _flush(self):
  *         data = u''.join(self._data)
  *         del self._data[:]             # <<<<<<<<<<<<<<
@@ -154024,11 +154152,11 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1089, __pyx_L1_error)
+    __PYX_ERR(9, 1094, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1089, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1094, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1090
+  /* "src/lxml/serializer.pxi":1095
  *         data = u''.join(self._data)
  *         del self._data[:]
  *         if self._strip_text and not self._preserve_space[-1]:             # <<<<<<<<<<<<<<
@@ -154043,30 +154171,30 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
   }
   if (unlikely(__pyx_v_self->_preserve_space == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1090, __pyx_L1_error)
+    __PYX_ERR(9, 1095, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_preserve_space, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1090, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_preserve_space, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1095, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(9, 1090, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(9, 1095, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_5 = ((!__pyx_t_4) != 0);
   __pyx_t_3 = __pyx_t_5;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_3) {
 
-    /* "src/lxml/serializer.pxi":1091
+    /* "src/lxml/serializer.pxi":1096
  *         del self._data[:]
  *         if self._strip_text and not self._preserve_space[-1]:
  *             data = data.strip()             # <<<<<<<<<<<<<<
  *         if self._pending_start is not None:
  *             (tag, attrs, new_namespaces), self._pending_start = self._pending_start, None
  */
-    __pyx_t_2 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1091, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyUnicode_Type_strip, __pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1096, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_2);
     __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1090
+    /* "src/lxml/serializer.pxi":1095
  *         data = u''.join(self._data)
  *         del self._data[:]
  *         if self._strip_text and not self._preserve_space[-1]:             # <<<<<<<<<<<<<<
@@ -154075,7 +154203,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1092
+  /* "src/lxml/serializer.pxi":1097
  *         if self._strip_text and not self._preserve_space[-1]:
  *             data = data.strip()
  *         if self._pending_start is not None:             # <<<<<<<<<<<<<<
@@ -154086,7 +154214,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
   __pyx_t_5 = (__pyx_t_3 != 0);
   if (__pyx_t_5) {
 
-    /* "src/lxml/serializer.pxi":1093
+    /* "src/lxml/serializer.pxi":1098
  *             data = data.strip()
  *         if self._pending_start is not None:
  *             (tag, attrs, new_namespaces), self._pending_start = self._pending_start, None             # <<<<<<<<<<<<<<
@@ -154103,7 +154231,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
       if (unlikely(size != 3)) {
         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(9, 1093, __pyx_L1_error)
+        __PYX_ERR(9, 1098, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
@@ -154113,16 +154241,16 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
       __Pyx_INCREF(__pyx_t_7);
       __Pyx_INCREF(__pyx_t_8);
       #else
-      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1093, __pyx_L1_error)
+      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1098, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
-      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1093, __pyx_L1_error)
+      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1098, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
-      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1093, __pyx_L1_error)
+      __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1098, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       #endif
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     } else {
-      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1093, __pyx_L1_error)
+      __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1098, __pyx_L1_error)
     }
     __pyx_v_tag = __pyx_t_6;
     __pyx_t_6 = 0;
@@ -154136,14 +154264,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
     __pyx_v_self->_pending_start = ((PyObject*)__pyx_t_1);
     __pyx_t_1 = 0;
 
-    /* "src/lxml/serializer.pxi":1094
+    /* "src/lxml/serializer.pxi":1099
  *         if self._pending_start is not None:
  *             (tag, attrs, new_namespaces), self._pending_start = self._pending_start, None
  *             qname_text = data if u':' in data and _looks_like_prefix_name(data) else None             # <<<<<<<<<<<<<<
  *             self._start(tag, attrs, new_namespaces, qname_text)
  *             if qname_text is not None:
  */
-    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_v_data, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1094, __pyx_L1_error)
+    __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__17, __pyx_v_data, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1099, __pyx_L1_error)
     __pyx_t_4 = (__pyx_t_3 != 0);
     if (__pyx_t_4) {
     } else {
@@ -154163,10 +154291,10 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
     }
     __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_v_data);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1094, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1099, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(9, 1094, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(9, 1099, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_5 = __pyx_t_4;
     __pyx_L7_bool_binop_done:;
@@ -154180,7 +154308,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
     __pyx_v_qname_text = __pyx_t_1;
     __pyx_t_1 = 0;
 
-    /* "src/lxml/serializer.pxi":1095
+    /* "src/lxml/serializer.pxi":1100
  *             (tag, attrs, new_namespaces), self._pending_start = self._pending_start, None
  *             qname_text = data if u':' in data and _looks_like_prefix_name(data) else None
  *             self._start(tag, attrs, new_namespaces, qname_text)             # <<<<<<<<<<<<<<
@@ -154189,11 +154317,11 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
     __pyx_t_9.__pyx_n = 1;
     __pyx_t_9.qname_text = __pyx_v_qname_text;
-    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_start(__pyx_v_self, __pyx_v_tag, __pyx_v_attrs, __pyx_v_new_namespaces, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1095, __pyx_L1_error)
+    __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_start(__pyx_v_self, __pyx_v_tag, __pyx_v_attrs, __pyx_v_new_namespaces, &__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1100, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "src/lxml/serializer.pxi":1096
+    /* "src/lxml/serializer.pxi":1101
  *             qname_text = data if u':' in data and _looks_like_prefix_name(data) else None
  *             self._start(tag, attrs, new_namespaces, qname_text)
  *             if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -154204,7 +154332,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
     __pyx_t_4 = (__pyx_t_5 != 0);
     if (__pyx_t_4) {
 
-      /* "src/lxml/serializer.pxi":1097
+      /* "src/lxml/serializer.pxi":1102
  *             self._start(tag, attrs, new_namespaces, qname_text)
  *             if qname_text is not None:
  *                 return             # <<<<<<<<<<<<<<
@@ -154215,7 +154343,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
       __pyx_r = Py_None; __Pyx_INCREF(Py_None);
       goto __pyx_L0;
 
-      /* "src/lxml/serializer.pxi":1096
+      /* "src/lxml/serializer.pxi":1101
  *             qname_text = data if u':' in data and _looks_like_prefix_name(data) else None
  *             self._start(tag, attrs, new_namespaces, qname_text)
  *             if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -154224,7 +154352,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
     }
 
-    /* "src/lxml/serializer.pxi":1092
+    /* "src/lxml/serializer.pxi":1097
  *         if self._strip_text and not self._preserve_space[-1]:
  *             data = data.strip()
  *         if self._pending_start is not None:             # <<<<<<<<<<<<<<
@@ -154233,14 +154361,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1098
+  /* "src/lxml/serializer.pxi":1103
  *             if qname_text is not None:
  *                 return
  *         if data and self._root_seen:             # <<<<<<<<<<<<<<
  *             self._write(_escape_cdata_c14n(data))
  * 
  */
-  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1098, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1103, __pyx_L1_error)
   if (__pyx_t_5) {
   } else {
     __pyx_t_4 = __pyx_t_5;
@@ -154251,14 +154379,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
   __pyx_L11_bool_binop_done:;
   if (__pyx_t_4) {
 
-    /* "src/lxml/serializer.pxi":1099
+    /* "src/lxml/serializer.pxi":1104
  *                 return
  *         if data and self._root_seen:
  *             self._write(_escape_cdata_c14n(data))             # <<<<<<<<<<<<<<
  * 
  *     def start_ns(self, prefix, uri):
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1099, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1104, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(__pyx_v_self->_write);
     __pyx_t_8 = __pyx_v_self->_write; __pyx_t_7 = NULL;
@@ -154274,12 +154402,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
     __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_2);
     __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1099, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1104, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "src/lxml/serializer.pxi":1098
+    /* "src/lxml/serializer.pxi":1103
  *             if qname_text is not None:
  *                 return
  *         if data and self._root_seen:             # <<<<<<<<<<<<<<
@@ -154288,7 +154416,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1087
+  /* "src/lxml/serializer.pxi":1092
  *             self._data.append(data)
  * 
  *     cdef _flush(self):             # <<<<<<<<<<<<<<
@@ -154318,7 +154446,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__flush(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1101
+/* "src/lxml/serializer.pxi":1106
  *             self._write(_escape_cdata_c14n(data))
  * 
  *     def start_ns(self, prefix, uri):             # <<<<<<<<<<<<<<
@@ -154361,11 +154489,11 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_8start_ns(PyObject *__
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_uri)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("start_ns", 1, 2, 2, 1); __PYX_ERR(9, 1101, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("start_ns", 1, 2, 2, 1); __PYX_ERR(9, 1106, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start_ns") < 0)) __PYX_ERR(9, 1101, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start_ns") < 0)) __PYX_ERR(9, 1106, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -154378,7 +154506,7 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_8start_ns(PyObject *__
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("start_ns", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1101, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("start_ns", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1106, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.C14NWriterTarget.start_ns", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -154403,7 +154531,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("start_ns", 0);
 
-  /* "src/lxml/serializer.pxi":1102
+  /* "src/lxml/serializer.pxi":1107
  * 
  *     def start_ns(self, prefix, uri):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -154413,7 +154541,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
   __pyx_t_1 = (__pyx_v_self->_ignored_depth != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1103
+    /* "src/lxml/serializer.pxi":1108
  *     def start_ns(self, prefix, uri):
  *         if self._ignored_depth:
  *             return             # <<<<<<<<<<<<<<
@@ -154424,7 +154552,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1102
+    /* "src/lxml/serializer.pxi":1107
  * 
  *     def start_ns(self, prefix, uri):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -154433,7 +154561,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1105
+  /* "src/lxml/serializer.pxi":1110
  *             return
  *         # we may have to resolve qnames in text content
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -154443,18 +154571,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
   __pyx_t_1 = (__pyx_v_self->_data != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_data) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1106
+    /* "src/lxml/serializer.pxi":1111
  *         # we may have to resolve qnames in text content
  *         if self._data:
  *             self._flush()             # <<<<<<<<<<<<<<
  *         self._ns_stack[-1].append((uri, prefix))
  * 
  */
-    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1106, __pyx_L1_error)
+    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1111, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1105
+    /* "src/lxml/serializer.pxi":1110
  *             return
  *         # we may have to resolve qnames in text content
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -154463,7 +154591,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1107
+  /* "src/lxml/serializer.pxi":1112
  *         if self._data:
  *             self._flush()
  *         self._ns_stack[-1].append((uri, prefix))             # <<<<<<<<<<<<<<
@@ -154472,11 +154600,11 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
  */
   if (unlikely(__pyx_v_self->_ns_stack == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1107, __pyx_L1_error)
+    __PYX_ERR(9, 1112, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_ns_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1107, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_ns_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1112, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1107, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1112, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_uri);
   __Pyx_GIVEREF(__pyx_v_uri);
@@ -154484,11 +154612,11 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
   __Pyx_INCREF(__pyx_v_prefix);
   __Pyx_GIVEREF(__pyx_v_prefix);
   PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_prefix);
-  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 1107, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_t_3); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(9, 1112, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1101
+  /* "src/lxml/serializer.pxi":1106
  *             self._write(_escape_cdata_c14n(data))
  * 
  *     def start_ns(self, prefix, uri):             # <<<<<<<<<<<<<<
@@ -154510,7 +154638,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_7start_ns(struct __pyx
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1109
+/* "src/lxml/serializer.pxi":1114
  *         self._ns_stack[-1].append((uri, prefix))
  * 
  *     def start(self, tag, attrs):             # <<<<<<<<<<<<<<
@@ -154553,11 +154681,11 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_10start(PyObject *__py
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_attrs)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("start", 1, 2, 2, 1); __PYX_ERR(9, 1109, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("start", 1, 2, 2, 1); __PYX_ERR(9, 1114, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) __PYX_ERR(9, 1109, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "start") < 0)) __PYX_ERR(9, 1114, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -154570,7 +154698,7 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_10start(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1109, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("start", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1114, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.C14NWriterTarget.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -154597,7 +154725,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("start", 0);
 
-  /* "src/lxml/serializer.pxi":1110
+  /* "src/lxml/serializer.pxi":1115
  * 
  *     def start(self, tag, attrs):
  *         if self._exclude_tags is not None and (             # <<<<<<<<<<<<<<
@@ -154612,7 +154740,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
     goto __pyx_L4_bool_binop_done;
   }
 
-  /* "src/lxml/serializer.pxi":1111
+  /* "src/lxml/serializer.pxi":1116
  *     def start(self, tag, attrs):
  *         if self._exclude_tags is not None and (
  *                 self._ignored_depth or tag in self._exclude_tags):             # <<<<<<<<<<<<<<
@@ -154627,14 +154755,14 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
   }
   if (unlikely(__pyx_v_self->_exclude_tags == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(9, 1111, __pyx_L1_error)
+    __PYX_ERR(9, 1116, __pyx_L1_error)
   }
-  __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_self->_exclude_tags, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1111, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_self->_exclude_tags, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1116, __pyx_L1_error)
   __pyx_t_2 = (__pyx_t_3 != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
 
-  /* "src/lxml/serializer.pxi":1110
+  /* "src/lxml/serializer.pxi":1115
  * 
  *     def start(self, tag, attrs):
  *         if self._exclude_tags is not None and (             # <<<<<<<<<<<<<<
@@ -154643,7 +154771,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1112
+    /* "src/lxml/serializer.pxi":1117
  *         if self._exclude_tags is not None and (
  *                 self._ignored_depth or tag in self._exclude_tags):
  *             self._ignored_depth += 1             # <<<<<<<<<<<<<<
@@ -154652,7 +154780,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
     __pyx_v_self->_ignored_depth = (__pyx_v_self->_ignored_depth + 1);
 
-    /* "src/lxml/serializer.pxi":1113
+    /* "src/lxml/serializer.pxi":1118
  *                 self._ignored_depth or tag in self._exclude_tags):
  *             self._ignored_depth += 1
  *             return             # <<<<<<<<<<<<<<
@@ -154663,7 +154791,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1110
+    /* "src/lxml/serializer.pxi":1115
  * 
  *     def start(self, tag, attrs):
  *         if self._exclude_tags is not None and (             # <<<<<<<<<<<<<<
@@ -154672,7 +154800,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
   }
 
-  /* "src/lxml/serializer.pxi":1114
+  /* "src/lxml/serializer.pxi":1119
  *             self._ignored_depth += 1
  *             return
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -154682,18 +154810,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
   __pyx_t_1 = (__pyx_v_self->_data != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_data) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1115
+    /* "src/lxml/serializer.pxi":1120
  *             return
  *         if self._data:
  *             self._flush()             # <<<<<<<<<<<<<<
  * 
  *         new_namespaces = []
  */
-    __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1115, __pyx_L1_error)
+    __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1120, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1114
+    /* "src/lxml/serializer.pxi":1119
  *             self._ignored_depth += 1
  *             return
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -154702,19 +154830,19 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
   }
 
-  /* "src/lxml/serializer.pxi":1117
+  /* "src/lxml/serializer.pxi":1122
  *             self._flush()
  * 
  *         new_namespaces = []             # <<<<<<<<<<<<<<
  *         self._declared_ns_stack.append(new_namespaces)
  * 
  */
-  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1117, __pyx_L1_error)
+  __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1122, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_new_namespaces = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1118
+  /* "src/lxml/serializer.pxi":1123
  * 
  *         new_namespaces = []
  *         self._declared_ns_stack.append(new_namespaces)             # <<<<<<<<<<<<<<
@@ -154723,11 +154851,11 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
   if (unlikely(__pyx_v_self->_declared_ns_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(9, 1118, __pyx_L1_error)
+    __PYX_ERR(9, 1123, __pyx_L1_error)
   }
-  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_self->_declared_ns_stack, __pyx_v_new_namespaces); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(9, 1118, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_self->_declared_ns_stack, __pyx_v_new_namespaces); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(9, 1123, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1120
+  /* "src/lxml/serializer.pxi":1125
  *         self._declared_ns_stack.append(new_namespaces)
  * 
  *         if self._qname_aware_tags is not None and tag in self._qname_aware_tags:             # <<<<<<<<<<<<<<
@@ -154743,22 +154871,22 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
   }
   if (unlikely(__pyx_v_self->_qname_aware_tags == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(9, 1120, __pyx_L1_error)
+    __PYX_ERR(9, 1125, __pyx_L1_error)
   }
-  __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_self->_qname_aware_tags, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1120, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySet_ContainsTF(__pyx_v_tag, __pyx_v_self->_qname_aware_tags, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1125, __pyx_L1_error)
   __pyx_t_2 = (__pyx_t_3 != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L9_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1122
+    /* "src/lxml/serializer.pxi":1127
  *         if self._qname_aware_tags is not None and tag in self._qname_aware_tags:
  *             # Need to parse text first to see if it requires a prefix declaration.
  *             self._pending_start = (tag, attrs, new_namespaces)             # <<<<<<<<<<<<<<
  *             return
  *         self._start(tag, attrs, new_namespaces)
  */
-    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1122, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1127, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_v_tag);
     __Pyx_GIVEREF(__pyx_v_tag);
@@ -154775,7 +154903,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
     __pyx_v_self->_pending_start = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1123
+    /* "src/lxml/serializer.pxi":1128
  *             # Need to parse text first to see if it requires a prefix declaration.
  *             self._pending_start = (tag, attrs, new_namespaces)
  *             return             # <<<<<<<<<<<<<<
@@ -154786,7 +154914,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1120
+    /* "src/lxml/serializer.pxi":1125
  *         self._declared_ns_stack.append(new_namespaces)
  * 
  *         if self._qname_aware_tags is not None and tag in self._qname_aware_tags:             # <<<<<<<<<<<<<<
@@ -154795,18 +154923,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
  */
   }
 
-  /* "src/lxml/serializer.pxi":1124
+  /* "src/lxml/serializer.pxi":1129
  *             self._pending_start = (tag, attrs, new_namespaces)
  *             return
  *         self._start(tag, attrs, new_namespaces)             # <<<<<<<<<<<<<<
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):
  */
-  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_start(__pyx_v_self, __pyx_v_tag, __pyx_v_attrs, __pyx_v_new_namespaces, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1124, __pyx_L1_error)
+  __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_start(__pyx_v_self, __pyx_v_tag, __pyx_v_attrs, __pyx_v_new_namespaces, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1129, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1109
+  /* "src/lxml/serializer.pxi":1114
  *         self._ns_stack[-1].append((uri, prefix))
  * 
  *     def start(self, tag, attrs):             # <<<<<<<<<<<<<<
@@ -154828,7 +154956,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_9start(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1152
+/* "src/lxml/serializer.pxi":1157
  *         # Assign prefixes in lexicographical order of used URIs.
  *         parsed_qnames = {n: self._qname(n) for n in sorted(
  *             qnames, key=lambda n: n.split('}', 1))}             # <<<<<<<<<<<<<<
@@ -154860,9 +154988,9 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self,
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("lambda", 0);
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1152, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_n, __pyx_n_s_split); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1157, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1152, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1157, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_2;
@@ -154881,7 +155009,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self,
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1126
+/* "src/lxml/serializer.pxi":1131
  *         self._start(tag, attrs, new_namespaces)
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):             # <<<<<<<<<<<<<<
@@ -154938,7 +155066,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   }
   __Pyx_INCREF(__pyx_v_attrs);
 
-  /* "src/lxml/serializer.pxi":1127
+  /* "src/lxml/serializer.pxi":1132
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):
  *         if self._exclude_attrs is not None and attrs:             # <<<<<<<<<<<<<<
@@ -154952,12 +155080,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1127, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1132, __pyx_L1_error)
   __pyx_t_1 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1128
+    /* "src/lxml/serializer.pxi":1133
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):
  *         if self._exclude_attrs is not None and attrs:
  *             attrs = {k: v for k, v in attrs.items() if k not in self._exclude_attrs}             # <<<<<<<<<<<<<<
@@ -154965,9 +155093,9 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  *         qnames = {tag, *attrs}
  */
     { /* enter inner scope */
-      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1128, __pyx_L8_error)
+      __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1133, __pyx_L8_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1128, __pyx_L8_error)
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_items); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1133, __pyx_L8_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_7 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -154981,16 +155109,16 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       }
       __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1128, __pyx_L8_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1133, __pyx_L8_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_9 = NULL;
       } else {
-        __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1128, __pyx_L8_error)
+        __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1133, __pyx_L8_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1128, __pyx_L8_error)
+        __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1133, __pyx_L8_error)
       }
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       for (;;) {
@@ -154998,17 +155126,17 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           if (likely(PyList_CheckExact(__pyx_t_6))) {
             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_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1128, __pyx_L8_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(9, 1133, __pyx_L8_error)
             #else
-            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1128, __pyx_L8_error)
+            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1133, __pyx_L8_error)
             __Pyx_GOTREF(__pyx_t_5);
             #endif
           } else {
             if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) 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(9, 1128, __pyx_L8_error)
+            __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(9, 1133, __pyx_L8_error)
             #else
-            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1128, __pyx_L8_error)
+            __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1133, __pyx_L8_error)
             __Pyx_GOTREF(__pyx_t_5);
             #endif
           }
@@ -155018,7 +155146,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(9, 1128, __pyx_L8_error)
+              else __PYX_ERR(9, 1133, __pyx_L8_error)
             }
             break;
           }
@@ -155030,7 +155158,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           if (unlikely(size != 2)) {
             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            __PYX_ERR(9, 1128, __pyx_L8_error)
+            __PYX_ERR(9, 1133, __pyx_L8_error)
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
           if (likely(PyTuple_CheckExact(sequence))) {
@@ -155043,15 +155171,15 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           __Pyx_INCREF(__pyx_t_7);
           __Pyx_INCREF(__pyx_t_10);
           #else
-          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1128, __pyx_L8_error)
+          __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1133, __pyx_L8_error)
           __Pyx_GOTREF(__pyx_t_7);
-          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1128, __pyx_L8_error)
+          __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1133, __pyx_L8_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         } else {
           Py_ssize_t index = -1;
-          __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1128, __pyx_L8_error)
+          __pyx_t_11 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1133, __pyx_L8_error)
           __Pyx_GOTREF(__pyx_t_11);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -155059,7 +155187,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           __Pyx_GOTREF(__pyx_t_7);
           index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L11_unpacking_failed;
           __Pyx_GOTREF(__pyx_t_10);
-          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(9, 1128, __pyx_L8_error)
+          if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(9, 1133, __pyx_L8_error)
           __pyx_t_12 = NULL;
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           goto __pyx_L12_unpacking_done;
@@ -155067,7 +155195,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
           __pyx_t_12 = NULL;
           if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-          __PYX_ERR(9, 1128, __pyx_L8_error)
+          __PYX_ERR(9, 1133, __pyx_L8_error)
           __pyx_L12_unpacking_done:;
         }
         __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_k, __pyx_t_7);
@@ -155076,12 +155204,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __pyx_t_10 = 0;
         if (unlikely(__pyx_v_self->_exclude_attrs == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-          __PYX_ERR(9, 1128, __pyx_L8_error)
+          __PYX_ERR(9, 1133, __pyx_L8_error)
         }
-        __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_8genexpr1__pyx_v_k, __pyx_v_self->_exclude_attrs, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1128, __pyx_L8_error)
+        __pyx_t_1 = (__Pyx_PySet_ContainsTF(__pyx_8genexpr1__pyx_v_k, __pyx_v_self->_exclude_attrs, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1133, __pyx_L8_error)
         __pyx_t_3 = (__pyx_t_1 != 0);
         if (__pyx_t_3) {
-          if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_8genexpr1__pyx_v_k, (PyObject*)__pyx_8genexpr1__pyx_v_v))) __PYX_ERR(9, 1128, __pyx_L8_error)
+          if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_8genexpr1__pyx_v_k, (PyObject*)__pyx_8genexpr1__pyx_v_v))) __PYX_ERR(9, 1133, __pyx_L8_error)
         }
       }
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -155097,7 +155225,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __Pyx_DECREF_SET(__pyx_v_attrs, __pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1127
+    /* "src/lxml/serializer.pxi":1132
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):
  *         if self._exclude_attrs is not None and attrs:             # <<<<<<<<<<<<<<
@@ -155106,39 +155234,39 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1130
+  /* "src/lxml/serializer.pxi":1135
  *             attrs = {k: v for k, v in attrs.items() if k not in self._exclude_attrs}
  * 
  *         qnames = {tag, *attrs}             # <<<<<<<<<<<<<<
  *         resolved_names = {}
  * 
  */
-  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1130, __pyx_L1_error)
+  __pyx_t_6 = PySet_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1135, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  if (PySet_Add(__pyx_t_6, __pyx_v_tag) < 0) __PYX_ERR(9, 1130, __pyx_L1_error)
+  if (PySet_Add(__pyx_t_6, __pyx_v_tag) < 0) __PYX_ERR(9, 1135, __pyx_L1_error)
   __pyx_t_4 = __pyx_t_6;
   __pyx_t_6 = 0;
   if (unlikely(__pyx_v_attrs == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "argument after * must be an iterable, not NoneType");
-    __PYX_ERR(9, 1130, __pyx_L1_error)
+    __PYX_ERR(9, 1135, __pyx_L1_error)
   }
-  if (__Pyx_PySet_Update(__pyx_t_4, __pyx_v_attrs) < 0) __PYX_ERR(9, 1130, __pyx_L1_error)
+  if (__Pyx_PySet_Update(__pyx_t_4, __pyx_v_attrs) < 0) __PYX_ERR(9, 1135, __pyx_L1_error)
   __pyx_v_qnames = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1131
+  /* "src/lxml/serializer.pxi":1136
  * 
  *         qnames = {tag, *attrs}
  *         resolved_names = {}             # <<<<<<<<<<<<<<
  * 
  *         # Resolve prefixes in attribute and tag text.
  */
-  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1131, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1136, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_resolved_names = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1134
+  /* "src/lxml/serializer.pxi":1139
  * 
  *         # Resolve prefixes in attribute and tag text.
  *         if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -155149,30 +155277,30 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_t_1 = (__pyx_t_3 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1135
+    /* "src/lxml/serializer.pxi":1140
  *         # Resolve prefixes in attribute and tag text.
  *         if qname_text is not None:
  *             qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text)             # <<<<<<<<<<<<<<
  *             qnames.add(qname)
  *         if self._find_qname_aware_attrs is not None and attrs:
  */
-    __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_resolve_prefix_name(__pyx_v_self, __pyx_v_qname_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1135, __pyx_L1_error)
+    __pyx_t_4 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_resolve_prefix_name(__pyx_v_self, __pyx_v_qname_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1140, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_t_4);
     __pyx_v_qname = __pyx_t_4;
-    if (unlikely(PyDict_SetItem(__pyx_v_resolved_names, __pyx_v_qname_text, __pyx_t_4) < 0)) __PYX_ERR(9, 1135, __pyx_L1_error)
+    if (unlikely(PyDict_SetItem(__pyx_v_resolved_names, __pyx_v_qname_text, __pyx_t_4) < 0)) __PYX_ERR(9, 1140, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1136
+    /* "src/lxml/serializer.pxi":1141
  *         if qname_text is not None:
  *             qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text)
  *             qnames.add(qname)             # <<<<<<<<<<<<<<
  *         if self._find_qname_aware_attrs is not None and attrs:
  *             qattrs = self._find_qname_aware_attrs(attrs)
  */
-    __pyx_t_13 = PySet_Add(__pyx_v_qnames, __pyx_v_qname); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1136, __pyx_L1_error)
+    __pyx_t_13 = PySet_Add(__pyx_v_qnames, __pyx_v_qname); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1141, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1134
+    /* "src/lxml/serializer.pxi":1139
  * 
  *         # Resolve prefixes in attribute and tag text.
  *         if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -155181,7 +155309,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1137
+  /* "src/lxml/serializer.pxi":1142
  *             qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text)
  *             qnames.add(qname)
  *         if self._find_qname_aware_attrs is not None and attrs:             # <<<<<<<<<<<<<<
@@ -155195,12 +155323,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __pyx_t_1 = __pyx_t_2;
     goto __pyx_L17_bool_binop_done;
   }
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1137, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1142, __pyx_L1_error)
   __pyx_t_1 = __pyx_t_2;
   __pyx_L17_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1138
+    /* "src/lxml/serializer.pxi":1143
  *             qnames.add(qname)
  *         if self._find_qname_aware_attrs is not None and attrs:
  *             qattrs = self._find_qname_aware_attrs(attrs)             # <<<<<<<<<<<<<<
@@ -155220,23 +155348,23 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     }
     __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_5, __pyx_v_attrs) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_attrs);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1138, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1143, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_v_qattrs = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1139
+    /* "src/lxml/serializer.pxi":1144
  *         if self._find_qname_aware_attrs is not None and attrs:
  *             qattrs = self._find_qname_aware_attrs(attrs)
  *             if qattrs:             # <<<<<<<<<<<<<<
  *                 for attr_name in qattrs:
  *                     value = attrs[attr_name]
  */
-    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_qattrs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1139, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_qattrs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1144, __pyx_L1_error)
     if (__pyx_t_1) {
 
-      /* "src/lxml/serializer.pxi":1140
+      /* "src/lxml/serializer.pxi":1145
  *             qattrs = self._find_qname_aware_attrs(attrs)
  *             if qattrs:
  *                 for attr_name in qattrs:             # <<<<<<<<<<<<<<
@@ -155247,26 +155375,26 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __pyx_t_4 = __pyx_v_qattrs; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
         __pyx_t_9 = NULL;
       } else {
-        __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_qattrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1140, __pyx_L1_error)
+        __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_qattrs); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1145, __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(9, 1140, __pyx_L1_error)
+        __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1145, __pyx_L1_error)
       }
       for (;;) {
         if (likely(!__pyx_t_9)) {
           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_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1140, __pyx_L1_error)
+            __pyx_t_6 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1145, __pyx_L1_error)
             #else
-            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1140, __pyx_L1_error)
+            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1145, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             #endif
           } else {
             if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
             #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1140, __pyx_L1_error)
+            __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_6); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1145, __pyx_L1_error)
             #else
-            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1140, __pyx_L1_error)
+            __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1145, __pyx_L1_error)
             __Pyx_GOTREF(__pyx_t_6);
             #endif
           }
@@ -155276,7 +155404,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
             PyObject* exc_type = PyErr_Occurred();
             if (exc_type) {
               if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-              else __PYX_ERR(9, 1140, __pyx_L1_error)
+              else __PYX_ERR(9, 1145, __pyx_L1_error)
             }
             break;
           }
@@ -155285,19 +155413,19 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_XDECREF_SET(__pyx_v_attr_name, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "src/lxml/serializer.pxi":1141
+        /* "src/lxml/serializer.pxi":1146
  *             if qattrs:
  *                 for attr_name in qattrs:
  *                     value = attrs[attr_name]             # <<<<<<<<<<<<<<
  *                     if _looks_like_prefix_name(value):
  *                         qname = resolved_names[value] = self._resolve_prefix_name(value)
  */
-        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_attrs, __pyx_v_attr_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1141, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_attrs, __pyx_v_attr_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1146, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "src/lxml/serializer.pxi":1142
+        /* "src/lxml/serializer.pxi":1147
  *                 for attr_name in qattrs:
  *                     value = attrs[attr_name]
  *                     if _looks_like_prefix_name(value):             # <<<<<<<<<<<<<<
@@ -155317,37 +155445,37 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         }
         __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_10, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1142, __pyx_L1_error)
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1147, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1142, __pyx_L1_error)
+        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1147, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         if (__pyx_t_1) {
 
-          /* "src/lxml/serializer.pxi":1143
+          /* "src/lxml/serializer.pxi":1148
  *                     value = attrs[attr_name]
  *                     if _looks_like_prefix_name(value):
  *                         qname = resolved_names[value] = self._resolve_prefix_name(value)             # <<<<<<<<<<<<<<
  *                         qnames.add(qname)
  *             else:
  */
-          __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_resolve_prefix_name(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1143, __pyx_L1_error)
+          __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_resolve_prefix_name(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1148, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_INCREF(__pyx_t_6);
           __Pyx_XDECREF_SET(__pyx_v_qname, __pyx_t_6);
-          if (unlikely(PyDict_SetItem(__pyx_v_resolved_names, __pyx_v_value, __pyx_t_6) < 0)) __PYX_ERR(9, 1143, __pyx_L1_error)
+          if (unlikely(PyDict_SetItem(__pyx_v_resolved_names, __pyx_v_value, __pyx_t_6) < 0)) __PYX_ERR(9, 1148, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-          /* "src/lxml/serializer.pxi":1144
+          /* "src/lxml/serializer.pxi":1149
  *                     if _looks_like_prefix_name(value):
  *                         qname = resolved_names[value] = self._resolve_prefix_name(value)
  *                         qnames.add(qname)             # <<<<<<<<<<<<<<
  *             else:
  *                 qattrs = None
  */
-          __pyx_t_13 = PySet_Add(__pyx_v_qnames, __pyx_v_qname); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1144, __pyx_L1_error)
+          __pyx_t_13 = PySet_Add(__pyx_v_qnames, __pyx_v_qname); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1149, __pyx_L1_error)
 
-          /* "src/lxml/serializer.pxi":1142
+          /* "src/lxml/serializer.pxi":1147
  *                 for attr_name in qattrs:
  *                     value = attrs[attr_name]
  *                     if _looks_like_prefix_name(value):             # <<<<<<<<<<<<<<
@@ -155356,7 +155484,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
         }
 
-        /* "src/lxml/serializer.pxi":1140
+        /* "src/lxml/serializer.pxi":1145
  *             qattrs = self._find_qname_aware_attrs(attrs)
  *             if qattrs:
  *                 for attr_name in qattrs:             # <<<<<<<<<<<<<<
@@ -155366,7 +155494,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       }
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "src/lxml/serializer.pxi":1139
+      /* "src/lxml/serializer.pxi":1144
  *         if self._find_qname_aware_attrs is not None and attrs:
  *             qattrs = self._find_qname_aware_attrs(attrs)
  *             if qattrs:             # <<<<<<<<<<<<<<
@@ -155376,7 +155504,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       goto __pyx_L19;
     }
 
-    /* "src/lxml/serializer.pxi":1146
+    /* "src/lxml/serializer.pxi":1151
  *                         qnames.add(qname)
  *             else:
  *                 qattrs = None             # <<<<<<<<<<<<<<
@@ -155389,7 +155517,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     }
     __pyx_L19:;
 
-    /* "src/lxml/serializer.pxi":1137
+    /* "src/lxml/serializer.pxi":1142
  *             qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text)
  *             qnames.add(qname)
  *         if self._find_qname_aware_attrs is not None and attrs:             # <<<<<<<<<<<<<<
@@ -155399,7 +155527,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     goto __pyx_L16;
   }
 
-  /* "src/lxml/serializer.pxi":1148
+  /* "src/lxml/serializer.pxi":1153
  *                 qattrs = None
  *         else:
  *             qattrs = None             # <<<<<<<<<<<<<<
@@ -155412,7 +155540,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   }
   __pyx_L16:;
 
-  /* "src/lxml/serializer.pxi":1151
+  /* "src/lxml/serializer.pxi":1156
  * 
  *         # Assign prefixes in lexicographical order of used URIs.
  *         parsed_qnames = {n: self._qname(n) for n in sorted(             # <<<<<<<<<<<<<<
@@ -155420,36 +155548,36 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  * 
  */
   { /* enter inner scope */
-    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1151, __pyx_L25_error)
+    __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1156, __pyx_L25_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "src/lxml/serializer.pxi":1152
+    /* "src/lxml/serializer.pxi":1157
  *         # Assign prefixes in lexicographical order of used URIs.
  *         parsed_qnames = {n: self._qname(n) for n in sorted(
  *             qnames, key=lambda n: n.split('}', 1))}             # <<<<<<<<<<<<<<
  * 
  *         # Write namespace declarations in prefix order ...
  */
-    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1151, __pyx_L25_error)
+    __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1156, __pyx_L25_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_INCREF(__pyx_v_qnames);
     __Pyx_GIVEREF(__pyx_v_qnames);
     PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_qnames);
-    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1152, __pyx_L25_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1157, __pyx_L25_error)
     __Pyx_GOTREF(__pyx_t_5);
-    __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_6_start_8genexpr2_lambda, 0, __pyx_n_s_C14NWriterTarget__start_locals_l, NULL, __pyx_n_s_lxml_etree, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1152, __pyx_L25_error)
+    __pyx_t_10 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_6_start_8genexpr2_lambda, 0, __pyx_n_s_C14NWriterTarget__start_locals_l, NULL, __pyx_n_s_lxml_etree, __pyx_d, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1157, __pyx_L25_error)
     __Pyx_GOTREF(__pyx_t_10);
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(9, 1152, __pyx_L25_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, __pyx_t_10) < 0) __PYX_ERR(9, 1157, __pyx_L25_error)
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
 
-    /* "src/lxml/serializer.pxi":1151
+    /* "src/lxml/serializer.pxi":1156
  * 
  *         # Assign prefixes in lexicographical order of used URIs.
  *         parsed_qnames = {n: self._qname(n) for n in sorted(             # <<<<<<<<<<<<<<
  *             qnames, key=lambda n: n.split('}', 1))}
  * 
  */
-    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1151, __pyx_L25_error)
+    __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_sorted, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1156, __pyx_L25_error)
     __Pyx_GOTREF(__pyx_t_10);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -155457,9 +155585,9 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __pyx_t_5 = __pyx_t_10; __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_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1151, __pyx_L25_error)
+      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1156, __pyx_L25_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1151, __pyx_L25_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1156, __pyx_L25_error)
     }
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     for (;;) {
@@ -155467,17 +155595,17 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         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_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1151, __pyx_L25_error)
+          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1156, __pyx_L25_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1151, __pyx_L25_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1156, __pyx_L25_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1151, __pyx_L25_error)
+          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1156, __pyx_L25_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1151, __pyx_L25_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1156, __pyx_L25_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         }
@@ -155487,7 +155615,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(9, 1151, __pyx_L25_error)
+            else __PYX_ERR(9, 1156, __pyx_L25_error)
           }
           break;
         }
@@ -155495,9 +155623,9 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       }
       __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_n, __pyx_t_10);
       __pyx_t_10 = 0;
-      __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_qname(__pyx_v_self, __pyx_8genexpr2__pyx_v_n, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1151, __pyx_L25_error)
+      __pyx_t_10 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_qname(__pyx_v_self, __pyx_8genexpr2__pyx_v_n, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1156, __pyx_L25_error)
       __Pyx_GOTREF(__pyx_t_10);
-      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_n, (PyObject*)__pyx_t_10))) __PYX_ERR(9, 1151, __pyx_L25_error)
+      if (unlikely(PyDict_SetItem(__pyx_t_4, (PyObject*)__pyx_8genexpr2__pyx_v_n, (PyObject*)__pyx_t_10))) __PYX_ERR(9, 1156, __pyx_L25_error)
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -155511,27 +155639,27 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_v_parsed_qnames = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1155
+  /* "src/lxml/serializer.pxi":1160
  * 
  *         # Write namespace declarations in prefix order ...
  *         if new_namespaces:             # <<<<<<<<<<<<<<
  *             attr_list = [
  *                 (u'xmlns:' + prefix if prefix else u'xmlns', uri)
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_new_namespaces); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1155, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_new_namespaces); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1160, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1156
+    /* "src/lxml/serializer.pxi":1161
  *         # Write namespace declarations in prefix order ...
  *         if new_namespaces:
  *             attr_list = [             # <<<<<<<<<<<<<<
  *                 (u'xmlns:' + prefix if prefix else u'xmlns', uri)
  *                 for uri, prefix in new_namespaces
  */
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1156, __pyx_L1_error)
+    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1161, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "src/lxml/serializer.pxi":1158
+    /* "src/lxml/serializer.pxi":1163
  *             attr_list = [
  *                 (u'xmlns:' + prefix if prefix else u'xmlns', uri)
  *                 for uri, prefix in new_namespaces             # <<<<<<<<<<<<<<
@@ -155542,26 +155670,26 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __pyx_t_5 = __pyx_v_new_namespaces; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
       __pyx_t_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_new_namespaces); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1158, __pyx_L1_error)
+      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_new_namespaces); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1163, __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(9, 1158, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1163, __pyx_L1_error)
     }
     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_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1158, __pyx_L1_error)
+          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1163, __pyx_L1_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1158, __pyx_L1_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1163, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1158, __pyx_L1_error)
+          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1163, __pyx_L1_error)
           #else
-          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1158, __pyx_L1_error)
+          __pyx_t_10 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1163, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_10);
           #endif
         }
@@ -155571,7 +155699,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(9, 1158, __pyx_L1_error)
+            else __PYX_ERR(9, 1163, __pyx_L1_error)
           }
           break;
         }
@@ -155583,7 +155711,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1158, __pyx_L1_error)
+          __PYX_ERR(9, 1163, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -155596,15 +155724,15 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(__pyx_t_7);
         #else
-        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1158, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1163, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1158, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1163, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1158, __pyx_L1_error)
+        __pyx_t_11 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1163, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -155612,7 +155740,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_GOTREF(__pyx_t_6);
         index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_7)) goto __pyx_L32_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_7);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(9, 1158, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(9, 1163, __pyx_L1_error)
         __pyx_t_12 = NULL;
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         goto __pyx_L33_unpacking_done;
@@ -155620,7 +155748,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         __pyx_t_12 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1158, __pyx_L1_error)
+        __PYX_ERR(9, 1163, __pyx_L1_error)
         __pyx_L33_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_uri, __pyx_t_6);
@@ -155628,16 +155756,16 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_7);
       __pyx_t_7 = 0;
 
-      /* "src/lxml/serializer.pxi":1157
+      /* "src/lxml/serializer.pxi":1162
  *         if new_namespaces:
  *             attr_list = [
  *                 (u'xmlns:' + prefix if prefix else u'xmlns', uri)             # <<<<<<<<<<<<<<
  *                 for uri, prefix in new_namespaces
  *             ]
  */
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1157, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1162, __pyx_L1_error)
       if (__pyx_t_1) {
-        __pyx_t_7 = PyNumber_Add(__pyx_kp_u_xmlns, __pyx_v_prefix); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1157, __pyx_L1_error)
+        __pyx_t_7 = PyNumber_Add(__pyx_kp_u_xmlns, __pyx_v_prefix); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1162, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __pyx_t_10 = __pyx_t_7;
         __pyx_t_7 = 0;
@@ -155645,7 +155773,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_n_u_xmlns_2);
         __pyx_t_10 = __pyx_n_u_xmlns_2;
       }
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1157, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1162, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_10);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_10);
@@ -155653,10 +155781,10 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __Pyx_GIVEREF(__pyx_v_uri);
       PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_uri);
       __pyx_t_10 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(9, 1156, __pyx_L1_error)
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_7))) __PYX_ERR(9, 1161, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-      /* "src/lxml/serializer.pxi":1158
+      /* "src/lxml/serializer.pxi":1163
  *             attr_list = [
  *                 (u'xmlns:' + prefix if prefix else u'xmlns', uri)
  *                 for uri, prefix in new_namespaces             # <<<<<<<<<<<<<<
@@ -155668,16 +155796,16 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __pyx_v_attr_list = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1160
+    /* "src/lxml/serializer.pxi":1165
  *                 for uri, prefix in new_namespaces
  *             ]
  *             attr_list.sort()             # <<<<<<<<<<<<<<
  *         else:
  *             # almost always empty
  */
-    __pyx_t_13 = PyList_Sort(__pyx_v_attr_list); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1160, __pyx_L1_error)
+    __pyx_t_13 = PyList_Sort(__pyx_v_attr_list); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1165, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1155
+    /* "src/lxml/serializer.pxi":1160
  * 
  *         # Write namespace declarations in prefix order ...
  *         if new_namespaces:             # <<<<<<<<<<<<<<
@@ -155687,7 +155815,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     goto __pyx_L29;
   }
 
-  /* "src/lxml/serializer.pxi":1163
+  /* "src/lxml/serializer.pxi":1168
  *         else:
  *             # almost always empty
  *             attr_list = []             # <<<<<<<<<<<<<<
@@ -155695,31 +155823,31 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  *         # ... followed by attributes in URI+name order
  */
   /*else*/ {
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1163, __pyx_L1_error)
+    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1168, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_attr_list = ((PyObject*)__pyx_t_4);
     __pyx_t_4 = 0;
   }
   __pyx_L29:;
 
-  /* "src/lxml/serializer.pxi":1166
+  /* "src/lxml/serializer.pxi":1171
  * 
  *         # ... followed by attributes in URI+name order
  *         if attrs:             # <<<<<<<<<<<<<<
  *             for k, v in sorted(attrs.items()):
  *                 if qattrs is not None and k in qattrs and v in resolved_names:
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1166, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_attrs); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1171, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1167
+    /* "src/lxml/serializer.pxi":1172
  *         # ... followed by attributes in URI+name order
  *         if attrs:
  *             for k, v in sorted(attrs.items()):             # <<<<<<<<<<<<<<
  *                 if qattrs is not None and k in qattrs and v in resolved_names:
  *                     v = parsed_qnames[resolved_names[v]][0]
  */
-    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1167, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_items); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1172, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_10 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -155733,27 +155861,27 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     }
     __pyx_t_5 = (__pyx_t_10) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_10) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1167, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1172, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __pyx_t_7 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1167, __pyx_L1_error)
+    __pyx_t_7 = PySequence_List(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1172, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_4 = ((PyObject*)__pyx_t_7);
     __pyx_t_7 = 0;
-    __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1167, __pyx_L1_error)
+    __pyx_t_13 = PyList_Sort(__pyx_t_4); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1172, __pyx_L1_error)
     if (unlikely(__pyx_t_4 == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-      __PYX_ERR(9, 1167, __pyx_L1_error)
+      __PYX_ERR(9, 1172, __pyx_L1_error)
     }
     __pyx_t_7 = __pyx_t_4; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
       if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1167, __pyx_L1_error)
+      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1172, __pyx_L1_error)
       #else
-      __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1167, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1172, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       #endif
       if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
@@ -155762,7 +155890,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1167, __pyx_L1_error)
+          __PYX_ERR(9, 1172, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -155775,15 +155903,15 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_t_5);
         __Pyx_INCREF(__pyx_t_10);
         #else
-        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1167, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1172, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1167, __pyx_L1_error)
+        __pyx_t_10 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1172, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         #endif
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1167, __pyx_L1_error)
+        __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1172, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __pyx_t_12 = Py_TYPE(__pyx_t_6)->tp_iternext;
@@ -155791,7 +155919,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_GOTREF(__pyx_t_5);
         index = 1; __pyx_t_10 = __pyx_t_12(__pyx_t_6); if (unlikely(!__pyx_t_10)) goto __pyx_L37_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_10);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_6), 2) < 0) __PYX_ERR(9, 1167, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_6), 2) < 0) __PYX_ERR(9, 1172, __pyx_L1_error)
         __pyx_t_12 = NULL;
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         goto __pyx_L38_unpacking_done;
@@ -155799,7 +155927,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __pyx_t_12 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1167, __pyx_L1_error)
+        __PYX_ERR(9, 1172, __pyx_L1_error)
         __pyx_L38_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
@@ -155807,7 +155935,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_10);
       __pyx_t_10 = 0;
 
-      /* "src/lxml/serializer.pxi":1168
+      /* "src/lxml/serializer.pxi":1173
  *         if attrs:
  *             for k, v in sorted(attrs.items()):
  *                 if qattrs is not None and k in qattrs and v in resolved_names:             # <<<<<<<<<<<<<<
@@ -155821,38 +155949,38 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __pyx_t_1 = __pyx_t_3;
         goto __pyx_L40_bool_binop_done;
       }
-      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_qattrs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1168, __pyx_L1_error)
+      __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_v_k, __pyx_v_qattrs, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1173, __pyx_L1_error)
       __pyx_t_2 = (__pyx_t_3 != 0);
       if (__pyx_t_2) {
       } else {
         __pyx_t_1 = __pyx_t_2;
         goto __pyx_L40_bool_binop_done;
       }
-      __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_v, __pyx_v_resolved_names, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1168, __pyx_L1_error)
+      __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_v, __pyx_v_resolved_names, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1173, __pyx_L1_error)
       __pyx_t_3 = (__pyx_t_2 != 0);
       __pyx_t_1 = __pyx_t_3;
       __pyx_L40_bool_binop_done:;
       if (__pyx_t_1) {
 
-        /* "src/lxml/serializer.pxi":1169
+        /* "src/lxml/serializer.pxi":1174
  *             for k, v in sorted(attrs.items()):
  *                 if qattrs is not None and k in qattrs and v in resolved_names:
  *                     v = parsed_qnames[resolved_names[v]][0]             # <<<<<<<<<<<<<<
  *                 attr_qname, attr_name, uri = parsed_qnames[k]
  *                 # No prefix for attributes in default ('') namespace.
  */
-        __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_resolved_names, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1169, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_resolved_names, __pyx_v_v); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1174, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1169, __pyx_L1_error)
+        __pyx_t_10 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1174, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1169, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_10, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1174, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_DECREF_SET(__pyx_v_v, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1168
+        /* "src/lxml/serializer.pxi":1173
  *         if attrs:
  *             for k, v in sorted(attrs.items()):
  *                 if qattrs is not None and k in qattrs and v in resolved_names:             # <<<<<<<<<<<<<<
@@ -155861,14 +155989,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
       }
 
-      /* "src/lxml/serializer.pxi":1170
+      /* "src/lxml/serializer.pxi":1175
  *                 if qattrs is not None and k in qattrs and v in resolved_names:
  *                     v = parsed_qnames[resolved_names[v]][0]
  *                 attr_qname, attr_name, uri = parsed_qnames[k]             # <<<<<<<<<<<<<<
  *                 # No prefix for attributes in default ('') namespace.
  *                 attr_list.append((attr_qname if uri else attr_name, v))
  */
-      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1170, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_v_k); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1175, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
         PyObject* sequence = __pyx_t_4;
@@ -155876,7 +156004,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         if (unlikely(size != 3)) {
           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1170, __pyx_L1_error)
+          __PYX_ERR(9, 1175, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -155892,17 +156020,17 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_t_5);
         __Pyx_INCREF(__pyx_t_6);
         #else
-        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1170, __pyx_L1_error)
+        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1175, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1170, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1175, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1170, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1175, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         #endif
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1170, __pyx_L1_error)
+        __pyx_t_11 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1175, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
@@ -155912,7 +156040,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_GOTREF(__pyx_t_5);
         index = 2; __pyx_t_6 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_6)) goto __pyx_L43_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_6);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(9, 1170, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(9, 1175, __pyx_L1_error)
         __pyx_t_12 = NULL;
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         goto __pyx_L44_unpacking_done;
@@ -155920,7 +156048,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         __pyx_t_12 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1170, __pyx_L1_error)
+        __PYX_ERR(9, 1175, __pyx_L1_error)
         __pyx_L44_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_attr_qname, __pyx_t_10);
@@ -155930,14 +156058,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __Pyx_XDECREF_SET(__pyx_v_uri, __pyx_t_6);
       __pyx_t_6 = 0;
 
-      /* "src/lxml/serializer.pxi":1172
+      /* "src/lxml/serializer.pxi":1177
  *                 attr_qname, attr_name, uri = parsed_qnames[k]
  *                 # No prefix for attributes in default ('') namespace.
  *                 attr_list.append((attr_qname if uri else attr_name, v))             # <<<<<<<<<<<<<<
  * 
  *         # Honour xml:space attributes.
  */
-      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_uri); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1172, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_uri); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1177, __pyx_L1_error)
       if (__pyx_t_1) {
         __Pyx_INCREF(__pyx_v_attr_qname);
         __pyx_t_4 = __pyx_v_attr_qname;
@@ -155945,7 +156073,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_v_attr_name);
         __pyx_t_4 = __pyx_v_attr_name;
       }
-      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1172, __pyx_L1_error)
+      __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1177, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GIVEREF(__pyx_t_4);
       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
@@ -155953,10 +156081,10 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __Pyx_GIVEREF(__pyx_v_v);
       PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_v);
       __pyx_t_4 = 0;
-      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_attr_list, __pyx_t_6); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1172, __pyx_L1_error)
+      __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_attr_list, __pyx_t_6); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1177, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "src/lxml/serializer.pxi":1167
+      /* "src/lxml/serializer.pxi":1172
  *         # ... followed by attributes in URI+name order
  *         if attrs:
  *             for k, v in sorted(attrs.items()):             # <<<<<<<<<<<<<<
@@ -155966,7 +156094,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "src/lxml/serializer.pxi":1166
+    /* "src/lxml/serializer.pxi":1171
  * 
  *         # ... followed by attributes in URI+name order
  *         if attrs:             # <<<<<<<<<<<<<<
@@ -155975,14 +156103,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1175
+  /* "src/lxml/serializer.pxi":1180
  * 
  *         # Honour xml:space attributes.
  *         space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space')             # <<<<<<<<<<<<<<
  *         self._preserve_space.append(
  *             space_behaviour == 'preserve' if space_behaviour
  */
-  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1175, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_attrs, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1180, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __pyx_t_4 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -155996,13 +156124,13 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   }
   __pyx_t_7 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_4, __pyx_kp_s_http_www_w3_org_XML_1998_namesp) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s_http_www_w3_org_XML_1998_namesp);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1175, __pyx_L1_error)
+  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1180, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_v_space_behaviour = __pyx_t_7;
   __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1176
+  /* "src/lxml/serializer.pxi":1181
  *         # Honour xml:space attributes.
  *         space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space')
  *         self._preserve_space.append(             # <<<<<<<<<<<<<<
@@ -156011,24 +156139,24 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_preserve_space == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(9, 1176, __pyx_L1_error)
+    __PYX_ERR(9, 1181, __pyx_L1_error)
   }
 
-  /* "src/lxml/serializer.pxi":1177
+  /* "src/lxml/serializer.pxi":1182
  *         space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space')
  *         self._preserve_space.append(
  *             space_behaviour == 'preserve' if space_behaviour             # <<<<<<<<<<<<<<
  *             else self._preserve_space[-1])
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_space_behaviour); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1177, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_space_behaviour); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1182, __pyx_L1_error)
   if (__pyx_t_1) {
-    __pyx_t_6 = PyObject_RichCompare(__pyx_v_space_behaviour, __pyx_n_s_preserve, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1177, __pyx_L1_error)
+    __pyx_t_6 = PyObject_RichCompare(__pyx_v_space_behaviour, __pyx_n_s_preserve, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1182, __pyx_L1_error)
     __pyx_t_7 = __pyx_t_6;
     __pyx_t_6 = 0;
   } else {
 
-    /* "src/lxml/serializer.pxi":1178
+    /* "src/lxml/serializer.pxi":1183
  *         self._preserve_space.append(
  *             space_behaviour == 'preserve' if space_behaviour
  *             else self._preserve_space[-1])             # <<<<<<<<<<<<<<
@@ -156037,25 +156165,25 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
     if (unlikely(__pyx_v_self->_preserve_space == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(9, 1178, __pyx_L1_error)
+      __PYX_ERR(9, 1183, __pyx_L1_error)
     }
-    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_preserve_space, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1178, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_preserve_space, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1183, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = __pyx_t_6;
     __pyx_t_6 = 0;
   }
 
-  /* "src/lxml/serializer.pxi":1176
+  /* "src/lxml/serializer.pxi":1181
  *         # Honour xml:space attributes.
  *         space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space')
  *         self._preserve_space.append(             # <<<<<<<<<<<<<<
  *             space_behaviour == 'preserve' if space_behaviour
  *             else self._preserve_space[-1])
  */
-  __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_self->_preserve_space, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1176, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_self->_preserve_space, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1181, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1181
+  /* "src/lxml/serializer.pxi":1186
  * 
  *         # Write the tag.
  *         write = self._write             # <<<<<<<<<<<<<<
@@ -156067,19 +156195,19 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_v_write = __pyx_t_7;
   __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1182
+  /* "src/lxml/serializer.pxi":1187
  *         # Write the tag.
  *         write = self._write
  *         write(u'<' + parsed_qnames[tag][0])             # <<<<<<<<<<<<<<
  *         if attr_list:
  *             write(u''.join([f' {k}="{_escape_attrib_c14n(v)}"' for k, v in attr_list]))
  */
-  __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_v_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1182, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_v_tag); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1182, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = PyNumber_Add(__pyx_kp_u__70, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1182, __pyx_L1_error)
+  __pyx_t_6 = PyNumber_Add(__pyx_kp_u__70, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_INCREF(__pyx_v_write);
@@ -156096,12 +156224,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_t_7 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1182, __pyx_L1_error)
+  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1183
+  /* "src/lxml/serializer.pxi":1188
  *         write = self._write
  *         write(u'<' + parsed_qnames[tag][0])
  *         if attr_list:             # <<<<<<<<<<<<<<
@@ -156111,22 +156239,22 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_t_1 = (PyList_GET_SIZE(__pyx_v_attr_list) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1184
+    /* "src/lxml/serializer.pxi":1189
  *         write(u'<' + parsed_qnames[tag][0])
  *         if attr_list:
  *             write(u''.join([f' {k}="{_escape_attrib_c14n(v)}"' for k, v in attr_list]))             # <<<<<<<<<<<<<<
  *         write(u'>')
  * 
  */
-    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1184, __pyx_L1_error)
+    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1189, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_6 = __pyx_v_attr_list; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
     for (;;) {
       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_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(9, 1184, __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(9, 1189, __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(9, 1184, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       #endif
       if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
@@ -156135,7 +156263,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1184, __pyx_L1_error)
+          __PYX_ERR(9, 1189, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -156148,15 +156276,15 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_INCREF(__pyx_t_10);
         __Pyx_INCREF(__pyx_t_11);
         #else
-        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1184, __pyx_L1_error)
+        __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1189, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
-        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1184, __pyx_L1_error)
+        __pyx_t_11 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1189, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         #endif
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 1184, __pyx_L1_error)
+        __pyx_t_14 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(9, 1189, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_14);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_t_12 = Py_TYPE(__pyx_t_14)->tp_iternext;
@@ -156164,7 +156292,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_GOTREF(__pyx_t_10);
         index = 1; __pyx_t_11 = __pyx_t_12(__pyx_t_14); if (unlikely(!__pyx_t_11)) goto __pyx_L48_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_11);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_14), 2) < 0) __PYX_ERR(9, 1184, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_14), 2) < 0) __PYX_ERR(9, 1189, __pyx_L1_error)
         __pyx_t_12 = NULL;
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
         goto __pyx_L49_unpacking_done;
@@ -156172,14 +156300,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
         __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
         __pyx_t_12 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1184, __pyx_L1_error)
+        __PYX_ERR(9, 1189, __pyx_L1_error)
         __pyx_L49_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
       __pyx_t_10 = 0;
       __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_11);
       __pyx_t_11 = 0;
-      __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1184, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(5); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_15 = 0;
       __pyx_t_16 = 127;
@@ -156187,7 +156315,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __pyx_t_15 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__11);
       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_u__11);
-      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_k, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1184, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_k, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_16;
       __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
@@ -156198,9 +156326,9 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __pyx_t_15 += 2;
       __Pyx_GIVEREF(__pyx_kp_u__71);
       PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_kp_u__71);
-      __pyx_t_11 = __pyx_f_4lxml_5etree__escape_attrib_c14n(__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1184, __pyx_L1_error)
+      __pyx_t_11 = __pyx_f_4lxml_5etree__escape_attrib_c14n(__pyx_v_v); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
-      __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1184, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyUnicode_Unicode(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_10) : __pyx_t_16;
@@ -156212,14 +156340,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
       __pyx_t_15 += 1;
       __Pyx_GIVEREF(__pyx_kp_u__23);
       PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_kp_u__23);
-      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1184, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(9, 1184, __pyx_L1_error)
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_10))) __PYX_ERR(9, 1189, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     }
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1184, __pyx_L1_error)
+    __pyx_t_6 = PyUnicode_Join(__pyx_kp_u__12, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1189, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_INCREF(__pyx_v_write);
@@ -156236,12 +156364,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1184, __pyx_L1_error)
+    if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1189, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "src/lxml/serializer.pxi":1183
+    /* "src/lxml/serializer.pxi":1188
  *         write = self._write
  *         write(u'<' + parsed_qnames[tag][0])
  *         if attr_list:             # <<<<<<<<<<<<<<
@@ -156250,7 +156378,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1185
+  /* "src/lxml/serializer.pxi":1190
  *         if attr_list:
  *             write(u''.join([f' {k}="{_escape_attrib_c14n(v)}"' for k, v in attr_list]))
  *         write(u'>')             # <<<<<<<<<<<<<<
@@ -156270,12 +156398,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   }
   __pyx_t_7 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_kp_u__26) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u__26);
   __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1185, __pyx_L1_error)
+  if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1190, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1188
+  /* "src/lxml/serializer.pxi":1193
  * 
  *         # Write the resolved qname text content.
  *         if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -156286,22 +156414,22 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   __pyx_t_3 = (__pyx_t_1 != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/serializer.pxi":1189
+    /* "src/lxml/serializer.pxi":1194
  *         # Write the resolved qname text content.
  *         if qname_text is not None:
  *             write(_escape_cdata_c14n(parsed_qnames[resolved_names[qname_text]][0]))             # <<<<<<<<<<<<<<
  * 
  *         self._root_seen = True
  */
-    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_resolved_names, __pyx_v_qname_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1189, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_resolved_names, __pyx_v_qname_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1189, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_parsed_qnames, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1189, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    __pyx_t_6 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1189, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_INCREF(__pyx_v_write);
@@ -156318,12 +156446,12 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
     __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_10, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-    if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1189, __pyx_L1_error)
+    if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1194, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-    /* "src/lxml/serializer.pxi":1188
+    /* "src/lxml/serializer.pxi":1193
  * 
  *         # Write the resolved qname text content.
  *         if qname_text is not None:             # <<<<<<<<<<<<<<
@@ -156332,7 +156460,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1191
+  /* "src/lxml/serializer.pxi":1196
  *             write(_escape_cdata_c14n(parsed_qnames[resolved_names[qname_text]][0]))
  * 
  *         self._root_seen = True             # <<<<<<<<<<<<<<
@@ -156341,7 +156469,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   __pyx_v_self->_root_seen = 1;
 
-  /* "src/lxml/serializer.pxi":1192
+  /* "src/lxml/serializer.pxi":1197
  * 
  *         self._root_seen = True
  *         self._ns_stack.append([])             # <<<<<<<<<<<<<<
@@ -156350,14 +156478,14 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_ns_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(9, 1192, __pyx_L1_error)
+    __PYX_ERR(9, 1197, __pyx_L1_error)
   }
-  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1192, __pyx_L1_error)
+  __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1197, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_self->_ns_stack, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1192, __pyx_L1_error)
+  __pyx_t_13 = __Pyx_PyList_Append(__pyx_v_self->_ns_stack, __pyx_t_7); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1197, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1126
+  /* "src/lxml/serializer.pxi":1131
  *         self._start(tag, attrs, new_namespaces)
  * 
  *     cdef _start(self, tag, attrs, new_namespaces, qname_text=None):             # <<<<<<<<<<<<<<
@@ -156403,7 +156531,7 @@ static PyObject *__pyx_f_4lxml_5etree_16C14NWriterTarget__start(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1194
+/* "src/lxml/serializer.pxi":1199
  *         self._ns_stack.append([])
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
@@ -156440,7 +156568,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("end", 0);
 
-  /* "src/lxml/serializer.pxi":1195
+  /* "src/lxml/serializer.pxi":1200
  * 
  *     def end(self, tag):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -156450,7 +156578,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __pyx_t_1 = (__pyx_v_self->_ignored_depth != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1196
+    /* "src/lxml/serializer.pxi":1201
  *     def end(self, tag):
  *         if self._ignored_depth:
  *             self._ignored_depth -= 1             # <<<<<<<<<<<<<<
@@ -156459,7 +156587,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
     __pyx_v_self->_ignored_depth = (__pyx_v_self->_ignored_depth - 1);
 
-    /* "src/lxml/serializer.pxi":1197
+    /* "src/lxml/serializer.pxi":1202
  *         if self._ignored_depth:
  *             self._ignored_depth -= 1
  *             return             # <<<<<<<<<<<<<<
@@ -156470,7 +156598,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1195
+    /* "src/lxml/serializer.pxi":1200
  * 
  *     def end(self, tag):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -156479,7 +156607,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1198
+  /* "src/lxml/serializer.pxi":1203
  *             self._ignored_depth -= 1
  *             return
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -156489,18 +156617,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __pyx_t_1 = (__pyx_v_self->_data != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_data) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1199
+    /* "src/lxml/serializer.pxi":1204
  *             return
  *         if self._data:
  *             self._flush()             # <<<<<<<<<<<<<<
  *         self._write(f'</{self._qname(tag)[0]}>')
  *         self._preserve_space.pop()
  */
-    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1199, __pyx_L1_error)
+    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1204, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1198
+    /* "src/lxml/serializer.pxi":1203
  *             self._ignored_depth -= 1
  *             return
  *         if self._data:             # <<<<<<<<<<<<<<
@@ -156509,14 +156637,14 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
   }
 
-  /* "src/lxml/serializer.pxi":1200
+  /* "src/lxml/serializer.pxi":1205
  *         if self._data:
  *             self._flush()
  *         self._write(f'</{self._qname(tag)[0]}>')             # <<<<<<<<<<<<<<
  *         self._preserve_space.pop()
  *         self._root_done = len(self._preserve_space) == 1
  */
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_4 = 0;
   __pyx_t_5 = 127;
@@ -156524,12 +156652,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __pyx_t_4 += 2;
   __Pyx_GIVEREF(__pyx_kp_u__72);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__72);
-  __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_qname(__pyx_v_self, __pyx_v_tag, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_qname(__pyx_v_self, __pyx_v_tag, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_FormatSimple(__pyx_t_7, __pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6) : __pyx_t_5;
@@ -156541,7 +156669,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __pyx_t_4 += 1;
   __Pyx_GIVEREF(__pyx_kp_u__26);
   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__26);
-  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_INCREF(__pyx_v_self->_write);
@@ -156558,12 +156686,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1200, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1201
+  /* "src/lxml/serializer.pxi":1206
  *             self._flush()
  *         self._write(f'</{self._qname(tag)[0]}>')
  *         self._preserve_space.pop()             # <<<<<<<<<<<<<<
@@ -156572,13 +156700,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_preserve_space == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-    __PYX_ERR(9, 1201, __pyx_L1_error)
+    __PYX_ERR(9, 1206, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_preserve_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1201, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_preserve_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1206, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1202
+  /* "src/lxml/serializer.pxi":1207
  *         self._write(f'</{self._qname(tag)[0]}>')
  *         self._preserve_space.pop()
  *         self._root_done = len(self._preserve_space) == 1             # <<<<<<<<<<<<<<
@@ -156589,13 +156717,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   __Pyx_INCREF(__pyx_t_2);
   if (unlikely(__pyx_t_2 == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(9, 1202, __pyx_L1_error)
+    __PYX_ERR(9, 1207, __pyx_L1_error)
   }
-  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1202, __pyx_L1_error)
+  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1207, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_self->_root_done = (__pyx_t_4 == 1);
 
-  /* "src/lxml/serializer.pxi":1203
+  /* "src/lxml/serializer.pxi":1208
  *         self._preserve_space.pop()
  *         self._root_done = len(self._preserve_space) == 1
  *         self._declared_ns_stack.pop()             # <<<<<<<<<<<<<<
@@ -156604,13 +156732,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_declared_ns_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-    __PYX_ERR(9, 1203, __pyx_L1_error)
+    __PYX_ERR(9, 1208, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_declared_ns_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1203, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_declared_ns_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1208, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1204
+  /* "src/lxml/serializer.pxi":1209
  *         self._root_done = len(self._preserve_space) == 1
  *         self._declared_ns_stack.pop()
  *         self._ns_stack.pop()             # <<<<<<<<<<<<<<
@@ -156619,13 +156747,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
  */
   if (unlikely(__pyx_v_self->_ns_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-    __PYX_ERR(9, 1204, __pyx_L1_error)
+    __PYX_ERR(9, 1209, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_ns_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1204, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->_ns_stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1209, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1194
+  /* "src/lxml/serializer.pxi":1199
  *         self._ns_stack.append([])
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
@@ -156649,7 +156777,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_11end(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1206
+/* "src/lxml/serializer.pxi":1211
  *         self._ns_stack.pop()
  * 
  *     def comment(self, text):             # <<<<<<<<<<<<<<
@@ -156687,7 +156815,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("comment", 0);
 
-  /* "src/lxml/serializer.pxi":1207
+  /* "src/lxml/serializer.pxi":1212
  * 
  *     def comment(self, text):
  *         if not self._with_comments:             # <<<<<<<<<<<<<<
@@ -156697,7 +156825,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_1 = ((!(__pyx_v_self->_with_comments != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1208
+    /* "src/lxml/serializer.pxi":1213
  *     def comment(self, text):
  *         if not self._with_comments:
  *             return             # <<<<<<<<<<<<<<
@@ -156708,7 +156836,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1207
+    /* "src/lxml/serializer.pxi":1212
  * 
  *     def comment(self, text):
  *         if not self._with_comments:             # <<<<<<<<<<<<<<
@@ -156717,7 +156845,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1209
+  /* "src/lxml/serializer.pxi":1214
  *         if not self._with_comments:
  *             return
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -156727,7 +156855,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_1 = (__pyx_v_self->_ignored_depth != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1210
+    /* "src/lxml/serializer.pxi":1215
  *             return
  *         if self._ignored_depth:
  *             return             # <<<<<<<<<<<<<<
@@ -156738,7 +156866,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1209
+    /* "src/lxml/serializer.pxi":1214
  *         if not self._with_comments:
  *             return
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -156747,7 +156875,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1211
+  /* "src/lxml/serializer.pxi":1216
  *         if self._ignored_depth:
  *             return
  *         if self._root_done:             # <<<<<<<<<<<<<<
@@ -156757,7 +156885,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_1 = (__pyx_v_self->_root_done != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1212
+    /* "src/lxml/serializer.pxi":1217
  *             return
  *         if self._root_done:
  *             self._write(u'\n')             # <<<<<<<<<<<<<<
@@ -156777,12 +156905,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u__19) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__19);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1212, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1217, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1211
+    /* "src/lxml/serializer.pxi":1216
  *         if self._ignored_depth:
  *             return
  *         if self._root_done:             # <<<<<<<<<<<<<<
@@ -156792,7 +156920,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
     goto __pyx_L5;
   }
 
-  /* "src/lxml/serializer.pxi":1213
+  /* "src/lxml/serializer.pxi":1218
  *         if self._root_done:
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:             # <<<<<<<<<<<<<<
@@ -156810,18 +156938,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_L6_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1214
+    /* "src/lxml/serializer.pxi":1219
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:
  *             self._flush()             # <<<<<<<<<<<<<<
  *         self._write(f'<!--{_escape_cdata_c14n(text)}-->')
  *         if not self._root_seen:
  */
-    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1214, __pyx_L1_error)
+    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1219, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1213
+    /* "src/lxml/serializer.pxi":1218
  *         if self._root_done:
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:             # <<<<<<<<<<<<<<
@@ -156831,14 +156959,14 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   }
   __pyx_L5:;
 
-  /* "src/lxml/serializer.pxi":1215
+  /* "src/lxml/serializer.pxi":1220
  *         elif self._root_seen and self._data:
  *             self._flush()
  *         self._write(f'<!--{_escape_cdata_c14n(text)}-->')             # <<<<<<<<<<<<<<
  *         if not self._root_seen:
  *             self._write(u'\n')
  */
-  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1215, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1220, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_6 = 0;
   __pyx_t_7 = 127;
@@ -156846,9 +156974,9 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_6 += 4;
   __Pyx_GIVEREF(__pyx_kp_u__73);
   PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_u__73);
-  __pyx_t_4 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1215, __pyx_L1_error)
+  __pyx_t_4 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1220, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1215, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyUnicode_Unicode(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1220, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
@@ -156860,7 +156988,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_6 += 3;
   __Pyx_GIVEREF(__pyx_kp_u__74);
   PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_kp_u__74);
-  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1215, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1220, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_INCREF(__pyx_v_self->_write);
@@ -156877,12 +157005,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_t_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8);
   __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1215, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1220, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1216
+  /* "src/lxml/serializer.pxi":1221
  *             self._flush()
  *         self._write(f'<!--{_escape_cdata_c14n(text)}-->')
  *         if not self._root_seen:             # <<<<<<<<<<<<<<
@@ -156892,7 +157020,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   __pyx_t_1 = ((!(__pyx_v_self->_root_seen != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1217
+    /* "src/lxml/serializer.pxi":1222
  *         self._write(f'<!--{_escape_cdata_c14n(text)}-->')
  *         if not self._root_seen:
  *             self._write(u'\n')             # <<<<<<<<<<<<<<
@@ -156912,12 +157040,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
     }
     __pyx_t_2 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_8, __pyx_kp_u__19) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__19);
     __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1217, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1222, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1216
+    /* "src/lxml/serializer.pxi":1221
  *             self._flush()
  *         self._write(f'<!--{_escape_cdata_c14n(text)}-->')
  *         if not self._root_seen:             # <<<<<<<<<<<<<<
@@ -156926,7 +157054,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1206
+  /* "src/lxml/serializer.pxi":1211
  *         self._ns_stack.pop()
  * 
  *     def comment(self, text):             # <<<<<<<<<<<<<<
@@ -156950,7 +157078,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_13comment(struct __pyx
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1219
+/* "src/lxml/serializer.pxi":1224
  *             self._write(u'\n')
  * 
  *     def pi(self, target, data):             # <<<<<<<<<<<<<<
@@ -156993,11 +157121,11 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_16pi(PyObject *__pyx_v
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, 1); __PYX_ERR(9, 1219, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, 1); __PYX_ERR(9, 1224, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pi") < 0)) __PYX_ERR(9, 1219, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pi") < 0)) __PYX_ERR(9, 1224, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -157010,7 +157138,7 @@ static PyObject *__pyx_pw_4lxml_5etree_16C14NWriterTarget_16pi(PyObject *__pyx_v
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1219, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("pi", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1224, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.C14NWriterTarget.pi", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -157040,7 +157168,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("pi", 0);
 
-  /* "src/lxml/serializer.pxi":1220
+  /* "src/lxml/serializer.pxi":1225
  * 
  *     def pi(self, target, data):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -157050,7 +157178,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   __pyx_t_1 = (__pyx_v_self->_ignored_depth != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1221
+    /* "src/lxml/serializer.pxi":1226
  *     def pi(self, target, data):
  *         if self._ignored_depth:
  *             return             # <<<<<<<<<<<<<<
@@ -157061,7 +157189,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1220
+    /* "src/lxml/serializer.pxi":1225
  * 
  *     def pi(self, target, data):
  *         if self._ignored_depth:             # <<<<<<<<<<<<<<
@@ -157070,7 +157198,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
  */
   }
 
-  /* "src/lxml/serializer.pxi":1222
+  /* "src/lxml/serializer.pxi":1227
  *         if self._ignored_depth:
  *             return
  *         if self._root_done:             # <<<<<<<<<<<<<<
@@ -157080,7 +157208,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   __pyx_t_1 = (__pyx_v_self->_root_done != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1223
+    /* "src/lxml/serializer.pxi":1228
  *             return
  *         if self._root_done:
  *             self._write(u'\n')             # <<<<<<<<<<<<<<
@@ -157100,12 +157228,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u__19) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u__19);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1223, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1228, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1222
+    /* "src/lxml/serializer.pxi":1227
  *         if self._ignored_depth:
  *             return
  *         if self._root_done:             # <<<<<<<<<<<<<<
@@ -157115,7 +157243,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     goto __pyx_L4;
   }
 
-  /* "src/lxml/serializer.pxi":1224
+  /* "src/lxml/serializer.pxi":1229
  *         if self._root_done:
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:             # <<<<<<<<<<<<<<
@@ -157133,18 +157261,18 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   __pyx_L5_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1225
+    /* "src/lxml/serializer.pxi":1230
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:
  *             self._flush()             # <<<<<<<<<<<<<<
  *         self._write(
  *             f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')
  */
-    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1225, __pyx_L1_error)
+    __pyx_t_2 = ((struct __pyx_vtabstruct_4lxml_5etree_C14NWriterTarget *)__pyx_v_self->__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1230, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1224
+    /* "src/lxml/serializer.pxi":1229
  *         if self._root_done:
  *             self._write(u'\n')
  *         elif self._root_seen and self._data:             # <<<<<<<<<<<<<<
@@ -157154,16 +157282,16 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   }
   __pyx_L4:;
 
-  /* "src/lxml/serializer.pxi":1227
+  /* "src/lxml/serializer.pxi":1232
  *             self._flush()
  *         self._write(
  *             f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')             # <<<<<<<<<<<<<<
  *         if not self._root_seen:
  *             self._write(u'\n')
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1227, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1232, __pyx_L1_error)
   if (__pyx_t_1) {
-    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_6 = 0;
     __pyx_t_7 = 127;
@@ -157171,7 +157299,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_t_6 += 2;
     __Pyx_GIVEREF(__pyx_kp_u__75);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u__75);
-    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_target, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_v_target, __pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) : __pyx_t_7;
     __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8);
@@ -157182,9 +157310,9 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_t_6 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__11);
     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__11);
-    __pyx_t_8 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_8 = __pyx_f_4lxml_5etree__escape_cdata_c14n(__pyx_v_data); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyUnicode_Unicode(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) : __pyx_t_7;
@@ -157196,13 +157324,13 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_t_6 += 2;
     __Pyx_GIVEREF(__pyx_kp_u__48);
     PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_kp_u__48);
-    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_9 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_3 = __pyx_t_9;
     __pyx_t_9 = 0;
   } else {
-    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_9);
     __pyx_t_6 = 0;
     __pyx_t_7 = 127;
@@ -157210,7 +157338,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_t_6 += 2;
     __Pyx_GIVEREF(__pyx_kp_u__75);
     PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_kp_u__75);
-    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_target, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_v_target, __pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
     __pyx_t_6 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4);
@@ -157221,7 +157349,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     __pyx_t_6 += 2;
     __Pyx_GIVEREF(__pyx_kp_u__48);
     PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_kp_u__48);
-    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1227, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_9, 3, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1232, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     __pyx_t_3 = __pyx_t_4;
@@ -157241,12 +157369,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_9, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
   __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1226, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1231, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1228
+  /* "src/lxml/serializer.pxi":1233
  *         self._write(
  *             f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')
  *         if not self._root_seen:             # <<<<<<<<<<<<<<
@@ -157256,7 +157384,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   __pyx_t_1 = ((!(__pyx_v_self->_root_seen != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1229
+    /* "src/lxml/serializer.pxi":1234
  *             f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')
  *         if not self._root_seen:
  *             self._write(u'\n')             # <<<<<<<<<<<<<<
@@ -157276,12 +157404,12 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
     }
     __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_kp_u__19) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u__19);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1229, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1234, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1228
+    /* "src/lxml/serializer.pxi":1233
  *         self._write(
  *             f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')
  *         if not self._root_seen:             # <<<<<<<<<<<<<<
@@ -157290,7 +157418,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
  */
   }
 
-  /* "src/lxml/serializer.pxi":1219
+  /* "src/lxml/serializer.pxi":1224
  *             self._write(u'\n')
  * 
  *     def pi(self, target, data):             # <<<<<<<<<<<<<<
@@ -157315,7 +157443,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_15pi(struct __pyx_obj_
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1231
+/* "src/lxml/serializer.pxi":1236
  *             self._write(u'\n')
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
@@ -157342,7 +157470,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_17close(CYTHON_UNUSED
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("close", 0);
 
-  /* "src/lxml/serializer.pxi":1232
+  /* "src/lxml/serializer.pxi":1237
  * 
  *     def close(self):
  *         return None             # <<<<<<<<<<<<<<
@@ -157353,7 +157481,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_17close(CYTHON_UNUSED
   __pyx_r = Py_None; __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1231
+  /* "src/lxml/serializer.pxi":1236
  *             self._write(u'\n')
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
@@ -157368,7 +157496,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16C14NWriterTarget_17close(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1235
+/* "src/lxml/serializer.pxi":1240
  * 
  * 
  * cdef _raise_serialization_error(text):             # <<<<<<<<<<<<<<
@@ -157386,16 +157514,16 @@ static PyObject *__pyx_f_4lxml_5etree__raise_serialization_error(PyObject *__pyx
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_raise_serialization_error", 0);
 
-  /* "src/lxml/serializer.pxi":1236
+  /* "src/lxml/serializer.pxi":1241
  * 
  * cdef _raise_serialization_error(text):
  *     raise TypeError("cannot serialize %r (type %s)" % (text, type(text).__name__))             # <<<<<<<<<<<<<<
  * 
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_text)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_text)), __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_text);
   __Pyx_GIVEREF(__pyx_v_text);
@@ -157403,17 +157531,17 @@ static PyObject *__pyx_f_4lxml_5etree__raise_serialization_error(PyObject *__pyx
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
   __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_cannot_serialize_r_type_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_cannot_serialize_r_type_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1241, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_Raise(__pyx_t_2, 0, 0, 0);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __PYX_ERR(9, 1236, __pyx_L1_error)
+  __PYX_ERR(9, 1241, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1235
+  /* "src/lxml/serializer.pxi":1240
  * 
  * 
  * cdef _raise_serialization_error(text):             # <<<<<<<<<<<<<<
@@ -157432,7 +157560,7 @@ static PyObject *__pyx_f_4lxml_5etree__raise_serialization_error(PyObject *__pyx
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1239
+/* "src/lxml/serializer.pxi":1244
  * 
  * 
  * cdef unicode _escape_cdata_c14n(stext):             # <<<<<<<<<<<<<<
@@ -157459,7 +157587,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_escape_cdata_c14n", 0);
 
-  /* "src/lxml/serializer.pxi":1242
+  /* "src/lxml/serializer.pxi":1247
  *     # escape character data
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -157475,42 +157603,42 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "src/lxml/serializer.pxi":1246
+      /* "src/lxml/serializer.pxi":1251
  *         # shorter than 500 character, or so.  assume that's, by far,
  *         # the most common case in most applications.
  *         text = unicode(stext)             # <<<<<<<<<<<<<<
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  */
-      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_stext); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1246, __pyx_L3_error)
+      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_stext); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1251, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_text = ((PyObject*)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "src/lxml/serializer.pxi":1247
+      /* "src/lxml/serializer.pxi":1252
  *         # the most common case in most applications.
  *         text = unicode(stext)
  *         if u'&' in text:             # <<<<<<<<<<<<<<
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:
  */
-      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__29, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1247, __pyx_L3_error)
+      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__29, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1252, __pyx_L3_error)
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "src/lxml/serializer.pxi":1248
+        /* "src/lxml/serializer.pxi":1253
  *         text = unicode(stext)
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')             # <<<<<<<<<<<<<<
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  */
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__29, __pyx_kp_u_amp, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1248, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__29, __pyx_kp_u_amp, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1253, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1247
+        /* "src/lxml/serializer.pxi":1252
  *         # the most common case in most applications.
  *         text = unicode(stext)
  *         if u'&' in text:             # <<<<<<<<<<<<<<
@@ -157519,7 +157647,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       }
 
-      /* "src/lxml/serializer.pxi":1249
+      /* "src/lxml/serializer.pxi":1254
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:             # <<<<<<<<<<<<<<
@@ -157528,13 +157656,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1249, __pyx_L3_error)
+        __PYX_ERR(9, 1254, __pyx_L3_error)
       }
-      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__70, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1249, __pyx_L3_error)
+      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__70, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1254, __pyx_L3_error)
       __pyx_t_5 = (__pyx_t_6 != 0);
       if (__pyx_t_5) {
 
-        /* "src/lxml/serializer.pxi":1250
+        /* "src/lxml/serializer.pxi":1255
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')             # <<<<<<<<<<<<<<
@@ -157543,14 +157671,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1250, __pyx_L3_error)
+          __PYX_ERR(9, 1255, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__70, __pyx_kp_u_lt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1250, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__70, __pyx_kp_u_lt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1255, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1249
+        /* "src/lxml/serializer.pxi":1254
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:             # <<<<<<<<<<<<<<
@@ -157559,7 +157687,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       }
 
-      /* "src/lxml/serializer.pxi":1251
+      /* "src/lxml/serializer.pxi":1256
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  *         if u'>' in text:             # <<<<<<<<<<<<<<
@@ -157568,13 +157696,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1251, __pyx_L3_error)
+        __PYX_ERR(9, 1256, __pyx_L3_error)
       }
-      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__26, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1251, __pyx_L3_error)
+      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__26, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1256, __pyx_L3_error)
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "src/lxml/serializer.pxi":1252
+        /* "src/lxml/serializer.pxi":1257
  *             text = text.replace(u'<', u'&lt;')
  *         if u'>' in text:
  *             text = text.replace(u'>', u'&gt;')             # <<<<<<<<<<<<<<
@@ -157583,14 +157711,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1252, __pyx_L3_error)
+          __PYX_ERR(9, 1257, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__26, __pyx_kp_u_gt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1252, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__26, __pyx_kp_u_gt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1257, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1251
+        /* "src/lxml/serializer.pxi":1256
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  *         if u'>' in text:             # <<<<<<<<<<<<<<
@@ -157599,7 +157727,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       }
 
-      /* "src/lxml/serializer.pxi":1253
+      /* "src/lxml/serializer.pxi":1258
  *         if u'>' in text:
  *             text = text.replace(u'>', u'&gt;')
  *         if u'\r' in text:             # <<<<<<<<<<<<<<
@@ -157608,13 +157736,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1253, __pyx_L3_error)
+        __PYX_ERR(9, 1258, __pyx_L3_error)
       }
-      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__76, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1253, __pyx_L3_error)
+      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__76, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1258, __pyx_L3_error)
       __pyx_t_5 = (__pyx_t_6 != 0);
       if (__pyx_t_5) {
 
-        /* "src/lxml/serializer.pxi":1254
+        /* "src/lxml/serializer.pxi":1259
  *             text = text.replace(u'>', u'&gt;')
  *         if u'\r' in text:
  *             text = text.replace(u'\r', u'&#xD;')             # <<<<<<<<<<<<<<
@@ -157623,14 +157751,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1254, __pyx_L3_error)
+          __PYX_ERR(9, 1259, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__76, __pyx_kp_u_xD, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1254, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__76, __pyx_kp_u_xD, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1259, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1253
+        /* "src/lxml/serializer.pxi":1258
  *         if u'>' in text:
  *             text = text.replace(u'>', u'&gt;')
  *         if u'\r' in text:             # <<<<<<<<<<<<<<
@@ -157639,7 +157767,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
  */
       }
 
-      /* "src/lxml/serializer.pxi":1255
+      /* "src/lxml/serializer.pxi":1260
  *         if u'\r' in text:
  *             text = text.replace(u'\r', u'&#xD;')
  *         return text             # <<<<<<<<<<<<<<
@@ -157651,7 +157779,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
       __pyx_r = __pyx_v_text;
       goto __pyx_L7_try_return;
 
-      /* "src/lxml/serializer.pxi":1242
+      /* "src/lxml/serializer.pxi":1247
  *     # escape character data
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -157662,7 +157790,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
     __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1256
+    /* "src/lxml/serializer.pxi":1261
  *             text = text.replace(u'\r', u'&#xD;')
  *         return text
  *     except (TypeError, AttributeError):             # <<<<<<<<<<<<<<
@@ -157672,19 +157800,19 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree._escape_cdata_c14n", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(9, 1256, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(9, 1261, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "src/lxml/serializer.pxi":1257
+      /* "src/lxml/serializer.pxi":1262
  *         return text
  *     except (TypeError, AttributeError):
  *         _raise_serialization_error(stext)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-      __pyx_t_10 = __pyx_f_4lxml_5etree__raise_serialization_error(__pyx_v_stext); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1257, __pyx_L5_except_error)
+      __pyx_t_10 = __pyx_f_4lxml_5etree__raise_serialization_error(__pyx_v_stext); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1262, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -157695,7 +157823,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "src/lxml/serializer.pxi":1242
+    /* "src/lxml/serializer.pxi":1247
  *     # escape character data
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -157720,7 +157848,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
   }
 
-  /* "src/lxml/serializer.pxi":1239
+  /* "src/lxml/serializer.pxi":1244
  * 
  * 
  * cdef unicode _escape_cdata_c14n(stext):             # <<<<<<<<<<<<<<
@@ -157745,7 +157873,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_cdata_c14n(PyObject *__pyx_v_stext
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1260
+/* "src/lxml/serializer.pxi":1265
  * 
  * 
  * cdef unicode _escape_attrib_c14n(stext):             # <<<<<<<<<<<<<<
@@ -157772,7 +157900,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_escape_attrib_c14n", 0);
 
-  /* "src/lxml/serializer.pxi":1263
+  /* "src/lxml/serializer.pxi":1268
  *     # escape attribute value
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -157788,42 +157916,42 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
     __Pyx_XGOTREF(__pyx_t_3);
     /*try:*/ {
 
-      /* "src/lxml/serializer.pxi":1264
+      /* "src/lxml/serializer.pxi":1269
  *     cdef unicode text
  *     try:
  *         text = unicode(stext)             # <<<<<<<<<<<<<<
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  */
-      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_stext); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1264, __pyx_L3_error)
+      __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_stext); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1269, __pyx_L3_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_v_text = ((PyObject*)__pyx_t_4);
       __pyx_t_4 = 0;
 
-      /* "src/lxml/serializer.pxi":1265
+      /* "src/lxml/serializer.pxi":1270
  *     try:
  *         text = unicode(stext)
  *         if u'&' in text:             # <<<<<<<<<<<<<<
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:
  */
-      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__29, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1265, __pyx_L3_error)
+      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__29, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1270, __pyx_L3_error)
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "src/lxml/serializer.pxi":1266
+        /* "src/lxml/serializer.pxi":1271
  *         text = unicode(stext)
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')             # <<<<<<<<<<<<<<
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  */
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__29, __pyx_kp_u_amp, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1266, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__29, __pyx_kp_u_amp, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1271, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1265
+        /* "src/lxml/serializer.pxi":1270
  *     try:
  *         text = unicode(stext)
  *         if u'&' in text:             # <<<<<<<<<<<<<<
@@ -157832,7 +157960,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1267
+      /* "src/lxml/serializer.pxi":1272
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:             # <<<<<<<<<<<<<<
@@ -157841,13 +157969,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1267, __pyx_L3_error)
+        __PYX_ERR(9, 1272, __pyx_L3_error)
       }
-      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__70, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1267, __pyx_L3_error)
+      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__70, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1272, __pyx_L3_error)
       __pyx_t_5 = (__pyx_t_6 != 0);
       if (__pyx_t_5) {
 
-        /* "src/lxml/serializer.pxi":1268
+        /* "src/lxml/serializer.pxi":1273
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')             # <<<<<<<<<<<<<<
@@ -157856,14 +157984,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1268, __pyx_L3_error)
+          __PYX_ERR(9, 1273, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__70, __pyx_kp_u_lt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1268, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__70, __pyx_kp_u_lt, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1273, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1267
+        /* "src/lxml/serializer.pxi":1272
  *         if u'&' in text:
  *             text = text.replace(u'&', u'&amp;')
  *         if u'<' in text:             # <<<<<<<<<<<<<<
@@ -157872,7 +158000,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1269
+      /* "src/lxml/serializer.pxi":1274
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  *         if u'"' in text:             # <<<<<<<<<<<<<<
@@ -157881,13 +158009,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1269, __pyx_L3_error)
+        __PYX_ERR(9, 1274, __pyx_L3_error)
       }
-      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__23, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1269, __pyx_L3_error)
+      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__23, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1274, __pyx_L3_error)
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "src/lxml/serializer.pxi":1270
+        /* "src/lxml/serializer.pxi":1275
  *             text = text.replace(u'<', u'&lt;')
  *         if u'"' in text:
  *             text = text.replace(u'"', u'&quot;')             # <<<<<<<<<<<<<<
@@ -157896,14 +158024,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1270, __pyx_L3_error)
+          __PYX_ERR(9, 1275, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__23, __pyx_kp_u_quot, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1270, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__23, __pyx_kp_u_quot, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1275, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1269
+        /* "src/lxml/serializer.pxi":1274
  *         if u'<' in text:
  *             text = text.replace(u'<', u'&lt;')
  *         if u'"' in text:             # <<<<<<<<<<<<<<
@@ -157912,7 +158040,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1271
+      /* "src/lxml/serializer.pxi":1276
  *         if u'"' in text:
  *             text = text.replace(u'"', u'&quot;')
  *         if u'\t' in text:             # <<<<<<<<<<<<<<
@@ -157921,13 +158049,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1271, __pyx_L3_error)
+        __PYX_ERR(9, 1276, __pyx_L3_error)
       }
-      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__77, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1271, __pyx_L3_error)
+      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__77, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1276, __pyx_L3_error)
       __pyx_t_5 = (__pyx_t_6 != 0);
       if (__pyx_t_5) {
 
-        /* "src/lxml/serializer.pxi":1272
+        /* "src/lxml/serializer.pxi":1277
  *             text = text.replace(u'"', u'&quot;')
  *         if u'\t' in text:
  *             text = text.replace(u'\t', u'&#x9;')             # <<<<<<<<<<<<<<
@@ -157936,14 +158064,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1272, __pyx_L3_error)
+          __PYX_ERR(9, 1277, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__77, __pyx_kp_u_x9, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1272, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__77, __pyx_kp_u_x9, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1277, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1271
+        /* "src/lxml/serializer.pxi":1276
  *         if u'"' in text:
  *             text = text.replace(u'"', u'&quot;')
  *         if u'\t' in text:             # <<<<<<<<<<<<<<
@@ -157952,7 +158080,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1273
+      /* "src/lxml/serializer.pxi":1278
  *         if u'\t' in text:
  *             text = text.replace(u'\t', u'&#x9;')
  *         if u'\n' in text:             # <<<<<<<<<<<<<<
@@ -157961,13 +158089,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1273, __pyx_L3_error)
+        __PYX_ERR(9, 1278, __pyx_L3_error)
       }
-      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__19, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1273, __pyx_L3_error)
+      __pyx_t_5 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__19, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(9, 1278, __pyx_L3_error)
       __pyx_t_6 = (__pyx_t_5 != 0);
       if (__pyx_t_6) {
 
-        /* "src/lxml/serializer.pxi":1274
+        /* "src/lxml/serializer.pxi":1279
  *             text = text.replace(u'\t', u'&#x9;')
  *         if u'\n' in text:
  *             text = text.replace(u'\n', u'&#xA;')             # <<<<<<<<<<<<<<
@@ -157976,14 +158104,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1274, __pyx_L3_error)
+          __PYX_ERR(9, 1279, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__19, __pyx_kp_u_xA, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1274, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__19, __pyx_kp_u_xA, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1279, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1273
+        /* "src/lxml/serializer.pxi":1278
  *         if u'\t' in text:
  *             text = text.replace(u'\t', u'&#x9;')
  *         if u'\n' in text:             # <<<<<<<<<<<<<<
@@ -157992,7 +158120,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1275
+      /* "src/lxml/serializer.pxi":1280
  *         if u'\n' in text:
  *             text = text.replace(u'\n', u'&#xA;')
  *         if u'\r' in text:             # <<<<<<<<<<<<<<
@@ -158001,13 +158129,13 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       if (unlikely(__pyx_v_text == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-        __PYX_ERR(9, 1275, __pyx_L3_error)
+        __PYX_ERR(9, 1280, __pyx_L3_error)
       }
-      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__76, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1275, __pyx_L3_error)
+      __pyx_t_6 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__76, __pyx_v_text, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1280, __pyx_L3_error)
       __pyx_t_5 = (__pyx_t_6 != 0);
       if (__pyx_t_5) {
 
-        /* "src/lxml/serializer.pxi":1276
+        /* "src/lxml/serializer.pxi":1281
  *             text = text.replace(u'\n', u'&#xA;')
  *         if u'\r' in text:
  *             text = text.replace(u'\r', u'&#xD;')             # <<<<<<<<<<<<<<
@@ -158016,14 +158144,14 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
         if (unlikely(__pyx_v_text == Py_None)) {
           PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "replace");
-          __PYX_ERR(9, 1276, __pyx_L3_error)
+          __PYX_ERR(9, 1281, __pyx_L3_error)
         }
-        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__76, __pyx_kp_u_xD, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1276, __pyx_L3_error)
+        __pyx_t_4 = PyUnicode_Replace(__pyx_v_text, __pyx_kp_u__76, __pyx_kp_u_xD, -1L); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1281, __pyx_L3_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_text, ((PyObject*)__pyx_t_4));
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1275
+        /* "src/lxml/serializer.pxi":1280
  *         if u'\n' in text:
  *             text = text.replace(u'\n', u'&#xA;')
  *         if u'\r' in text:             # <<<<<<<<<<<<<<
@@ -158032,7 +158160,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
  */
       }
 
-      /* "src/lxml/serializer.pxi":1277
+      /* "src/lxml/serializer.pxi":1282
  *         if u'\r' in text:
  *             text = text.replace(u'\r', u'&#xD;')
  *         return text             # <<<<<<<<<<<<<<
@@ -158044,7 +158172,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
       __pyx_r = __pyx_v_text;
       goto __pyx_L7_try_return;
 
-      /* "src/lxml/serializer.pxi":1263
+      /* "src/lxml/serializer.pxi":1268
  *     # escape attribute value
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -158055,7 +158183,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
     __pyx_L3_error:;
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1278
+    /* "src/lxml/serializer.pxi":1283
  *             text = text.replace(u'\r', u'&#xD;')
  *         return text
  *     except (TypeError, AttributeError):             # <<<<<<<<<<<<<<
@@ -158065,19 +158193,19 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
     __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
     if (__pyx_t_7) {
       __Pyx_AddTraceback("lxml.etree._escape_attrib_c14n", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(9, 1278, __pyx_L5_except_error)
+      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(9, 1283, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "src/lxml/serializer.pxi":1279
+      /* "src/lxml/serializer.pxi":1284
  *         return text
  *     except (TypeError, AttributeError):
  *         _raise_serialization_error(stext)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-      __pyx_t_10 = __pyx_f_4lxml_5etree__raise_serialization_error(__pyx_v_stext); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1279, __pyx_L5_except_error)
+      __pyx_t_10 = __pyx_f_4lxml_5etree__raise_serialization_error(__pyx_v_stext); if (unlikely(!__pyx_t_10)) __PYX_ERR(9, 1284, __pyx_L5_except_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -158088,7 +158216,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
     goto __pyx_L5_except_error;
     __pyx_L5_except_error:;
 
-    /* "src/lxml/serializer.pxi":1263
+    /* "src/lxml/serializer.pxi":1268
  *     # escape attribute value
  *     cdef unicode text
  *     try:             # <<<<<<<<<<<<<<
@@ -158113,7 +158241,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
     __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
   }
 
-  /* "src/lxml/serializer.pxi":1260
+  /* "src/lxml/serializer.pxi":1265
  * 
  * 
  * cdef unicode _escape_attrib_c14n(stext):             # <<<<<<<<<<<<<<
@@ -158138,7 +158266,7 @@ static PyObject *__pyx_f_4lxml_5etree__escape_attrib_c14n(PyObject *__pyx_v_stex
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1329
+/* "src/lxml/serializer.pxi":1334
  *     cdef int method
  * 
  *     def __init__(self, output_file not None, encoding=None, compression=None,             # <<<<<<<<<<<<<<
@@ -158166,7 +158294,7 @@ static int __pyx_pw_4lxml_5etree_7xmlfile_1__init__(PyObject *__pyx_v_self, PyOb
     values[1] = ((PyObject *)Py_None);
     values[2] = ((PyObject *)Py_None);
 
-    /* "src/lxml/serializer.pxi":1330
+    /* "src/lxml/serializer.pxi":1335
  * 
  *     def __init__(self, output_file not None, encoding=None, compression=None,
  *                  close=False, buffered=True):             # <<<<<<<<<<<<<<
@@ -158223,7 +158351,7 @@ static int __pyx_pw_4lxml_5etree_7xmlfile_1__init__(PyObject *__pyx_v_self, PyOb
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(9, 1329, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(9, 1334, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -158248,18 +158376,18 @@ static int __pyx_pw_4lxml_5etree_7xmlfile_1__init__(PyObject *__pyx_v_self, PyOb
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1329, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1334, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.xmlfile.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
   if (unlikely(((PyObject *)__pyx_v_output_file) == Py_None)) {
-    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_file"); __PYX_ERR(9, 1329, __pyx_L1_error)
+    PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "output_file"); __PYX_ERR(9, 1334, __pyx_L1_error)
   }
   __pyx_r = __pyx_pf_4lxml_5etree_7xmlfile___init__(((struct __pyx_obj_4lxml_5etree_xmlfile *)__pyx_v_self), __pyx_v_output_file, __pyx_v_encoding, __pyx_v_compression, __pyx_v_close, __pyx_v_buffered);
 
-  /* "src/lxml/serializer.pxi":1329
+  /* "src/lxml/serializer.pxi":1334
  *     cdef int method
  * 
  *     def __init__(self, output_file not None, encoding=None, compression=None,             # <<<<<<<<<<<<<<
@@ -158288,7 +158416,7 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/serializer.pxi":1331
+  /* "src/lxml/serializer.pxi":1336
  *     def __init__(self, output_file not None, encoding=None, compression=None,
  *                  close=False, buffered=True):
  *         self.output_file = output_file             # <<<<<<<<<<<<<<
@@ -158301,14 +158429,14 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
   __Pyx_DECREF(__pyx_v_self->output_file);
   __pyx_v_self->output_file = __pyx_v_output_file;
 
-  /* "src/lxml/serializer.pxi":1332
+  /* "src/lxml/serializer.pxi":1337
  *                  close=False, buffered=True):
  *         self.output_file = output_file
  *         self.encoding = _utf8orNone(encoding)             # <<<<<<<<<<<<<<
  *         self.compresslevel = compression or 0
  *         self.close = close
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1332, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_encoding); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1337, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->encoding);
@@ -158316,17 +158444,17 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
   __pyx_v_self->encoding = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1333
+  /* "src/lxml/serializer.pxi":1338
  *         self.output_file = output_file
  *         self.encoding = _utf8orNone(encoding)
  *         self.compresslevel = compression or 0             # <<<<<<<<<<<<<<
  *         self.close = close
  *         self.buffered = buffered
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_compression); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1333, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_compression); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1338, __pyx_L1_error)
   if (!__pyx_t_3) {
   } else {
-    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1333, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1338, __pyx_L1_error)
     __pyx_t_2 = __pyx_t_4;
     goto __pyx_L3_bool_binop_done;
   }
@@ -158334,27 +158462,27 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
   __pyx_L3_bool_binop_done:;
   __pyx_v_self->compresslevel = __pyx_t_2;
 
-  /* "src/lxml/serializer.pxi":1334
+  /* "src/lxml/serializer.pxi":1339
  *         self.encoding = _utf8orNone(encoding)
  *         self.compresslevel = compression or 0
  *         self.close = close             # <<<<<<<<<<<<<<
  *         self.buffered = buffered
  *         self.method = OUTPUT_METHOD_XML
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_close); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1334, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_close); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1339, __pyx_L1_error)
   __pyx_v_self->close = __pyx_t_3;
 
-  /* "src/lxml/serializer.pxi":1335
+  /* "src/lxml/serializer.pxi":1340
  *         self.compresslevel = compression or 0
  *         self.close = close
  *         self.buffered = buffered             # <<<<<<<<<<<<<<
  *         self.method = OUTPUT_METHOD_XML
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffered); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1335, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_buffered); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1340, __pyx_L1_error)
   __pyx_v_self->buffered = __pyx_t_3;
 
-  /* "src/lxml/serializer.pxi":1336
+  /* "src/lxml/serializer.pxi":1341
  *         self.close = close
  *         self.buffered = buffered
  *         self.method = OUTPUT_METHOD_XML             # <<<<<<<<<<<<<<
@@ -158363,7 +158491,7 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
  */
   __pyx_v_self->method = __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML;
 
-  /* "src/lxml/serializer.pxi":1329
+  /* "src/lxml/serializer.pxi":1334
  *     cdef int method
  * 
  *     def __init__(self, output_file not None, encoding=None, compression=None,             # <<<<<<<<<<<<<<
@@ -158383,7 +158511,7 @@ static int __pyx_pf_4lxml_5etree_7xmlfile___init__(struct __pyx_obj_4lxml_5etree
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1338
+/* "src/lxml/serializer.pxi":1343
  *         self.method = OUTPUT_METHOD_XML
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -158419,7 +158547,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__enter__", 0);
 
-  /* "src/lxml/serializer.pxi":1339
+  /* "src/lxml/serializer.pxi":1344
  * 
  *     def __enter__(self):
  *         assert self.output_file is not None             # <<<<<<<<<<<<<<
@@ -158431,43 +158559,43 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
     __pyx_t_1 = (__pyx_v_self->output_file != Py_None);
     if (unlikely(!(__pyx_t_1 != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1339, __pyx_L1_error)
+      __PYX_ERR(9, 1344, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1341
+  /* "src/lxml/serializer.pxi":1346
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,             # <<<<<<<<<<<<<<
  *             self.close, self.buffered, self.method)
  *         return self.writer
  */
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->compresslevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1341, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->compresslevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1346, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "src/lxml/serializer.pxi":1342
+  /* "src/lxml/serializer.pxi":1347
  *         self.writer = _IncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)             # <<<<<<<<<<<<<<
  *         return self.writer
  * 
  */
-  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->close); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1342, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->close); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1347, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->buffered); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1342, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_self->buffered); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1347, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->method); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1342, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_self->method); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1347, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
 
-  /* "src/lxml/serializer.pxi":1340
+  /* "src/lxml/serializer.pxi":1345
  *     def __enter__(self):
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(             # <<<<<<<<<<<<<<
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)
  */
-  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1340, __pyx_L1_error)
+  __pyx_t_6 = PyTuple_New(6); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1345, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(__pyx_v_self->output_file);
   __Pyx_GIVEREF(__pyx_v_self->output_file);
@@ -158487,7 +158615,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
   __pyx_t_3 = 0;
   __pyx_t_4 = 0;
   __pyx_t_5 = 0;
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1340, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter), __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1345, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_GIVEREF(__pyx_t_5);
@@ -158496,7 +158624,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
   __pyx_v_self->writer = ((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1343
+  /* "src/lxml/serializer.pxi":1348
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)
  *         return self.writer             # <<<<<<<<<<<<<<
@@ -158508,7 +158636,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
   __pyx_r = ((PyObject *)__pyx_v_self->writer);
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1338
+  /* "src/lxml/serializer.pxi":1343
  *         self.method = OUTPUT_METHOD_XML
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -158531,7 +158659,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_2__enter__(struct __pyx_obj_4lxm
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1345
+/* "src/lxml/serializer.pxi":1350
  *         return self.writer
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -158577,17 +158705,17 @@ static PyObject *__pyx_pw_4lxml_5etree_7xmlfile_5__exit__(PyObject *__pyx_v_self
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1345, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1350, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1345, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1350, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1345, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1350, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -158602,7 +158730,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7xmlfile_5__exit__(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1345, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1350, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.xmlfile.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -158629,7 +158757,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__exit__", 0);
 
-  /* "src/lxml/serializer.pxi":1346
+  /* "src/lxml/serializer.pxi":1351
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self.writer is not None:             # <<<<<<<<<<<<<<
@@ -158640,7 +158768,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1347
+    /* "src/lxml/serializer.pxi":1352
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None             # <<<<<<<<<<<<<<
@@ -158659,7 +158787,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
     __pyx_v_self->writer = ((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1348
+    /* "src/lxml/serializer.pxi":1353
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None
  *             raise_on_error = exc_type is None             # <<<<<<<<<<<<<<
@@ -158667,24 +158795,24 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
  *             if self.close:
  */
     __pyx_t_2 = (__pyx_v_exc_type == Py_None);
-    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1348, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1353, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_v_raise_on_error = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1349
+    /* "src/lxml/serializer.pxi":1354
  *             old_writer, self.writer = self.writer, None
  *             raise_on_error = exc_type is None
  *             old_writer._close(raise_on_error)             # <<<<<<<<<<<<<<
  *             if self.close:
  *                 self.output_file = None
  */
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_raise_on_error); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1349, __pyx_L1_error)
-    __pyx_t_4 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(__pyx_v_old_writer, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1349, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_raise_on_error); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1354, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(__pyx_v_old_writer, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1354, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1350
+    /* "src/lxml/serializer.pxi":1355
  *             raise_on_error = exc_type is None
  *             old_writer._close(raise_on_error)
  *             if self.close:             # <<<<<<<<<<<<<<
@@ -158694,7 +158822,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
     __pyx_t_2 = (__pyx_v_self->close != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/serializer.pxi":1351
+      /* "src/lxml/serializer.pxi":1356
  *             old_writer._close(raise_on_error)
  *             if self.close:
  *                 self.output_file = None             # <<<<<<<<<<<<<<
@@ -158707,7 +158835,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
       __Pyx_DECREF(__pyx_v_self->output_file);
       __pyx_v_self->output_file = Py_None;
 
-      /* "src/lxml/serializer.pxi":1350
+      /* "src/lxml/serializer.pxi":1355
  *             raise_on_error = exc_type is None
  *             old_writer._close(raise_on_error)
  *             if self.close:             # <<<<<<<<<<<<<<
@@ -158716,7 +158844,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
  */
     }
 
-    /* "src/lxml/serializer.pxi":1346
+    /* "src/lxml/serializer.pxi":1351
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self.writer is not None:             # <<<<<<<<<<<<<<
@@ -158725,7 +158853,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
  */
   }
 
-  /* "src/lxml/serializer.pxi":1345
+  /* "src/lxml/serializer.pxi":1350
  *         return self.writer
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -158750,7 +158878,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_4__exit__(struct __pyx_obj_4lxml
 }
 static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1353
+/* "src/lxml/serializer.pxi":1358
  *                 self.output_file = None
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -158784,7 +158912,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_6__aenter__(struct __pyx_obj_4lx
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_2___aenter__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1353, __pyx_L1_error)
+    __PYX_ERR(9, 1358, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -158792,7 +158920,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_6__aenter__(struct __pyx_obj_4lx
   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_7xmlfile_8generator2, __pyx_codeobj__78, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_xmlfile___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1353, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_7xmlfile_8generator2, __pyx_codeobj__78, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_xmlfile___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1358, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -158831,9 +158959,9 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1353, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1358, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1354
+  /* "src/lxml/serializer.pxi":1359
  * 
  *     async def __aenter__(self):
  *         assert self.output_file is not None             # <<<<<<<<<<<<<<
@@ -158845,12 +158973,12 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
     __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->output_file != Py_None);
     if (unlikely(!(__pyx_t_1 != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1354, __pyx_L1_error)
+      __PYX_ERR(9, 1359, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1355
+  /* "src/lxml/serializer.pxi":1360
  *     async def __aenter__(self):
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):             # <<<<<<<<<<<<<<
@@ -158864,20 +158992,20 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
   __pyx_t_3 = (__pyx_t_1 != 0);
   if (unlikely(__pyx_t_3)) {
 
-    /* "src/lxml/serializer.pxi":1356
+    /* "src/lxml/serializer.pxi":1361
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  *             raise TypeError("Cannot asynchronously write to a plain file")             # <<<<<<<<<<<<<<
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1356, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1361, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1356, __pyx_L1_error)
+    __PYX_ERR(9, 1361, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1355
+    /* "src/lxml/serializer.pxi":1360
  *     async def __aenter__(self):
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):             # <<<<<<<<<<<<<<
@@ -158886,7 +159014,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
  */
   }
 
-  /* "src/lxml/serializer.pxi":1357
+  /* "src/lxml/serializer.pxi":1362
  *         if isinstance(self.output_file, basestring):
  *             raise TypeError("Cannot asynchronously write to a plain file")
  *         if not hasattr(self.output_file, 'write'):             # <<<<<<<<<<<<<<
@@ -158895,25 +159023,25 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
  */
   __pyx_t_2 = __pyx_cur_scope->__pyx_v_self->output_file;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_write); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1357, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_HasAttr(__pyx_t_2, __pyx_n_s_write); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1362, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_1 = ((!(__pyx_t_3 != 0)) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1358
+    /* "src/lxml/serializer.pxi":1363
  *             raise TypeError("Cannot asynchronously write to a plain file")
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")             # <<<<<<<<<<<<<<
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1358, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1363, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1358, __pyx_L1_error)
+    __PYX_ERR(9, 1363, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1357
+    /* "src/lxml/serializer.pxi":1362
  *         if isinstance(self.output_file, basestring):
  *             raise TypeError("Cannot asynchronously write to a plain file")
  *         if not hasattr(self.output_file, 'write'):             # <<<<<<<<<<<<<<
@@ -158922,38 +159050,38 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
  */
   }
 
-  /* "src/lxml/serializer.pxi":1360
+  /* "src/lxml/serializer.pxi":1365
  *             raise TypeError("Output file needs an async .write() method")
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,             # <<<<<<<<<<<<<<
  *             self.close, self.buffered, self.method)
  *         return self.async_writer
  */
-  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->compresslevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1360, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->compresslevel); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1365, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
 
-  /* "src/lxml/serializer.pxi":1361
+  /* "src/lxml/serializer.pxi":1366
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)             # <<<<<<<<<<<<<<
  *         return self.async_writer
  * 
  */
-  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_self->close); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1361, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_self->close); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1366, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_self->buffered); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1361, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_cur_scope->__pyx_v_self->buffered); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1366, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->method); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1361, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->method); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1366, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
 
-  /* "src/lxml/serializer.pxi":1359
+  /* "src/lxml/serializer.pxi":1364
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")
  *         self.async_writer = _AsyncIncrementalFileWriter(             # <<<<<<<<<<<<<<
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)
  */
-  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1359, __pyx_L1_error)
+  __pyx_t_7 = PyTuple_New(6); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1364, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->output_file);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->output_file);
@@ -158973,7 +159101,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
   __pyx_t_4 = 0;
   __pyx_t_5 = 0;
   __pyx_t_6 = 0;
-  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1359, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1364, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_GIVEREF(__pyx_t_6);
@@ -158982,7 +159110,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
   __pyx_cur_scope->__pyx_v_self->async_writer = ((struct __pyx_obj_4lxml_5etree__AsyncIncrementalFileWriter *)__pyx_t_6);
   __pyx_t_6 = 0;
 
-  /* "src/lxml/serializer.pxi":1362
+  /* "src/lxml/serializer.pxi":1367
  *             self.output_file, self.encoding, self.compresslevel,
  *             self.close, self.buffered, self.method)
  *         return self.async_writer             # <<<<<<<<<<<<<<
@@ -158994,7 +159122,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
   goto __pyx_L0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1353
+  /* "src/lxml/serializer.pxi":1358
  *                 self.output_file = None
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -159022,7 +159150,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_8generator2(__pyx_CoroutineObjec
 }
 static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1364
+/* "src/lxml/serializer.pxi":1369
  *         return self.async_writer
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -159068,17 +159196,17 @@ static PyObject *__pyx_pw_4lxml_5etree_7xmlfile_10__aexit__(PyObject *__pyx_v_se
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, 1); __PYX_ERR(9, 1364, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, 1); __PYX_ERR(9, 1369, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, 2); __PYX_ERR(9, 1364, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, 2); __PYX_ERR(9, 1369, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__aexit__") < 0)) __PYX_ERR(9, 1364, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__aexit__") < 0)) __PYX_ERR(9, 1369, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -159093,7 +159221,7 @@ static PyObject *__pyx_pw_4lxml_5etree_7xmlfile_10__aexit__(PyObject *__pyx_v_se
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1364, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__aexit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1369, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.xmlfile.__aexit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -159118,7 +159246,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_9__aexit__(struct __pyx_obj_4lxm
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_3___aexit__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1364, __pyx_L1_error)
+    __PYX_ERR(9, 1369, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -159135,7 +159263,7 @@ static PyObject *__pyx_pf_4lxml_5etree_7xmlfile_9__aexit__(struct __pyx_obj_4lxm
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_exc_tb);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_exc_tb);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_7xmlfile_11generator3, __pyx_codeobj__81, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_xmlfile___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1364, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_7xmlfile_11generator3, __pyx_codeobj__81, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_xmlfile___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1369, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -159173,9 +159301,9 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1364, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1369, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1365
+  /* "src/lxml/serializer.pxi":1370
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):
  *         if self.async_writer is not None:             # <<<<<<<<<<<<<<
@@ -159186,7 +159314,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1366
+    /* "src/lxml/serializer.pxi":1371
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None             # <<<<<<<<<<<<<<
@@ -159206,7 +159334,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
     __pyx_cur_scope->__pyx_v_self->async_writer = ((struct __pyx_obj_4lxml_5etree__AsyncIncrementalFileWriter *)__pyx_t_4);
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1367
+    /* "src/lxml/serializer.pxi":1372
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None
  *             raise_on_error = exc_type is None             # <<<<<<<<<<<<<<
@@ -159214,20 +159342,20 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
  *             if self.close:
  */
     __pyx_t_2 = (__pyx_cur_scope->__pyx_v_exc_type == Py_None);
-    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1367, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1372, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_GIVEREF(__pyx_t_4);
     __pyx_cur_scope->__pyx_v_raise_on_error = __pyx_t_4;
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1368
+    /* "src/lxml/serializer.pxi":1373
  *             old_writer, self.async_writer = self.async_writer, None
  *             raise_on_error = exc_type is None
  *             await old_writer._close(raise_on_error)             # <<<<<<<<<<<<<<
  *             if self.close:
  *                 self.output_file = None
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_old_writer), __pyx_n_s_close_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1368, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_old_writer), __pyx_n_s_close_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1373, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -159241,7 +159369,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
     }
     __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_cur_scope->__pyx_v_raise_on_error) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_raise_on_error);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1368, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1373, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_4);
@@ -159255,16 +159383,16 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1368, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1373, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1368, __pyx_L1_error)
+        else __PYX_ERR(9, 1373, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1369
+    /* "src/lxml/serializer.pxi":1374
  *             raise_on_error = exc_type is None
  *             await old_writer._close(raise_on_error)
  *             if self.close:             # <<<<<<<<<<<<<<
@@ -159274,7 +159402,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
     __pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->close != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/serializer.pxi":1370
+      /* "src/lxml/serializer.pxi":1375
  *             await old_writer._close(raise_on_error)
  *             if self.close:
  *                 self.output_file = None             # <<<<<<<<<<<<<<
@@ -159287,7 +159415,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
       __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->output_file);
       __pyx_cur_scope->__pyx_v_self->output_file = Py_None;
 
-      /* "src/lxml/serializer.pxi":1369
+      /* "src/lxml/serializer.pxi":1374
  *             raise_on_error = exc_type is None
  *             await old_writer._close(raise_on_error)
  *             if self.close:             # <<<<<<<<<<<<<<
@@ -159296,7 +159424,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
  */
     }
 
-    /* "src/lxml/serializer.pxi":1365
+    /* "src/lxml/serializer.pxi":1370
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):
  *         if self.async_writer is not None:             # <<<<<<<<<<<<<<
@@ -159306,7 +159434,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1364
+  /* "src/lxml/serializer.pxi":1369
  *         return self.async_writer
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -159333,7 +159461,7 @@ static PyObject *__pyx_gb_4lxml_5etree_7xmlfile_11generator3(__pyx_CoroutineObje
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1379
+/* "src/lxml/serializer.pxi":1384
  *     xmlfile.
  *     """
  *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
@@ -159377,14 +159505,14 @@ static int __pyx_pf_4lxml_5etree_8htmlfile___init__(struct __pyx_obj_4lxml_5etre
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__init__", 0);
 
-  /* "src/lxml/serializer.pxi":1380
+  /* "src/lxml/serializer.pxi":1385
  *     """
  *     def __init__(self, *args, **kwargs):
  *         super().__init__(*args, **kwargs)             # <<<<<<<<<<<<<<
  *         self.method = OUTPUT_METHOD_HTML
  * 
  */
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1380, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1385, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_htmlfile));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_htmlfile));
@@ -159392,18 +159520,18 @@ static int __pyx_pf_4lxml_5etree_8htmlfile___init__(struct __pyx_obj_4lxml_5etre
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1380, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1385, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1380, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1385, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1380, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1385, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1381
+  /* "src/lxml/serializer.pxi":1386
  *     def __init__(self, *args, **kwargs):
  *         super().__init__(*args, **kwargs)
  *         self.method = OUTPUT_METHOD_HTML             # <<<<<<<<<<<<<<
@@ -159412,7 +159540,7 @@ static int __pyx_pf_4lxml_5etree_8htmlfile___init__(struct __pyx_obj_4lxml_5etre
  */
   __pyx_v_self->__pyx_base.method = __pyx_e_4lxml_5etree_OUTPUT_METHOD_HTML;
 
-  /* "src/lxml/serializer.pxi":1379
+  /* "src/lxml/serializer.pxi":1384
  *     xmlfile.
  *     """
  *     def __init__(self, *args, **kwargs):             # <<<<<<<<<<<<<<
@@ -159433,7 +159561,7 @@ static int __pyx_pf_4lxml_5etree_8htmlfile___init__(struct __pyx_obj_4lxml_5etre
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1404
+/* "src/lxml/serializer.pxi":1409
  *     cdef bint _buffered
  * 
  *     def __cinit__(self, outfile, bytes encoding, int compresslevel, bint close,             # <<<<<<<<<<<<<<
@@ -159487,35 +159615,35 @@ static int __pyx_pw_4lxml_5etree_22_IncrementalFileWriter_1__cinit__(PyObject *_
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(9, 1404, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(9, 1409, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compresslevel)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(9, 1404, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(9, 1409, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(9, 1404, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(9, 1409, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  4:
         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffered)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(9, 1404, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(9, 1409, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  5:
         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(9, 1404, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(9, 1409, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1404, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1409, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
       goto __pyx_L5_argtuple_error;
@@ -159529,20 +159657,20 @@ static int __pyx_pw_4lxml_5etree_22_IncrementalFileWriter_1__cinit__(PyObject *_
     }
     __pyx_v_outfile = values[0];
     __pyx_v_encoding = ((PyObject*)values[1]);
-    __pyx_v_compresslevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_compresslevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1404, __pyx_L3_error)
-    __pyx_v_close = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_close == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1404, __pyx_L3_error)
-    __pyx_v_buffered = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_buffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1405, __pyx_L3_error)
-    __pyx_v_method = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1405, __pyx_L3_error)
+    __pyx_v_compresslevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_compresslevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1409, __pyx_L3_error)
+    __pyx_v_close = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_close == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1409, __pyx_L3_error)
+    __pyx_v_buffered = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_buffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1410, __pyx_L3_error)
+    __pyx_v_method = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1410, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1404, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1409, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._IncrementalFileWriter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyBytes_Type), 1, "encoding", 1))) __PYX_ERR(9, 1404, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyBytes_Type), 1, "encoding", 1))) __PYX_ERR(9, 1409, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)__pyx_v_self), __pyx_v_outfile, __pyx_v_encoding, __pyx_v_compresslevel, __pyx_v_close, __pyx_v_buffered, __pyx_v_method);
 
   /* function exit code */
@@ -159567,7 +159695,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   __Pyx_RefNannySetupContext("__cinit__", 0);
   __Pyx_INCREF(__pyx_v_encoding);
 
-  /* "src/lxml/serializer.pxi":1406
+  /* "src/lxml/serializer.pxi":1411
  *     def __cinit__(self, outfile, bytes encoding, int compresslevel, bint close,
  *                   bint buffered, int method):
  *         self._status = WRITER_STARTING             # <<<<<<<<<<<<<<
@@ -159576,14 +159704,14 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
  */
   __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_STARTING;
 
-  /* "src/lxml/serializer.pxi":1407
+  /* "src/lxml/serializer.pxi":1412
  *                   bint buffered, int method):
  *         self._status = WRITER_STARTING
  *         self._element_stack = []             # <<<<<<<<<<<<<<
  *         if encoding is None:
  *             encoding = b'ASCII'
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1407, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1412, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_element_stack);
@@ -159591,7 +159719,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   __pyx_v_self->_element_stack = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1408
+  /* "src/lxml/serializer.pxi":1413
  *         self._status = WRITER_STARTING
  *         self._element_stack = []
  *         if encoding is None:             # <<<<<<<<<<<<<<
@@ -159602,7 +159730,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/serializer.pxi":1409
+    /* "src/lxml/serializer.pxi":1414
  *         self._element_stack = []
  *         if encoding is None:
  *             encoding = b'ASCII'             # <<<<<<<<<<<<<<
@@ -159612,7 +159740,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
     __Pyx_INCREF(__pyx_n_b_ASCII);
     __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_n_b_ASCII);
 
-    /* "src/lxml/serializer.pxi":1408
+    /* "src/lxml/serializer.pxi":1413
  *         self._status = WRITER_STARTING
  *         self._element_stack = []
  *         if encoding is None:             # <<<<<<<<<<<<<<
@@ -159621,7 +159749,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
  */
   }
 
-  /* "src/lxml/serializer.pxi":1410
+  /* "src/lxml/serializer.pxi":1415
  *         if encoding is None:
  *             encoding = b'ASCII'
  *         self._encoding = encoding             # <<<<<<<<<<<<<<
@@ -159634,7 +159762,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   __Pyx_DECREF(__pyx_v_self->_encoding);
   __pyx_v_self->_encoding = __pyx_v_encoding;
 
-  /* "src/lxml/serializer.pxi":1411
+  /* "src/lxml/serializer.pxi":1416
  *             encoding = b'ASCII'
  *         self._encoding = encoding
  *         self._c_encoding = _cstr(encoding) if encoding is not None else NULL             # <<<<<<<<<<<<<<
@@ -159649,7 +159777,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   }
   __pyx_v_self->_c_encoding = __pyx_t_4;
 
-  /* "src/lxml/serializer.pxi":1412
+  /* "src/lxml/serializer.pxi":1417
  *         self._encoding = encoding
  *         self._c_encoding = _cstr(encoding) if encoding is not None else NULL
  *         self._buffered = buffered             # <<<<<<<<<<<<<<
@@ -159658,14 +159786,14 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
  */
   __pyx_v_self->_buffered = __pyx_v_buffered;
 
-  /* "src/lxml/serializer.pxi":1413
+  /* "src/lxml/serializer.pxi":1418
  *         self._c_encoding = _cstr(encoding) if encoding is not None else NULL
  *         self._buffered = buffered
  *         self._target = _create_output_buffer(             # <<<<<<<<<<<<<<
  *             outfile, self._c_encoding, compresslevel, &self._c_out, close)
  *         self._method = method
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__create_output_buffer(__pyx_v_outfile, __pyx_v_self->_c_encoding, __pyx_v_compresslevel, (&__pyx_v_self->_c_out), __pyx_v_close)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1413, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__create_output_buffer(__pyx_v_outfile, __pyx_v_self->_c_encoding, __pyx_v_compresslevel, (&__pyx_v_self->_c_out), __pyx_v_close)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1418, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_target);
@@ -159673,7 +159801,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   __pyx_v_self->_target = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1415
+  /* "src/lxml/serializer.pxi":1420
  *         self._target = _create_output_buffer(
  *             outfile, self._c_encoding, compresslevel, &self._c_out, close)
  *         self._method = method             # <<<<<<<<<<<<<<
@@ -159682,7 +159810,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
  */
   __pyx_v_self->_method = __pyx_v_method;
 
-  /* "src/lxml/serializer.pxi":1404
+  /* "src/lxml/serializer.pxi":1409
  *     cdef bint _buffered
  * 
  *     def __cinit__(self, outfile, bytes encoding, int compresslevel, bint close,             # <<<<<<<<<<<<<<
@@ -159703,7 +159831,7 @@ static int __pyx_pf_4lxml_5etree_22_IncrementalFileWriter___cinit__(struct __pyx
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1417
+/* "src/lxml/serializer.pxi":1422
  *         self._method = method
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -159727,7 +159855,7 @@ static void __pyx_pf_4lxml_5etree_22_IncrementalFileWriter_2__dealloc__(struct _
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__dealloc__", 0);
 
-  /* "src/lxml/serializer.pxi":1418
+  /* "src/lxml/serializer.pxi":1423
  * 
  *     def __dealloc__(self):
  *         if self._c_out is not NULL:             # <<<<<<<<<<<<<<
@@ -159737,7 +159865,7 @@ static void __pyx_pf_4lxml_5etree_22_IncrementalFileWriter_2__dealloc__(struct _
   __pyx_t_1 = ((__pyx_v_self->_c_out != NULL) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1419
+    /* "src/lxml/serializer.pxi":1424
  *     def __dealloc__(self):
  *         if self._c_out is not NULL:
  *             tree.xmlOutputBufferClose(self._c_out)             # <<<<<<<<<<<<<<
@@ -159746,7 +159874,7 @@ static void __pyx_pf_4lxml_5etree_22_IncrementalFileWriter_2__dealloc__(struct _
  */
     (void)(xmlOutputBufferClose(__pyx_v_self->_c_out));
 
-    /* "src/lxml/serializer.pxi":1418
+    /* "src/lxml/serializer.pxi":1423
  * 
  *     def __dealloc__(self):
  *         if self._c_out is not NULL:             # <<<<<<<<<<<<<<
@@ -159755,7 +159883,7 @@ static void __pyx_pf_4lxml_5etree_22_IncrementalFileWriter_2__dealloc__(struct _
  */
   }
 
-  /* "src/lxml/serializer.pxi":1417
+  /* "src/lxml/serializer.pxi":1422
  *         self._method = method
  * 
  *     def __dealloc__(self):             # <<<<<<<<<<<<<<
@@ -159767,7 +159895,7 @@ static void __pyx_pf_4lxml_5etree_22_IncrementalFileWriter_2__dealloc__(struct _
   __Pyx_RefNannyFinishContext();
 }
 
-/* "src/lxml/serializer.pxi":1421
+/* "src/lxml/serializer.pxi":1426
  *             tree.xmlOutputBufferClose(self._c_out)
  * 
  *     def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
@@ -159829,7 +159957,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_5write_declarati
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_declaration") < 0)) __PYX_ERR(9, 1421, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_declaration") < 0)) __PYX_ERR(9, 1426, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -159849,7 +159977,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_5write_declarati
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_declaration", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1421, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write_declaration", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1426, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._IncrementalFileWriter.write_declaration", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -159881,7 +160009,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __Pyx_INCREF(__pyx_v_version);
   __Pyx_INCREF(__pyx_v_doctype);
 
-  /* "src/lxml/serializer.pxi":1426
+  /* "src/lxml/serializer.pxi":1431
  *         Write an XML declaration and (optionally) a doctype into the file.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -159892,12 +160020,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1426, __pyx_L1_error)
+      __PYX_ERR(9, 1431, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1429
+  /* "src/lxml/serializer.pxi":1434
  *         cdef const_xmlChar* c_version
  *         cdef int c_standalone
  *         if self._method != OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<<
@@ -159907,14 +160035,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __pyx_t_1 = ((__pyx_v_self->_method != __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1430
+    /* "src/lxml/serializer.pxi":1435
  *         cdef int c_standalone
  *         if self._method != OUTPUT_METHOD_XML:
  *             raise LxmlSyntaxError("only XML documents have declarations")             # <<<<<<<<<<<<<<
  *         if self._status >= WRITER_DECL_WRITTEN:
  *             raise LxmlSyntaxError("XML declaration already written")
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1430, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1435, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -159928,14 +160056,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_only_XML_documents_have_declarat) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_only_XML_documents_have_declarat);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1430, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1435, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1430, __pyx_L1_error)
+    __PYX_ERR(9, 1435, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1429
+    /* "src/lxml/serializer.pxi":1434
  *         cdef const_xmlChar* c_version
  *         cdef int c_standalone
  *         if self._method != OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<<
@@ -159944,7 +160072,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
   }
 
-  /* "src/lxml/serializer.pxi":1431
+  /* "src/lxml/serializer.pxi":1436
  *         if self._method != OUTPUT_METHOD_XML:
  *             raise LxmlSyntaxError("only XML documents have declarations")
  *         if self._status >= WRITER_DECL_WRITTEN:             # <<<<<<<<<<<<<<
@@ -159954,14 +160082,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __pyx_t_1 = ((__pyx_v_self->_status >= __pyx_e_4lxml_5etree_WRITER_DECL_WRITTEN) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1432
+    /* "src/lxml/serializer.pxi":1437
  *             raise LxmlSyntaxError("only XML documents have declarations")
  *         if self._status >= WRITER_DECL_WRITTEN:
  *             raise LxmlSyntaxError("XML declaration already written")             # <<<<<<<<<<<<<<
  *         version = _utf8orNone(version)
  *         c_version = _xcstr(version) if version is not None else NULL
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1432, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1437, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -159975,14 +160103,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_XML_declaration_already_written) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_XML_declaration_already_written);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1432, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1437, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1432, __pyx_L1_error)
+    __PYX_ERR(9, 1437, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1431
+    /* "src/lxml/serializer.pxi":1436
  *         if self._method != OUTPUT_METHOD_XML:
  *             raise LxmlSyntaxError("only XML documents have declarations")
  *         if self._status >= WRITER_DECL_WRITTEN:             # <<<<<<<<<<<<<<
@@ -159991,19 +160119,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
   }
 
-  /* "src/lxml/serializer.pxi":1433
+  /* "src/lxml/serializer.pxi":1438
  *         if self._status >= WRITER_DECL_WRITTEN:
  *             raise LxmlSyntaxError("XML declaration already written")
  *         version = _utf8orNone(version)             # <<<<<<<<<<<<<<
  *         c_version = _xcstr(version) if version is not None else NULL
  *         doctype = _utf8orNone(doctype)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1433, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_version); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF_SET(__pyx_v_version, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1434
+  /* "src/lxml/serializer.pxi":1439
  *             raise LxmlSyntaxError("XML declaration already written")
  *         version = _utf8orNone(version)
  *         c_version = _xcstr(version) if version is not None else NULL             # <<<<<<<<<<<<<<
@@ -160018,19 +160146,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   }
   __pyx_v_c_version = __pyx_t_5;
 
-  /* "src/lxml/serializer.pxi":1435
+  /* "src/lxml/serializer.pxi":1440
  *         version = _utf8orNone(version)
  *         c_version = _xcstr(version) if version is not None else NULL
  *         doctype = _utf8orNone(doctype)             # <<<<<<<<<<<<<<
  *         if standalone is None:
  *             c_standalone = -1
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_doctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1435, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__utf8orNone(__pyx_v_doctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1440, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF_SET(__pyx_v_doctype, __pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1436
+  /* "src/lxml/serializer.pxi":1441
  *         c_version = _xcstr(version) if version is not None else NULL
  *         doctype = _utf8orNone(doctype)
  *         if standalone is None:             # <<<<<<<<<<<<<<
@@ -160041,7 +160169,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __pyx_t_6 = (__pyx_t_1 != 0);
   if (__pyx_t_6) {
 
-    /* "src/lxml/serializer.pxi":1437
+    /* "src/lxml/serializer.pxi":1442
  *         doctype = _utf8orNone(doctype)
  *         if standalone is None:
  *             c_standalone = -1             # <<<<<<<<<<<<<<
@@ -160050,7 +160178,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     __pyx_v_c_standalone = -1;
 
-    /* "src/lxml/serializer.pxi":1436
+    /* "src/lxml/serializer.pxi":1441
  *         c_version = _xcstr(version) if version is not None else NULL
  *         doctype = _utf8orNone(doctype)
  *         if standalone is None:             # <<<<<<<<<<<<<<
@@ -160060,7 +160188,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
     goto __pyx_L5;
   }
 
-  /* "src/lxml/serializer.pxi":1439
+  /* "src/lxml/serializer.pxi":1444
  *             c_standalone = -1
  *         else:
  *             c_standalone = 1 if standalone else 0             # <<<<<<<<<<<<<<
@@ -160068,7 +160196,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  *         if doctype is not None:
  */
   /*else*/ {
-    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1439, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_standalone); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1444, __pyx_L1_error)
     if (__pyx_t_6) {
       __pyx_t_7 = 1;
     } else {
@@ -160078,7 +160206,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   }
   __pyx_L5:;
 
-  /* "src/lxml/serializer.pxi":1440
+  /* "src/lxml/serializer.pxi":1445
  *         else:
  *             c_standalone = 1 if standalone else 0
  *         _writeDeclarationToBuffer(self._c_out, c_version, self._c_encoding, c_standalone)             # <<<<<<<<<<<<<<
@@ -160087,7 +160215,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
   __pyx_f_4lxml_5etree__writeDeclarationToBuffer(__pyx_v_self->_c_out, __pyx_v_c_version, __pyx_v_self->_c_encoding, __pyx_v_c_standalone);
 
-  /* "src/lxml/serializer.pxi":1441
+  /* "src/lxml/serializer.pxi":1446
  *             c_standalone = 1 if standalone else 0
  *         _writeDeclarationToBuffer(self._c_out, c_version, self._c_encoding, c_standalone)
  *         if doctype is not None:             # <<<<<<<<<<<<<<
@@ -160098,7 +160226,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __pyx_t_1 = (__pyx_t_6 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1442
+    /* "src/lxml/serializer.pxi":1447
  *         _writeDeclarationToBuffer(self._c_out, c_version, self._c_encoding, c_standalone)
  *         if doctype is not None:
  *             _writeDoctype(self._c_out, _xcstr(doctype))             # <<<<<<<<<<<<<<
@@ -160107,7 +160235,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     __pyx_f_4lxml_5etree__writeDoctype(__pyx_v_self->_c_out, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_doctype));
 
-    /* "src/lxml/serializer.pxi":1443
+    /* "src/lxml/serializer.pxi":1448
  *         if doctype is not None:
  *             _writeDoctype(self._c_out, _xcstr(doctype))
  *             self._status = WRITER_DTD_WRITTEN             # <<<<<<<<<<<<<<
@@ -160116,7 +160244,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_DTD_WRITTEN;
 
-    /* "src/lxml/serializer.pxi":1441
+    /* "src/lxml/serializer.pxi":1446
  *             c_standalone = 1 if standalone else 0
  *         _writeDeclarationToBuffer(self._c_out, c_version, self._c_encoding, c_standalone)
  *         if doctype is not None:             # <<<<<<<<<<<<<<
@@ -160126,7 +160254,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
     goto __pyx_L6;
   }
 
-  /* "src/lxml/serializer.pxi":1445
+  /* "src/lxml/serializer.pxi":1450
  *             self._status = WRITER_DTD_WRITTEN
  *         else:
  *             self._status = WRITER_DECL_WRITTEN             # <<<<<<<<<<<<<<
@@ -160138,7 +160266,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   }
   __pyx_L6:;
 
-  /* "src/lxml/serializer.pxi":1446
+  /* "src/lxml/serializer.pxi":1451
  *         else:
  *             self._status = WRITER_DECL_WRITTEN
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -160148,7 +160276,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   __pyx_t_1 = ((!(__pyx_v_self->_buffered != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1447
+    /* "src/lxml/serializer.pxi":1452
  *             self._status = WRITER_DECL_WRITTEN
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -160157,7 +160285,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
     (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-    /* "src/lxml/serializer.pxi":1446
+    /* "src/lxml/serializer.pxi":1451
  *         else:
  *             self._status = WRITER_DECL_WRITTEN
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -160166,18 +160294,18 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
  */
   }
 
-  /* "src/lxml/serializer.pxi":1448
+  /* "src/lxml/serializer.pxi":1453
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)
  *         self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *     def write_doctype(self, doctype):
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1448, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1453, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1421
+  /* "src/lxml/serializer.pxi":1426
  *             tree.xmlOutputBufferClose(self._c_out)
  * 
  *     def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
@@ -160202,7 +160330,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_4write_declarati
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1450
+/* "src/lxml/serializer.pxi":1455
  *         self._handle_error(self._c_out.error)
  * 
  *     def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
@@ -160239,7 +160367,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   __Pyx_RefNannySetupContext("write_doctype", 0);
   __Pyx_INCREF(__pyx_v_doctype);
 
-  /* "src/lxml/serializer.pxi":1455
+  /* "src/lxml/serializer.pxi":1460
  *         Writes the given doctype declaration verbatimly into the file.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -160250,12 +160378,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1455, __pyx_L1_error)
+      __PYX_ERR(9, 1460, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1456
+  /* "src/lxml/serializer.pxi":1461
  *         """
  *         assert self._c_out is not NULL
  *         if doctype is None:             # <<<<<<<<<<<<<<
@@ -160266,7 +160394,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1457
+    /* "src/lxml/serializer.pxi":1462
  *         assert self._c_out is not NULL
  *         if doctype is None:
  *             return             # <<<<<<<<<<<<<<
@@ -160277,7 +160405,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1456
+    /* "src/lxml/serializer.pxi":1461
  *         """
  *         assert self._c_out is not NULL
  *         if doctype is None:             # <<<<<<<<<<<<<<
@@ -160286,7 +160414,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
   }
 
-  /* "src/lxml/serializer.pxi":1458
+  /* "src/lxml/serializer.pxi":1463
  *         if doctype is None:
  *             return
  *         if self._status >= WRITER_DTD_WRITTEN:             # <<<<<<<<<<<<<<
@@ -160296,14 +160424,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   __pyx_t_2 = ((__pyx_v_self->_status >= __pyx_e_4lxml_5etree_WRITER_DTD_WRITTEN) != 0);
   if (unlikely(__pyx_t_2)) {
 
-    /* "src/lxml/serializer.pxi":1459
+    /* "src/lxml/serializer.pxi":1464
  *             return
  *         if self._status >= WRITER_DTD_WRITTEN:
  *             raise LxmlSyntaxError("DOCTYPE already written or cannot write it here")             # <<<<<<<<<<<<<<
  *         doctype = _utf8(doctype)
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1459, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1464, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -160317,14 +160445,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
     }
     __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_DOCTYPE_already_written_or_canno) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_DOCTYPE_already_written_or_canno);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1459, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1464, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_Raise(__pyx_t_3, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-    __PYX_ERR(9, 1459, __pyx_L1_error)
+    __PYX_ERR(9, 1464, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1458
+    /* "src/lxml/serializer.pxi":1463
  *         if doctype is None:
  *             return
  *         if self._status >= WRITER_DTD_WRITTEN:             # <<<<<<<<<<<<<<
@@ -160333,19 +160461,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
   }
 
-  /* "src/lxml/serializer.pxi":1460
+  /* "src/lxml/serializer.pxi":1465
  *         if self._status >= WRITER_DTD_WRITTEN:
  *             raise LxmlSyntaxError("DOCTYPE already written or cannot write it here")
  *         doctype = _utf8(doctype)             # <<<<<<<<<<<<<<
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  *         self._status = WRITER_DTD_WRITTEN
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_doctype); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1460, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_doctype); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1465, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF_SET(__pyx_v_doctype, __pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1461
+  /* "src/lxml/serializer.pxi":1466
  *             raise LxmlSyntaxError("DOCTYPE already written or cannot write it here")
  *         doctype = _utf8(doctype)
  *         _writeDoctype(self._c_out, _xcstr(doctype))             # <<<<<<<<<<<<<<
@@ -160354,7 +160482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
   __pyx_f_4lxml_5etree__writeDoctype(__pyx_v_self->_c_out, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_doctype));
 
-  /* "src/lxml/serializer.pxi":1462
+  /* "src/lxml/serializer.pxi":1467
  *         doctype = _utf8(doctype)
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  *         self._status = WRITER_DTD_WRITTEN             # <<<<<<<<<<<<<<
@@ -160363,7 +160491,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
   __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_DTD_WRITTEN;
 
-  /* "src/lxml/serializer.pxi":1463
+  /* "src/lxml/serializer.pxi":1468
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  *         self._status = WRITER_DTD_WRITTEN
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -160373,7 +160501,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   __pyx_t_2 = ((!(__pyx_v_self->_buffered != 0)) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1464
+    /* "src/lxml/serializer.pxi":1469
  *         self._status = WRITER_DTD_WRITTEN
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -160382,7 +160510,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
     (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-    /* "src/lxml/serializer.pxi":1463
+    /* "src/lxml/serializer.pxi":1468
  *         _writeDoctype(self._c_out, _xcstr(doctype))
  *         self._status = WRITER_DTD_WRITTEN
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -160391,18 +160519,18 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
  */
   }
 
-  /* "src/lxml/serializer.pxi":1465
+  /* "src/lxml/serializer.pxi":1470
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)
  *         self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *     def method(self, method):
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1465, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1470, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1450
+  /* "src/lxml/serializer.pxi":1455
  *         self._handle_error(self._c_out.error)
  * 
  *     def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
@@ -160426,7 +160554,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_6write_doctype(s
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1467
+/* "src/lxml/serializer.pxi":1472
  *         self._handle_error(self._c_out.error)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
@@ -160463,7 +160591,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("method", 0);
 
-  /* "src/lxml/serializer.pxi":1473
+  /* "src/lxml/serializer.pxi":1478
  *         method is one of (None, 'xml', 'html') where None means 'xml'.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -160474,12 +160602,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1473, __pyx_L1_error)
+      __PYX_ERR(9, 1478, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1474
+  /* "src/lxml/serializer.pxi":1479
  *         """
  *         assert self._c_out is not NULL
  *         c_method = self._method if method is None else _findOutputMethod(method)             # <<<<<<<<<<<<<<
@@ -160490,12 +160618,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   if ((__pyx_t_2 != 0)) {
     __pyx_t_1 = __pyx_v_self->_method;
   } else {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1474, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1479, __pyx_L1_error)
     __pyx_t_1 = __pyx_t_3;
   }
   __pyx_v_c_method = __pyx_t_1;
 
-  /* "src/lxml/serializer.pxi":1475
+  /* "src/lxml/serializer.pxi":1480
  *         assert self._c_out is not NULL
  *         c_method = self._method if method is None else _findOutputMethod(method)
  *         return _MethodChanger(self, c_method)             # <<<<<<<<<<<<<<
@@ -160503,9 +160631,9 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_c_method); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1475, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_c_method); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1480, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1475, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1480, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -160513,14 +160641,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   __Pyx_GIVEREF(__pyx_t_4);
   PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1475, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1480, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_r = __pyx_t_4;
   __pyx_t_4 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1467
+  /* "src/lxml/serializer.pxi":1472
  *         self._handle_error(self._c_out.error)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
@@ -160540,7 +160668,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_8method(struct _
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1477
+/* "src/lxml/serializer.pxi":1482
  *         return _MethodChanger(self, c_method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
@@ -160612,7 +160740,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_11element(PyObje
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "element") < 0)) __PYX_ERR(9, 1477, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "element") < 0)) __PYX_ERR(9, 1482, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -160634,7 +160762,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_11element(PyObje
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("element", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1477, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("element", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1482, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
   __Pyx_AddTraceback("lxml.etree._IncrementalFileWriter.element", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -160678,7 +160806,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("element", 0);
 
-  /* "src/lxml/serializer.pxi":1483
+  /* "src/lxml/serializer.pxi":1488
  *         method is one of (None, 'xml', 'html') where None means 'xml'.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -160689,24 +160817,24 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1483, __pyx_L1_error)
+      __PYX_ERR(9, 1488, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1484
+  /* "src/lxml/serializer.pxi":1489
  *         """
  *         assert self._c_out is not NULL
  *         attributes = []             # <<<<<<<<<<<<<<
  *         if attrib is not None:
  *             for name, value in _iter_attrib(attrib):
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1484, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_attributes = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1485
+  /* "src/lxml/serializer.pxi":1490
  *         assert self._c_out is not NULL
  *         attributes = []
  *         if attrib is not None:             # <<<<<<<<<<<<<<
@@ -160717,22 +160845,22 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/serializer.pxi":1486
+    /* "src/lxml/serializer.pxi":1491
  *         attributes = []
  *         if attrib is not None:
  *             for name, value in _iter_attrib(attrib):             # <<<<<<<<<<<<<<
  *                 if name not in _extra:
  *                     ns, name = _getNsTag(name)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__iter_attrib(__pyx_v_attrib); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1486, __pyx_L1_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__iter_attrib(__pyx_v_attrib); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1491, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
       __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
       __pyx_t_6 = NULL;
     } else {
-      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1486, __pyx_L1_error)
+      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1491, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1486, __pyx_L1_error)
+      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1491, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     for (;;) {
@@ -160740,17 +160868,17 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (likely(PyList_CheckExact(__pyx_t_4))) {
           if (__pyx_t_5 >= 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_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1486, __pyx_L1_error)
+          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1491, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1486, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1491, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         } else {
           if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1486, __pyx_L1_error)
+          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1491, __pyx_L1_error)
           #else
-          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1486, __pyx_L1_error)
+          __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1491, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -160760,7 +160888,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(9, 1486, __pyx_L1_error)
+            else __PYX_ERR(9, 1491, __pyx_L1_error)
           }
           break;
         }
@@ -160772,7 +160900,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1486, __pyx_L1_error)
+          __PYX_ERR(9, 1491, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -160785,15 +160913,15 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_INCREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_t_8);
         #else
-        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1486, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1491, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1486, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1491, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         #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(9, 1486, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1491, __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;
@@ -160801,7 +160929,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_GOTREF(__pyx_t_7);
         index = 1; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_8);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(9, 1486, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(9, 1491, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L7_unpacking_done;
@@ -160809,7 +160937,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1486, __pyx_L1_error)
+        __PYX_ERR(9, 1491, __pyx_L1_error)
         __pyx_L7_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
@@ -160817,25 +160945,25 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8);
       __pyx_t_8 = 0;
 
-      /* "src/lxml/serializer.pxi":1487
+      /* "src/lxml/serializer.pxi":1492
  *         if attrib is not None:
  *             for name, value in _iter_attrib(attrib):
  *                 if name not in _extra:             # <<<<<<<<<<<<<<
  *                     ns, name = _getNsTag(name)
  *                     attributes.append((ns, name, _utf8(value)))
  */
-      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v__extra, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1487, __pyx_L1_error)
+      __pyx_t_3 = (__Pyx_PyDict_ContainsTF(__pyx_v_name, __pyx_v__extra, Py_NE)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(9, 1492, __pyx_L1_error)
       __pyx_t_2 = (__pyx_t_3 != 0);
       if (__pyx_t_2) {
 
-        /* "src/lxml/serializer.pxi":1488
+        /* "src/lxml/serializer.pxi":1493
  *             for name, value in _iter_attrib(attrib):
  *                 if name not in _extra:
  *                     ns, name = _getNsTag(name)             # <<<<<<<<<<<<<<
  *                     attributes.append((ns, name, _utf8(value)))
  *         if _extra:
  */
-        __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1488, __pyx_L1_error)
+        __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1493, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         if (likely(__pyx_t_1 != Py_None)) {
           PyObject* sequence = __pyx_t_1;
@@ -160843,7 +160971,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
           if (unlikely(size != 2)) {
             if (size > 2) __Pyx_RaiseTooManyValuesError(2);
             else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-            __PYX_ERR(9, 1488, __pyx_L1_error)
+            __PYX_ERR(9, 1493, __pyx_L1_error)
           }
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
           __pyx_t_8 = PyTuple_GET_ITEM(sequence, 0); 
@@ -160851,30 +160979,30 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
           __Pyx_INCREF(__pyx_t_8);
           __Pyx_INCREF(__pyx_t_7);
           #else
-          __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1488, __pyx_L1_error)
+          __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1493, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
-          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1488, __pyx_L1_error)
+          __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1493, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_7);
           #endif
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         } else {
-          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1488, __pyx_L1_error)
+          __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1493, __pyx_L1_error)
         }
         __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_8);
         __pyx_t_8 = 0;
         __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_7);
         __pyx_t_7 = 0;
 
-        /* "src/lxml/serializer.pxi":1489
+        /* "src/lxml/serializer.pxi":1494
  *                 if name not in _extra:
  *                     ns, name = _getNsTag(name)
  *                     attributes.append((ns, name, _utf8(value)))             # <<<<<<<<<<<<<<
  *         if _extra:
  *             for name, value in _extra.iteritems():
  */
-        __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1489, __pyx_L1_error)
+        __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1494, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1489, __pyx_L1_error)
+        __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1494, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_v_ns);
         __Pyx_GIVEREF(__pyx_v_ns);
@@ -160885,10 +161013,10 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_GIVEREF(__pyx_t_1);
         PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_1);
         __pyx_t_1 = 0;
-        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1489, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_7); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1494, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
-        /* "src/lxml/serializer.pxi":1487
+        /* "src/lxml/serializer.pxi":1492
  *         if attrib is not None:
  *             for name, value in _iter_attrib(attrib):
  *                 if name not in _extra:             # <<<<<<<<<<<<<<
@@ -160897,7 +161025,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  */
       }
 
-      /* "src/lxml/serializer.pxi":1486
+      /* "src/lxml/serializer.pxi":1491
  *         attributes = []
  *         if attrib is not None:
  *             for name, value in _iter_attrib(attrib):             # <<<<<<<<<<<<<<
@@ -160907,7 +161035,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1485
+    /* "src/lxml/serializer.pxi":1490
  *         assert self._c_out is not NULL
  *         attributes = []
  *         if attrib is not None:             # <<<<<<<<<<<<<<
@@ -160916,17 +161044,17 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  */
   }
 
-  /* "src/lxml/serializer.pxi":1490
+  /* "src/lxml/serializer.pxi":1495
  *                     ns, name = _getNsTag(name)
  *                     attributes.append((ns, name, _utf8(value)))
  *         if _extra:             # <<<<<<<<<<<<<<
  *             for name, value in _extra.iteritems():
  *                 ns, name = _getNsTag(name)
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__extra); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1490, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v__extra); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1495, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1491
+    /* "src/lxml/serializer.pxi":1496
  *                     attributes.append((ns, name, _utf8(value)))
  *         if _extra:
  *             for name, value in _extra.iteritems():             # <<<<<<<<<<<<<<
@@ -160934,7 +161062,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  *                 attributes.append((ns, name, _utf8(value)))
  */
     __pyx_t_5 = 0;
-    __pyx_t_7 = __Pyx_dict_iterator(__pyx_v__extra, 1, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1491, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_dict_iterator(__pyx_v__extra, 1, __pyx_n_s_iteritems, (&__pyx_t_12), (&__pyx_t_13)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1496, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_XDECREF(__pyx_t_4);
     __pyx_t_4 = __pyx_t_7;
@@ -160942,7 +161070,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     while (1) {
       __pyx_t_14 = __Pyx_dict_iter_next(__pyx_t_4, __pyx_t_12, &__pyx_t_5, &__pyx_t_7, &__pyx_t_1, NULL, __pyx_t_13);
       if (unlikely(__pyx_t_14 == 0)) break;
-      if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(9, 1491, __pyx_L1_error)
+      if (unlikely(__pyx_t_14 == -1)) __PYX_ERR(9, 1496, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
@@ -160950,14 +161078,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
       __pyx_t_1 = 0;
 
-      /* "src/lxml/serializer.pxi":1492
+      /* "src/lxml/serializer.pxi":1497
  *         if _extra:
  *             for name, value in _extra.iteritems():
  *                 ns, name = _getNsTag(name)             # <<<<<<<<<<<<<<
  *                 attributes.append((ns, name, _utf8(value)))
  *         reversed_nsmap = {}
  */
-      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1492, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1497, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
       if (likely(__pyx_t_1 != Py_None)) {
         PyObject* sequence = __pyx_t_1;
@@ -160965,7 +161093,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1492, __pyx_L1_error)
+          __PYX_ERR(9, 1497, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
@@ -160973,30 +161101,30 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_INCREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_t_8);
         #else
-        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1492, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1497, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1492, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1497, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         #endif
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       } else {
-        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1492, __pyx_L1_error)
+        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1497, __pyx_L1_error)
       }
       __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
       __pyx_t_7 = 0;
       __Pyx_DECREF_SET(__pyx_v_name, __pyx_t_8);
       __pyx_t_8 = 0;
 
-      /* "src/lxml/serializer.pxi":1493
+      /* "src/lxml/serializer.pxi":1498
  *             for name, value in _extra.iteritems():
  *                 ns, name = _getNsTag(name)
  *                 attributes.append((ns, name, _utf8(value)))             # <<<<<<<<<<<<<<
  *         reversed_nsmap = {}
  *         if nsmap:
  */
-      __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1493, __pyx_L1_error)
+      __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1498, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1493, __pyx_L1_error)
+      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1498, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_INCREF(__pyx_v_ns);
       __Pyx_GIVEREF(__pyx_v_ns);
@@ -161007,12 +161135,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __Pyx_GIVEREF(__pyx_t_1);
       PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_1);
       __pyx_t_1 = 0;
-      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1493, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_attributes, __pyx_t_8); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1498, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1490
+    /* "src/lxml/serializer.pxi":1495
  *                     ns, name = _getNsTag(name)
  *                     attributes.append((ns, name, _utf8(value)))
  *         if _extra:             # <<<<<<<<<<<<<<
@@ -161021,36 +161149,36 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  */
   }
 
-  /* "src/lxml/serializer.pxi":1494
+  /* "src/lxml/serializer.pxi":1499
  *                 ns, name = _getNsTag(name)
  *                 attributes.append((ns, name, _utf8(value)))
  *         reversed_nsmap = {}             # <<<<<<<<<<<<<<
  *         if nsmap:
  *             for prefix, ns in nsmap.items():
  */
-  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1494, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_reversed_nsmap = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1495
+  /* "src/lxml/serializer.pxi":1500
  *                 attributes.append((ns, name, _utf8(value)))
  *         reversed_nsmap = {}
  *         if nsmap:             # <<<<<<<<<<<<<<
  *             for prefix, ns in nsmap.items():
  *                 if prefix is not None:
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1495, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1500, __pyx_L1_error)
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1496
+    /* "src/lxml/serializer.pxi":1501
  *         reversed_nsmap = {}
  *         if nsmap:
  *             for prefix, ns in nsmap.items():             # <<<<<<<<<<<<<<
  *                 if prefix is not None:
  *                     prefix = _utf8(prefix)
  */
-    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1496, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_nsmap, __pyx_n_s_items); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1501, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
     __pyx_t_1 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -161064,16 +161192,16 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     }
     __pyx_t_4 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1496, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1501, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
       __pyx_t_8 = __pyx_t_4; __Pyx_INCREF(__pyx_t_8); __pyx_t_12 = 0;
       __pyx_t_6 = NULL;
     } else {
-      __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1496, __pyx_L1_error)
+      __pyx_t_12 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1501, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
-      __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1496, __pyx_L1_error)
+      __pyx_t_6 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1501, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
@@ -161081,17 +161209,17 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (likely(PyList_CheckExact(__pyx_t_8))) {
           if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_8)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(9, 1496, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(9, 1501, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1496, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1501, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
           #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(9, 1496, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(9, 1501, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1496, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_8, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1501, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -161101,7 +161229,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(9, 1496, __pyx_L1_error)
+            else __PYX_ERR(9, 1501, __pyx_L1_error)
           }
           break;
         }
@@ -161113,7 +161241,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1496, __pyx_L1_error)
+          __PYX_ERR(9, 1501, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -161126,15 +161254,15 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_INCREF(__pyx_t_1);
         __Pyx_INCREF(__pyx_t_7);
         #else
-        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1496, __pyx_L1_error)
+        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1501, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1496, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1501, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
         #endif
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1496, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1501, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
@@ -161142,7 +161270,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_GOTREF(__pyx_t_1);
         index = 1; __pyx_t_7 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_7)) goto __pyx_L15_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_7);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(9, 1496, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(9, 1501, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L16_unpacking_done;
@@ -161150,7 +161278,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1496, __pyx_L1_error)
+        __PYX_ERR(9, 1501, __pyx_L1_error)
         __pyx_L16_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_1);
@@ -161158,7 +161286,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_7);
       __pyx_t_7 = 0;
 
-      /* "src/lxml/serializer.pxi":1497
+      /* "src/lxml/serializer.pxi":1502
  *         if nsmap:
  *             for prefix, ns in nsmap.items():
  *                 if prefix is not None:             # <<<<<<<<<<<<<<
@@ -161169,28 +161297,28 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
       __pyx_t_3 = (__pyx_t_2 != 0);
       if (__pyx_t_3) {
 
-        /* "src/lxml/serializer.pxi":1498
+        /* "src/lxml/serializer.pxi":1503
  *             for prefix, ns in nsmap.items():
  *                 if prefix is not None:
  *                     prefix = _utf8(prefix)             # <<<<<<<<<<<<<<
  *                     _prefixValidOrRaise(prefix)
  *                 reversed_nsmap[_utf8(ns)] = prefix
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1498, __pyx_L1_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1503, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF_SET(__pyx_v_prefix, __pyx_t_4);
         __pyx_t_4 = 0;
 
-        /* "src/lxml/serializer.pxi":1499
+        /* "src/lxml/serializer.pxi":1504
  *                 if prefix is not None:
  *                     prefix = _utf8(prefix)
  *                     _prefixValidOrRaise(prefix)             # <<<<<<<<<<<<<<
  *                 reversed_nsmap[_utf8(ns)] = prefix
  *         ns, name = _getNsTag(tag)
  */
-        __pyx_t_13 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1499, __pyx_L1_error)
+        __pyx_t_13 = __pyx_f_4lxml_5etree__prefixValidOrRaise(__pyx_v_prefix); if (unlikely(__pyx_t_13 == ((int)-1))) __PYX_ERR(9, 1504, __pyx_L1_error)
 
-        /* "src/lxml/serializer.pxi":1497
+        /* "src/lxml/serializer.pxi":1502
  *         if nsmap:
  *             for prefix, ns in nsmap.items():
  *                 if prefix is not None:             # <<<<<<<<<<<<<<
@@ -161199,19 +161327,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  */
       }
 
-      /* "src/lxml/serializer.pxi":1500
+      /* "src/lxml/serializer.pxi":1505
  *                     prefix = _utf8(prefix)
  *                     _prefixValidOrRaise(prefix)
  *                 reversed_nsmap[_utf8(ns)] = prefix             # <<<<<<<<<<<<<<
  *         ns, name = _getNsTag(tag)
  * 
  */
-      __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1500, __pyx_L1_error)
+      __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1505, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      if (unlikely(PyDict_SetItem(__pyx_v_reversed_nsmap, __pyx_t_4, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1500, __pyx_L1_error)
+      if (unlikely(PyDict_SetItem(__pyx_v_reversed_nsmap, __pyx_t_4, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1505, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "src/lxml/serializer.pxi":1496
+      /* "src/lxml/serializer.pxi":1501
  *         reversed_nsmap = {}
  *         if nsmap:
  *             for prefix, ns in nsmap.items():             # <<<<<<<<<<<<<<
@@ -161221,7 +161349,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     }
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-    /* "src/lxml/serializer.pxi":1495
+    /* "src/lxml/serializer.pxi":1500
  *                 attributes.append((ns, name, _utf8(value)))
  *         reversed_nsmap = {}
  *         if nsmap:             # <<<<<<<<<<<<<<
@@ -161230,14 +161358,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  */
   }
 
-  /* "src/lxml/serializer.pxi":1501
+  /* "src/lxml/serializer.pxi":1506
  *                     _prefixValidOrRaise(prefix)
  *                 reversed_nsmap[_utf8(ns)] = prefix
  *         ns, name = _getNsTag(tag)             # <<<<<<<<<<<<<<
  * 
  *         c_method = self._method if method is None else _findOutputMethod(method)
  */
-  __pyx_t_8 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1501, __pyx_L1_error)
+  __pyx_t_8 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1506, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   if (likely(__pyx_t_8 != Py_None)) {
     PyObject* sequence = __pyx_t_8;
@@ -161245,7 +161373,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(9, 1501, __pyx_L1_error)
+      __PYX_ERR(9, 1506, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
@@ -161253,21 +161381,21 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
     __Pyx_INCREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_t_7);
     #else
-    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1501, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1501, __pyx_L1_error)
+    __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1506, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     #endif
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
   } else {
-    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1501, __pyx_L1_error)
+    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(9, 1506, __pyx_L1_error)
   }
   __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_4);
   __pyx_t_4 = 0;
   __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
   __pyx_t_7 = 0;
 
-  /* "src/lxml/serializer.pxi":1503
+  /* "src/lxml/serializer.pxi":1508
  *         ns, name = _getNsTag(tag)
  * 
  *         c_method = self._method if method is None else _findOutputMethod(method)             # <<<<<<<<<<<<<<
@@ -161278,12 +161406,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   if ((__pyx_t_3 != 0)) {
     __pyx_t_13 = __pyx_v_self->_method;
   } else {
-    __pyx_t_14 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(9, 1503, __pyx_L1_error)
+    __pyx_t_14 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_14 == ((int)-1))) __PYX_ERR(9, 1508, __pyx_L1_error)
     __pyx_t_13 = __pyx_t_14;
   }
   __pyx_v_c_method = __pyx_t_13;
 
-  /* "src/lxml/serializer.pxi":1505
+  /* "src/lxml/serializer.pxi":1510
  *         c_method = self._method if method is None else _findOutputMethod(method)
  * 
  *         return _FileWriterElement(self, (ns, name, attributes, reversed_nsmap), c_method)             # <<<<<<<<<<<<<<
@@ -161291,7 +161419,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
  *     cdef _write_qname(self, bytes name, bytes prefix):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1505, __pyx_L1_error)
+  __pyx_t_8 = PyTuple_New(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_8);
   __Pyx_INCREF(__pyx_v_ns);
   __Pyx_GIVEREF(__pyx_v_ns);
@@ -161305,9 +161433,9 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   __Pyx_INCREF(__pyx_v_reversed_nsmap);
   __Pyx_GIVEREF(__pyx_v_reversed_nsmap);
   PyTuple_SET_ITEM(__pyx_t_8, 3, __pyx_v_reversed_nsmap);
-  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_c_method); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1505, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_c_method); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1505, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
@@ -161318,14 +161446,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_7);
   __pyx_t_8 = 0;
   __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1505, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement), __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1510, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_7;
   __pyx_t_7 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1477
+  /* "src/lxml/serializer.pxi":1482
  *         return _MethodChanger(self, c_method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
@@ -161354,7 +161482,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_10element(struct
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1507
+/* "src/lxml/serializer.pxi":1512
  *         return _FileWriterElement(self, (ns, name, attributes, reversed_nsmap), c_method)
  * 
  *     cdef _write_qname(self, bytes name, bytes prefix):             # <<<<<<<<<<<<<<
@@ -161372,7 +161500,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_write_qname", 0);
 
-  /* "src/lxml/serializer.pxi":1508
+  /* "src/lxml/serializer.pxi":1513
  * 
  *     cdef _write_qname(self, bytes name, bytes prefix):
  *         if prefix:  # empty bytes for no prefix (not None to allow sorting)             # <<<<<<<<<<<<<<
@@ -161382,7 +161510,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
   __pyx_t_1 = (__pyx_v_prefix != Py_None)&&(PyBytes_GET_SIZE(__pyx_v_prefix) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1509
+    /* "src/lxml/serializer.pxi":1514
  *     cdef _write_qname(self, bytes name, bytes prefix):
  *         if prefix:  # empty bytes for no prefix (not None to allow sorting)
  *             tree.xmlOutputBufferWrite(self._c_out, len(prefix), _cstr(prefix))             # <<<<<<<<<<<<<<
@@ -161391,12 +161519,12 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
  */
     if (unlikely(__pyx_v_prefix == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-      __PYX_ERR(9, 1509, __pyx_L1_error)
+      __PYX_ERR(9, 1514, __pyx_L1_error)
     }
-    __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1509, __pyx_L1_error)
+    __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_prefix); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1514, __pyx_L1_error)
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_2, PyBytes_AS_STRING(__pyx_v_prefix)));
 
-    /* "src/lxml/serializer.pxi":1510
+    /* "src/lxml/serializer.pxi":1515
  *         if prefix:  # empty bytes for no prefix (not None to allow sorting)
  *             tree.xmlOutputBufferWrite(self._c_out, len(prefix), _cstr(prefix))
  *             tree.xmlOutputBufferWrite(self._c_out, 1, ':')             # <<<<<<<<<<<<<<
@@ -161405,7 +161533,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)":")));
 
-    /* "src/lxml/serializer.pxi":1508
+    /* "src/lxml/serializer.pxi":1513
  * 
  *     cdef _write_qname(self, bytes name, bytes prefix):
  *         if prefix:  # empty bytes for no prefix (not None to allow sorting)             # <<<<<<<<<<<<<<
@@ -161414,7 +161542,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
  */
   }
 
-  /* "src/lxml/serializer.pxi":1511
+  /* "src/lxml/serializer.pxi":1516
  *             tree.xmlOutputBufferWrite(self._c_out, len(prefix), _cstr(prefix))
  *             tree.xmlOutputBufferWrite(self._c_out, 1, ':')
  *         tree.xmlOutputBufferWrite(self._c_out, len(name), _cstr(name))             # <<<<<<<<<<<<<<
@@ -161423,12 +161551,12 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
  */
   if (unlikely(__pyx_v_name == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(9, 1511, __pyx_L1_error)
+    __PYX_ERR(9, 1516, __pyx_L1_error)
   }
-  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1511, __pyx_L1_error)
+  __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_name); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1516, __pyx_L1_error)
   (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_2, PyBytes_AS_STRING(__pyx_v_name)));
 
-  /* "src/lxml/serializer.pxi":1507
+  /* "src/lxml/serializer.pxi":1512
  *         return _FileWriterElement(self, (ns, name, attributes, reversed_nsmap), c_method)
  * 
  *     cdef _write_qname(self, bytes name, bytes prefix):             # <<<<<<<<<<<<<<
@@ -161448,7 +161576,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(stru
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1513
+/* "src/lxml/serializer.pxi":1518
  *         tree.xmlOutputBufferWrite(self._c_out, len(name), _cstr(name))
  * 
  *     cdef _write_start_element(self, element_config):             # <<<<<<<<<<<<<<
@@ -161479,7 +161607,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_write_start_element", 0);
 
-  /* "src/lxml/serializer.pxi":1514
+  /* "src/lxml/serializer.pxi":1519
  * 
  *     cdef _write_start_element(self, element_config):
  *         if self._status > WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -161489,14 +161617,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __pyx_t_1 = ((__pyx_v_self->_status > __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1515
+    /* "src/lxml/serializer.pxi":1520
  *     cdef _write_start_element(self, element_config):
  *         if self._status > WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("cannot append trailing element to complete XML document")             # <<<<<<<<<<<<<<
  *         ns, name, attributes, nsmap = element_config
  *         flat_namespace_map, new_namespaces = self._collect_namespaces(nsmap)
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1515, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1520, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -161510,14 +161638,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_cannot_append_trailing_element_t) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_cannot_append_trailing_element_t);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1515, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1520, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1515, __pyx_L1_error)
+    __PYX_ERR(9, 1520, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1514
+    /* "src/lxml/serializer.pxi":1519
  * 
  *     cdef _write_start_element(self, element_config):
  *         if self._status > WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -161526,7 +161654,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   }
 
-  /* "src/lxml/serializer.pxi":1516
+  /* "src/lxml/serializer.pxi":1521
  *         if self._status > WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("cannot append trailing element to complete XML document")
  *         ns, name, attributes, nsmap = element_config             # <<<<<<<<<<<<<<
@@ -161539,7 +161667,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     if (unlikely(size != 4)) {
       if (size > 4) __Pyx_RaiseTooManyValuesError(4);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(9, 1516, __pyx_L1_error)
+      __PYX_ERR(9, 1521, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -161562,7 +161690,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
       Py_ssize_t i;
       PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
       for (i=0; i < 4; i++) {
-        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(9, 1516, __pyx_L1_error)
+        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(9, 1521, __pyx_L1_error)
         __Pyx_GOTREF(item);
         *(temps[i]) = item;
       }
@@ -161571,7 +161699,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   } else {
     Py_ssize_t index = -1;
     PyObject** temps[4] = {&__pyx_t_2,&__pyx_t_3,&__pyx_t_4,&__pyx_t_5};
-    __pyx_t_6 = PyObject_GetIter(__pyx_v_element_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1516, __pyx_L1_error)
+    __pyx_t_6 = PyObject_GetIter(__pyx_v_element_config); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1521, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
     for (index=0; index < 4; index++) {
@@ -161579,7 +161707,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
       __Pyx_GOTREF(item);
       *(temps[index]) = item;
     }
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(9, 1516, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 4) < 0) __PYX_ERR(9, 1521, __pyx_L1_error)
     __pyx_t_7 = NULL;
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     goto __pyx_L5_unpacking_done;
@@ -161587,7 +161715,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_7 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(9, 1516, __pyx_L1_error)
+    __PYX_ERR(9, 1521, __pyx_L1_error)
     __pyx_L5_unpacking_done:;
   }
   __pyx_v_ns = __pyx_t_2;
@@ -161599,15 +161727,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __pyx_v_nsmap = __pyx_t_5;
   __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1517
+  /* "src/lxml/serializer.pxi":1522
  *             raise LxmlSyntaxError("cannot append trailing element to complete XML document")
  *         ns, name, attributes, nsmap = element_config
  *         flat_namespace_map, new_namespaces = self._collect_namespaces(nsmap)             # <<<<<<<<<<<<<<
  *         prefix = self._find_prefix(ns, flat_namespace_map, new_namespaces)
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '<')
  */
-  if (!(likely(PyDict_CheckExact(__pyx_v_nsmap))||((__pyx_v_nsmap) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_nsmap)->tp_name), 0))) __PYX_ERR(9, 1517, __pyx_L1_error)
-  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespaces(__pyx_v_self, ((PyObject*)__pyx_v_nsmap)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1517, __pyx_L1_error)
+  if (!(likely(PyDict_CheckExact(__pyx_v_nsmap))||((__pyx_v_nsmap) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_nsmap)->tp_name), 0))) __PYX_ERR(9, 1522, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespaces(__pyx_v_self, ((PyObject*)__pyx_v_nsmap)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1522, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
     PyObject* sequence = __pyx_t_5;
@@ -161615,7 +161743,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(9, 1517, __pyx_L1_error)
+      __PYX_ERR(9, 1522, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -161628,15 +161756,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     __Pyx_INCREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1517, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1522, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1517, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1522, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1517, __pyx_L1_error)
+    __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1522, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
@@ -161644,7 +161772,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     __Pyx_GOTREF(__pyx_t_4);
     index = 1; __pyx_t_3 = __pyx_t_7(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L6_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(9, 1517, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_2), 2) < 0) __PYX_ERR(9, 1522, __pyx_L1_error)
     __pyx_t_7 = NULL;
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     goto __pyx_L7_unpacking_done;
@@ -161652,7 +161780,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_7 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(9, 1517, __pyx_L1_error)
+    __PYX_ERR(9, 1522, __pyx_L1_error)
     __pyx_L7_unpacking_done:;
   }
   __pyx_v_flat_namespace_map = __pyx_t_4;
@@ -161660,22 +161788,22 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __pyx_v_new_namespaces = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1518
+  /* "src/lxml/serializer.pxi":1523
  *         ns, name, attributes, nsmap = element_config
  *         flat_namespace_map, new_namespaces = self._collect_namespaces(nsmap)
  *         prefix = self._find_prefix(ns, flat_namespace_map, new_namespaces)             # <<<<<<<<<<<<<<
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '<')
  *         self._write_qname(name, prefix)
  */
-  if (!(likely(PyBytes_CheckExact(__pyx_v_ns))||((__pyx_v_ns) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_ns)->tp_name), 0))) __PYX_ERR(9, 1518, __pyx_L1_error)
-  if (!(likely(PyDict_CheckExact(__pyx_v_flat_namespace_map))||((__pyx_v_flat_namespace_map) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_flat_namespace_map)->tp_name), 0))) __PYX_ERR(9, 1518, __pyx_L1_error)
-  if (!(likely(PyList_CheckExact(__pyx_v_new_namespaces))||((__pyx_v_new_namespaces) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_new_namespaces)->tp_name), 0))) __PYX_ERR(9, 1518, __pyx_L1_error)
-  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(__pyx_v_self, ((PyObject*)__pyx_v_ns), ((PyObject*)__pyx_v_flat_namespace_map), ((PyObject*)__pyx_v_new_namespaces)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1518, __pyx_L1_error)
+  if (!(likely(PyBytes_CheckExact(__pyx_v_ns))||((__pyx_v_ns) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_ns)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
+  if (!(likely(PyDict_CheckExact(__pyx_v_flat_namespace_map))||((__pyx_v_flat_namespace_map) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_flat_namespace_map)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
+  if (!(likely(PyList_CheckExact(__pyx_v_new_namespaces))||((__pyx_v_new_namespaces) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_new_namespaces)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(__pyx_v_self, ((PyObject*)__pyx_v_ns), ((PyObject*)__pyx_v_flat_namespace_map), ((PyObject*)__pyx_v_new_namespaces)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1523, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v_prefix = __pyx_t_5;
   __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1519
+  /* "src/lxml/serializer.pxi":1524
  *         flat_namespace_map, new_namespaces = self._collect_namespaces(nsmap)
  *         prefix = self._find_prefix(ns, flat_namespace_map, new_namespaces)
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '<')             # <<<<<<<<<<<<<<
@@ -161684,42 +161812,42 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)"<")));
 
-  /* "src/lxml/serializer.pxi":1520
+  /* "src/lxml/serializer.pxi":1525
  *         prefix = self._find_prefix(ns, flat_namespace_map, new_namespaces)
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '<')
  *         self._write_qname(name, prefix)             # <<<<<<<<<<<<<<
  * 
  *         self._write_attributes_and_namespaces(
  */
-  if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1520, __pyx_L1_error)
-  if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1520, __pyx_L1_error)
-  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1520, __pyx_L1_error)
+  if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1525, __pyx_L1_error)
+  if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1525, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1525, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1523
+  /* "src/lxml/serializer.pxi":1528
  * 
  *         self._write_attributes_and_namespaces(
  *             attributes, flat_namespace_map, new_namespaces)             # <<<<<<<<<<<<<<
  * 
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  */
-  if (!(likely(PyList_CheckExact(__pyx_v_attributes))||((__pyx_v_attributes) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_attributes)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
-  if (!(likely(PyDict_CheckExact(__pyx_v_flat_namespace_map))||((__pyx_v_flat_namespace_map) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_flat_namespace_map)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
-  if (!(likely(PyList_CheckExact(__pyx_v_new_namespaces))||((__pyx_v_new_namespaces) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_new_namespaces)->tp_name), 0))) __PYX_ERR(9, 1523, __pyx_L1_error)
+  if (!(likely(PyList_CheckExact(__pyx_v_attributes))||((__pyx_v_attributes) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_attributes)->tp_name), 0))) __PYX_ERR(9, 1528, __pyx_L1_error)
+  if (!(likely(PyDict_CheckExact(__pyx_v_flat_namespace_map))||((__pyx_v_flat_namespace_map) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_flat_namespace_map)->tp_name), 0))) __PYX_ERR(9, 1528, __pyx_L1_error)
+  if (!(likely(PyList_CheckExact(__pyx_v_new_namespaces))||((__pyx_v_new_namespaces) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_new_namespaces)->tp_name), 0))) __PYX_ERR(9, 1528, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1522
+  /* "src/lxml/serializer.pxi":1527
  *         self._write_qname(name, prefix)
  * 
  *         self._write_attributes_and_namespaces(             # <<<<<<<<<<<<<<
  *             attributes, flat_namespace_map, new_namespaces)
  * 
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_and_namespaces(__pyx_v_self, ((PyObject*)__pyx_v_attributes), ((PyObject*)__pyx_v_flat_namespace_map), ((PyObject*)__pyx_v_new_namespaces)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1522, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_and_namespaces(__pyx_v_self, ((PyObject*)__pyx_v_attributes), ((PyObject*)__pyx_v_flat_namespace_map), ((PyObject*)__pyx_v_new_namespaces)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1527, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1525
+  /* "src/lxml/serializer.pxi":1530
  *             attributes, flat_namespace_map, new_namespaces)
  * 
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '>')             # <<<<<<<<<<<<<<
@@ -161728,7 +161856,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)">")));
 
-  /* "src/lxml/serializer.pxi":1526
+  /* "src/lxml/serializer.pxi":1531
  * 
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -161738,7 +161866,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __pyx_t_1 = ((!(__pyx_v_self->_buffered != 0)) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1527
+    /* "src/lxml/serializer.pxi":1532
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -161747,7 +161875,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
     (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-    /* "src/lxml/serializer.pxi":1526
+    /* "src/lxml/serializer.pxi":1531
  * 
  *         tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -161756,18 +161884,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   }
 
-  /* "src/lxml/serializer.pxi":1528
+  /* "src/lxml/serializer.pxi":1533
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)
  *         self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *         self._element_stack.append((ns, name, prefix, flat_namespace_map))
  */
-  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1528, __pyx_L1_error)
+  __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1533, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1530
+  /* "src/lxml/serializer.pxi":1535
  *         self._handle_error(self._c_out.error)
  * 
  *         self._element_stack.append((ns, name, prefix, flat_namespace_map))             # <<<<<<<<<<<<<<
@@ -161776,9 +161904,9 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(9, 1530, __pyx_L1_error)
+    __PYX_ERR(9, 1535, __pyx_L1_error)
   }
-  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1530, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1535, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_v_ns);
   __Pyx_GIVEREF(__pyx_v_ns);
@@ -161792,10 +161920,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   __Pyx_INCREF(__pyx_v_flat_namespace_map);
   __Pyx_GIVEREF(__pyx_v_flat_namespace_map);
   PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_flat_namespace_map);
-  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 1530, __pyx_L1_error)
+  __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_element_stack, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(9, 1535, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "src/lxml/serializer.pxi":1531
+  /* "src/lxml/serializer.pxi":1536
  * 
  *         self._element_stack.append((ns, name, prefix, flat_namespace_map))
  *         self._status = WRITER_IN_ELEMENT             # <<<<<<<<<<<<<<
@@ -161804,7 +161932,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
  */
   __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT;
 
-  /* "src/lxml/serializer.pxi":1513
+  /* "src/lxml/serializer.pxi":1518
  *         tree.xmlOutputBufferWrite(self._c_out, len(name), _cstr(name))
  * 
  *     cdef _write_start_element(self, element_config):             # <<<<<<<<<<<<<<
@@ -161836,7 +161964,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_elem
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1533
+/* "src/lxml/serializer.pxi":1538
  *         self._status = WRITER_IN_ELEMENT
  * 
  *     cdef _write_attributes_and_namespaces(self, list attributes,             # <<<<<<<<<<<<<<
@@ -161867,7 +161995,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   __Pyx_RefNannySetupContext("_write_attributes_and_namespaces", 0);
   __Pyx_INCREF(__pyx_v_attributes);
 
-  /* "src/lxml/serializer.pxi":1536
+  /* "src/lxml/serializer.pxi":1541
  *                                           dict flat_namespace_map,
  *                                           list new_namespaces):
  *         if attributes:             # <<<<<<<<<<<<<<
@@ -161877,17 +162005,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   __pyx_t_1 = (__pyx_v_attributes != Py_None)&&(PyList_GET_SIZE(__pyx_v_attributes) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1538
+    /* "src/lxml/serializer.pxi":1543
  *         if attributes:
  *             # _find_prefix() may append to new_namespaces => build them first
  *             attributes = [             # <<<<<<<<<<<<<<
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)
  *                 for ns, name, value in attributes ]
  */
-    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1538, __pyx_L1_error)
+    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1543, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
 
-    /* "src/lxml/serializer.pxi":1540
+    /* "src/lxml/serializer.pxi":1545
  *             attributes = [
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)
  *                 for ns, name, value in attributes ]             # <<<<<<<<<<<<<<
@@ -161896,15 +162024,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
     if (unlikely(__pyx_v_attributes == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-      __PYX_ERR(9, 1540, __pyx_L1_error)
+      __PYX_ERR(9, 1545, __pyx_L1_error)
     }
     __pyx_t_3 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
     for (;;) {
       if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 1540, __pyx_L1_error)
+      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(9, 1545, __pyx_L1_error)
       #else
-      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1540, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1545, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       #endif
       if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
@@ -161913,7 +162041,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
         if (unlikely(size != 3)) {
           if (size > 3) __Pyx_RaiseTooManyValuesError(3);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1540, __pyx_L1_error)
+          __PYX_ERR(9, 1545, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -161929,17 +162057,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
         __Pyx_INCREF(__pyx_t_7);
         __Pyx_INCREF(__pyx_t_8);
         #else
-        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1540, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1545, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1540, __pyx_L1_error)
+        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1545, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_7);
-        __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1540, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1545, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         #endif
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1540, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(9, 1545, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_t_10 = Py_TYPE(__pyx_t_9)->tp_iternext;
@@ -161949,7 +162077,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
         __Pyx_GOTREF(__pyx_t_7);
         index = 2; __pyx_t_8 = __pyx_t_10(__pyx_t_9); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_8);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(9, 1540, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 3) < 0) __PYX_ERR(9, 1545, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L7_unpacking_done;
@@ -161957,7 +162085,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __pyx_t_10 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1540, __pyx_L1_error)
+        __PYX_ERR(9, 1545, __pyx_L1_error)
         __pyx_L7_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_6);
@@ -161967,17 +162095,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_8);
       __pyx_t_8 = 0;
 
-      /* "src/lxml/serializer.pxi":1539
+      /* "src/lxml/serializer.pxi":1544
  *             # _find_prefix() may append to new_namespaces => build them first
  *             attributes = [
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)             # <<<<<<<<<<<<<<
  *                 for ns, name, value in attributes ]
  *         if new_namespaces:
  */
-      if (!(likely(PyBytes_CheckExact(__pyx_v_ns))||((__pyx_v_ns) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_ns)->tp_name), 0))) __PYX_ERR(9, 1539, __pyx_L1_error)
-      __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(__pyx_v_self, ((PyObject*)__pyx_v_ns), __pyx_v_flat_namespace_map, __pyx_v_new_namespaces); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1539, __pyx_L1_error)
+      if (!(likely(PyBytes_CheckExact(__pyx_v_ns))||((__pyx_v_ns) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_ns)->tp_name), 0))) __PYX_ERR(9, 1544, __pyx_L1_error)
+      __pyx_t_5 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(__pyx_v_self, ((PyObject*)__pyx_v_ns), __pyx_v_flat_namespace_map, __pyx_v_new_namespaces); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1544, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1539, __pyx_L1_error)
+      __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1544, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_8);
       __Pyx_GIVEREF(__pyx_t_5);
       PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
@@ -161988,10 +162116,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       __Pyx_GIVEREF(__pyx_v_value);
       PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_v_value);
       __pyx_t_5 = 0;
-      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(9, 1538, __pyx_L1_error)
+      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(9, 1543, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "src/lxml/serializer.pxi":1540
+      /* "src/lxml/serializer.pxi":1545
  *             attributes = [
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)
  *                 for ns, name, value in attributes ]             # <<<<<<<<<<<<<<
@@ -162003,7 +162131,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
     __Pyx_DECREF_SET(__pyx_v_attributes, ((PyObject*)__pyx_t_2));
     __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1536
+    /* "src/lxml/serializer.pxi":1541
  *                                           dict flat_namespace_map,
  *                                           list new_namespaces):
  *         if attributes:             # <<<<<<<<<<<<<<
@@ -162012,7 +162140,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
   }
 
-  /* "src/lxml/serializer.pxi":1541
+  /* "src/lxml/serializer.pxi":1546
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)
  *                 for ns, name, value in attributes ]
  *         if new_namespaces:             # <<<<<<<<<<<<<<
@@ -162022,7 +162150,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   __pyx_t_1 = (__pyx_v_new_namespaces != Py_None)&&(PyList_GET_SIZE(__pyx_v_new_namespaces) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1542
+    /* "src/lxml/serializer.pxi":1547
  *                 for ns, name, value in attributes ]
  *         if new_namespaces:
  *             new_namespaces.sort()             # <<<<<<<<<<<<<<
@@ -162031,22 +162159,22 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
     if (unlikely(__pyx_v_new_namespaces == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "sort");
-      __PYX_ERR(9, 1542, __pyx_L1_error)
+      __PYX_ERR(9, 1547, __pyx_L1_error)
     }
-    __pyx_t_11 = PyList_Sort(__pyx_v_new_namespaces); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1542, __pyx_L1_error)
+    __pyx_t_11 = PyList_Sort(__pyx_v_new_namespaces); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(9, 1547, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1543
+    /* "src/lxml/serializer.pxi":1548
  *         if new_namespaces:
  *             new_namespaces.sort()
  *             self._write_attributes_list(new_namespaces)             # <<<<<<<<<<<<<<
  *         if attributes:
  *             self._write_attributes_list(attributes)
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_list(__pyx_v_self, __pyx_v_new_namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1543, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_list(__pyx_v_self, __pyx_v_new_namespaces); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1548, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1541
+    /* "src/lxml/serializer.pxi":1546
  *                 (self._find_prefix(ns, flat_namespace_map, new_namespaces), name, value)
  *                 for ns, name, value in attributes ]
  *         if new_namespaces:             # <<<<<<<<<<<<<<
@@ -162055,7 +162183,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
   }
 
-  /* "src/lxml/serializer.pxi":1544
+  /* "src/lxml/serializer.pxi":1549
  *             new_namespaces.sort()
  *             self._write_attributes_list(new_namespaces)
  *         if attributes:             # <<<<<<<<<<<<<<
@@ -162065,18 +162193,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   __pyx_t_1 = (__pyx_v_attributes != Py_None)&&(PyList_GET_SIZE(__pyx_v_attributes) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1545
+    /* "src/lxml/serializer.pxi":1550
  *             self._write_attributes_list(new_namespaces)
  *         if attributes:
  *             self._write_attributes_list(attributes)             # <<<<<<<<<<<<<<
  * 
  *     cdef _write_attributes_list(self, list attributes):
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_list(__pyx_v_self, __pyx_v_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1545, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes_list(__pyx_v_self, __pyx_v_attributes); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1550, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1544
+    /* "src/lxml/serializer.pxi":1549
  *             new_namespaces.sort()
  *             self._write_attributes_list(new_namespaces)
  *         if attributes:             # <<<<<<<<<<<<<<
@@ -162085,7 +162213,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
   }
 
-  /* "src/lxml/serializer.pxi":1533
+  /* "src/lxml/serializer.pxi":1538
  *         self._status = WRITER_IN_ELEMENT
  * 
  *     cdef _write_attributes_and_namespaces(self, list attributes,             # <<<<<<<<<<<<<<
@@ -162116,7 +162244,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1547
+/* "src/lxml/serializer.pxi":1552
  *             self._write_attributes_list(attributes)
  * 
  *     cdef _write_attributes_list(self, list attributes):             # <<<<<<<<<<<<<<
@@ -162143,7 +162271,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_write_attributes_list", 0);
 
-  /* "src/lxml/serializer.pxi":1548
+  /* "src/lxml/serializer.pxi":1553
  * 
  *     cdef _write_attributes_list(self, list attributes):
  *         for prefix, name, value in attributes:             # <<<<<<<<<<<<<<
@@ -162152,15 +162280,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
   if (unlikely(__pyx_v_attributes == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(9, 1548, __pyx_L1_error)
+    __PYX_ERR(9, 1553, __pyx_L1_error)
   }
   __pyx_t_1 = __pyx_v_attributes; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
   for (;;) {
     if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 1548, __pyx_L1_error)
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(9, 1553, __pyx_L1_error)
     #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1548, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1553, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
@@ -162169,7 +162297,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       if (unlikely(size != 3)) {
         if (size > 3) __Pyx_RaiseTooManyValuesError(3);
         else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-        __PYX_ERR(9, 1548, __pyx_L1_error)
+        __PYX_ERR(9, 1553, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -162185,17 +162313,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       __Pyx_INCREF(__pyx_t_5);
       __Pyx_INCREF(__pyx_t_6);
       #else
-      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1548, __pyx_L1_error)
+      __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1553, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
-      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1548, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1553, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1548, __pyx_L1_error)
+      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1553, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       #endif
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     } else {
       Py_ssize_t index = -1;
-      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1548, __pyx_L1_error)
+      __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1553, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -162205,7 +162333,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       __Pyx_GOTREF(__pyx_t_5);
       index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
       __Pyx_GOTREF(__pyx_t_6);
-      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(9, 1548, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(9, 1553, __pyx_L1_error)
       __pyx_t_8 = NULL;
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L6_unpacking_done;
@@ -162213,7 +162341,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __pyx_t_8 = NULL;
       if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-      __PYX_ERR(9, 1548, __pyx_L1_error)
+      __PYX_ERR(9, 1553, __pyx_L1_error)
       __pyx_L6_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_4);
@@ -162223,7 +162351,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
     __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "src/lxml/serializer.pxi":1549
+    /* "src/lxml/serializer.pxi":1554
  *     cdef _write_attributes_list(self, list attributes):
  *         for prefix, name, value in attributes:
  *             tree.xmlOutputBufferWrite(self._c_out, 1, ' ')             # <<<<<<<<<<<<<<
@@ -162232,20 +162360,20 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)" ")));
 
-    /* "src/lxml/serializer.pxi":1550
+    /* "src/lxml/serializer.pxi":1555
  *         for prefix, name, value in attributes:
  *             tree.xmlOutputBufferWrite(self._c_out, 1, ' ')
  *             self._write_qname(name, prefix)             # <<<<<<<<<<<<<<
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '="')
  *             _write_attr_string(self._c_out, _cstr(value))
  */
-    if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1550, __pyx_L1_error)
-    if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1550, __pyx_L1_error)
-    __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1550, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1555, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1555, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1555, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "src/lxml/serializer.pxi":1551
+    /* "src/lxml/serializer.pxi":1556
  *             tree.xmlOutputBufferWrite(self._c_out, 1, ' ')
  *             self._write_qname(name, prefix)
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '="')             # <<<<<<<<<<<<<<
@@ -162254,18 +162382,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 2, ((const char *)"=\"")));
 
-    /* "src/lxml/serializer.pxi":1552
+    /* "src/lxml/serializer.pxi":1557
  *             self._write_qname(name, prefix)
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '="')
  *             _write_attr_string(self._c_out, _cstr(value))             # <<<<<<<<<<<<<<
  * 
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '"')
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree__write_attr_string(__pyx_v_self->_c_out, PyBytes_AS_STRING(__pyx_v_value)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1552, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__write_attr_string(__pyx_v_self->_c_out, PyBytes_AS_STRING(__pyx_v_value)); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1557, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-    /* "src/lxml/serializer.pxi":1554
+    /* "src/lxml/serializer.pxi":1559
  *             _write_attr_string(self._c_out, _cstr(value))
  * 
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '"')             # <<<<<<<<<<<<<<
@@ -162274,7 +162402,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)"\"")));
 
-    /* "src/lxml/serializer.pxi":1548
+    /* "src/lxml/serializer.pxi":1553
  * 
  *     cdef _write_attributes_list(self, list attributes):
  *         for prefix, name, value in attributes:             # <<<<<<<<<<<<<<
@@ -162284,7 +162412,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1547
+  /* "src/lxml/serializer.pxi":1552
  *             self._write_attributes_list(attributes)
  * 
  *     cdef _write_attributes_list(self, list attributes):             # <<<<<<<<<<<<<<
@@ -162313,7 +162441,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_attributes
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1556
+/* "src/lxml/serializer.pxi":1561
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '"')
  * 
  *     cdef _write_end_element(self, element_config):             # <<<<<<<<<<<<<<
@@ -162340,7 +162468,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_write_end_element", 0);
 
-  /* "src/lxml/serializer.pxi":1557
+  /* "src/lxml/serializer.pxi":1562
  * 
  *     cdef _write_end_element(self, element_config):
  *         if self._status != WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -162350,14 +162478,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   __pyx_t_1 = ((__pyx_v_self->_status != __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1558
+    /* "src/lxml/serializer.pxi":1563
  *     cdef _write_end_element(self, element_config):
  *         if self._status != WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("not in an element")             # <<<<<<<<<<<<<<
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:
  *             raise LxmlSyntaxError("inconsistent exit action in context manager")
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1558, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1563, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -162371,14 +162499,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_not_in_an_element) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_not_in_an_element);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1558, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1563, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1558, __pyx_L1_error)
+    __PYX_ERR(9, 1563, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1557
+    /* "src/lxml/serializer.pxi":1562
  * 
  *     cdef _write_end_element(self, element_config):
  *         if self._status != WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -162387,7 +162515,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   }
 
-  /* "src/lxml/serializer.pxi":1559
+  /* "src/lxml/serializer.pxi":1564
  *         if self._status != WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("not in an element")
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:             # <<<<<<<<<<<<<<
@@ -162403,32 +162531,32 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   }
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1559, __pyx_L1_error)
+    __PYX_ERR(9, 1564, __pyx_L1_error)
   }
-  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 2, NULL, NULL, &__pyx_slice__82, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_2, 0, 2, NULL, NULL, &__pyx_slice__82, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_element_config, 0, 2, NULL, NULL, &__pyx_slice__82, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_element_config, 0, 2, NULL, NULL, &__pyx_slice__82, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_1 = __pyx_t_6;
   __pyx_L5_bool_binop_done:;
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1560
+    /* "src/lxml/serializer.pxi":1565
  *             raise LxmlSyntaxError("not in an element")
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:
  *             raise LxmlSyntaxError("inconsistent exit action in context manager")             # <<<<<<<<<<<<<<
  * 
  *         # If previous write operations failed, the context manager exit might still call us.
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1560, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1565, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -162442,14 +162570,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     }
     __pyx_t_4 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_s_inconsistent_exit_action_in_cont) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_s_inconsistent_exit_action_in_cont);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1560, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1565, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_Raise(__pyx_t_4, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-    __PYX_ERR(9, 1560, __pyx_L1_error)
+    __PYX_ERR(9, 1565, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1559
+    /* "src/lxml/serializer.pxi":1564
  *         if self._status != WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("not in an element")
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:             # <<<<<<<<<<<<<<
@@ -162458,19 +162586,19 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   }
 
-  /* "src/lxml/serializer.pxi":1565
+  /* "src/lxml/serializer.pxi":1570
  *         # That is ok, but we stop writing closing tags and handling errors in that case.
  *         # For all non-I/O errors, we continue writing closing tags if we can.
  *         ok_to_write = self._c_out.error == xmlerror.XML_ERR_OK             # <<<<<<<<<<<<<<
  * 
  *         name, prefix = self._element_stack.pop()[1:3]
  */
-  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_self->_c_out->error == XML_ERR_OK)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1565, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyBool_FromLong((__pyx_v_self->_c_out->error == XML_ERR_OK)); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1570, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_v_ok_to_write = __pyx_t_4;
   __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1567
+  /* "src/lxml/serializer.pxi":1572
  *         ok_to_write = self._c_out.error == xmlerror.XML_ERR_OK
  * 
  *         name, prefix = self._element_stack.pop()[1:3]             # <<<<<<<<<<<<<<
@@ -162479,11 +162607,11 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
-    __PYX_ERR(9, 1567, __pyx_L1_error)
+    __PYX_ERR(9, 1572, __pyx_L1_error)
   }
-  __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_self->_element_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1567, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyList_Pop(__pyx_v_self->_element_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1572, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 3, NULL, NULL, &__pyx_slice__83, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1567, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 3, NULL, NULL, &__pyx_slice__83, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1572, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
@@ -162492,7 +162620,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     if (unlikely(size != 2)) {
       if (size > 2) __Pyx_RaiseTooManyValuesError(2);
       else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-      __PYX_ERR(9, 1567, __pyx_L1_error)
+      __PYX_ERR(9, 1572, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -162505,15 +162633,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     __Pyx_INCREF(__pyx_t_4);
     __Pyx_INCREF(__pyx_t_3);
     #else
-    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1567, __pyx_L1_error)
+    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1572, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1567, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1572, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   } else {
     Py_ssize_t index = -1;
-    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1567, __pyx_L1_error)
+    __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 1572, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
@@ -162521,7 +162649,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     __Pyx_GOTREF(__pyx_t_4);
     index = 1; __pyx_t_3 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
     __Pyx_GOTREF(__pyx_t_3);
-    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(9, 1567, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(9, 1572, __pyx_L1_error)
     __pyx_t_8 = NULL;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     goto __pyx_L8_unpacking_done;
@@ -162529,7 +162657,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_t_8 = NULL;
     if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-    __PYX_ERR(9, 1567, __pyx_L1_error)
+    __PYX_ERR(9, 1572, __pyx_L1_error)
     __pyx_L8_unpacking_done:;
   }
   __pyx_v_name = __pyx_t_4;
@@ -162537,17 +162665,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   __pyx_v_prefix = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1568
+  /* "src/lxml/serializer.pxi":1573
  * 
  *         name, prefix = self._element_stack.pop()[1:3]
  *         if ok_to_write:             # <<<<<<<<<<<<<<
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  *             self._write_qname(name, prefix)
  */
-  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ok_to_write); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1568, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ok_to_write); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1573, __pyx_L1_error)
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1569
+    /* "src/lxml/serializer.pxi":1574
  *         name, prefix = self._element_stack.pop()[1:3]
  *         if ok_to_write:
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')             # <<<<<<<<<<<<<<
@@ -162556,20 +162684,20 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 2, ((const char *)"</")));
 
-    /* "src/lxml/serializer.pxi":1570
+    /* "src/lxml/serializer.pxi":1575
  *         if ok_to_write:
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  *             self._write_qname(name, prefix)             # <<<<<<<<<<<<<<
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  * 
  */
-    if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1570, __pyx_L1_error)
-    if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1570, __pyx_L1_error)
-    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1570, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(9, 1575, __pyx_L1_error)
+    if (!(likely(PyBytes_CheckExact(__pyx_v_prefix))||((__pyx_v_prefix) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_prefix)->tp_name), 0))) __PYX_ERR(9, 1575, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname(__pyx_v_self, ((PyObject*)__pyx_v_name), ((PyObject*)__pyx_v_prefix)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1575, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1571
+    /* "src/lxml/serializer.pxi":1576
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  *             self._write_qname(name, prefix)
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '>')             # <<<<<<<<<<<<<<
@@ -162578,7 +162706,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, 1, ((const char *)">")));
 
-    /* "src/lxml/serializer.pxi":1568
+    /* "src/lxml/serializer.pxi":1573
  * 
  *         name, prefix = self._element_stack.pop()[1:3]
  *         if ok_to_write:             # <<<<<<<<<<<<<<
@@ -162587,7 +162715,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   }
 
-  /* "src/lxml/serializer.pxi":1573
+  /* "src/lxml/serializer.pxi":1578
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  * 
  *         if not self._element_stack:             # <<<<<<<<<<<<<<
@@ -162598,7 +162726,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   __pyx_t_6 = ((!__pyx_t_1) != 0);
   if (__pyx_t_6) {
 
-    /* "src/lxml/serializer.pxi":1574
+    /* "src/lxml/serializer.pxi":1579
  * 
  *         if not self._element_stack:
  *             self._status = WRITER_FINISHED             # <<<<<<<<<<<<<<
@@ -162607,7 +162735,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_FINISHED;
 
-    /* "src/lxml/serializer.pxi":1573
+    /* "src/lxml/serializer.pxi":1578
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '>')
  * 
  *         if not self._element_stack:             # <<<<<<<<<<<<<<
@@ -162616,17 +162744,17 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   }
 
-  /* "src/lxml/serializer.pxi":1575
+  /* "src/lxml/serializer.pxi":1580
  *         if not self._element_stack:
  *             self._status = WRITER_FINISHED
  *         if ok_to_write:             # <<<<<<<<<<<<<<
  *             if not self._buffered:
  *                 tree.xmlOutputBufferFlush(self._c_out)
  */
-  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ok_to_write); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1575, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ok_to_write); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(9, 1580, __pyx_L1_error)
   if (__pyx_t_6) {
 
-    /* "src/lxml/serializer.pxi":1576
+    /* "src/lxml/serializer.pxi":1581
  *             self._status = WRITER_FINISHED
  *         if ok_to_write:
  *             if not self._buffered:             # <<<<<<<<<<<<<<
@@ -162636,7 +162764,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
     __pyx_t_6 = ((!(__pyx_v_self->_buffered != 0)) != 0);
     if (__pyx_t_6) {
 
-      /* "src/lxml/serializer.pxi":1577
+      /* "src/lxml/serializer.pxi":1582
  *         if ok_to_write:
  *             if not self._buffered:
  *                 tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -162645,7 +162773,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
       (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-      /* "src/lxml/serializer.pxi":1576
+      /* "src/lxml/serializer.pxi":1581
  *             self._status = WRITER_FINISHED
  *         if ok_to_write:
  *             if not self._buffered:             # <<<<<<<<<<<<<<
@@ -162654,18 +162782,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
     }
 
-    /* "src/lxml/serializer.pxi":1578
+    /* "src/lxml/serializer.pxi":1583
  *             if not self._buffered:
  *                 tree.xmlOutputBufferFlush(self._c_out)
  *             self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1578, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1583, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1575
+    /* "src/lxml/serializer.pxi":1580
  *         if not self._element_stack:
  *             self._status = WRITER_FINISHED
  *         if ok_to_write:             # <<<<<<<<<<<<<<
@@ -162674,7 +162802,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
  */
   }
 
-  /* "src/lxml/serializer.pxi":1556
+  /* "src/lxml/serializer.pxi":1561
  *             tree.xmlOutputBufferWrite(self._c_out, 1, '"')
  * 
  *     cdef _write_end_element(self, element_config):             # <<<<<<<<<<<<<<
@@ -162701,7 +162829,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_elemen
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1580
+/* "src/lxml/serializer.pxi":1585
  *             self._handle_error(self._c_out.error)
  * 
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):             # <<<<<<<<<<<<<<
@@ -162725,7 +162853,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_find_prefix", 0);
 
-  /* "src/lxml/serializer.pxi":1581
+  /* "src/lxml/serializer.pxi":1586
  * 
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):
  *         if href is None:             # <<<<<<<<<<<<<<
@@ -162736,7 +162864,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
   __pyx_t_2 = (__pyx_t_1 != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1582
+    /* "src/lxml/serializer.pxi":1587
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):
  *         if href is None:
  *             return None             # <<<<<<<<<<<<<<
@@ -162747,7 +162875,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
     __pyx_r = Py_None; __Pyx_INCREF(Py_None);
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1581
+    /* "src/lxml/serializer.pxi":1586
  * 
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):
  *         if href is None:             # <<<<<<<<<<<<<<
@@ -162756,7 +162884,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
   }
 
-  /* "src/lxml/serializer.pxi":1583
+  /* "src/lxml/serializer.pxi":1588
  *         if href is None:
  *             return None
  *         if href in flat_namespaces_map:             # <<<<<<<<<<<<<<
@@ -162765,13 +162893,13 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
   if (unlikely(__pyx_v_flat_namespaces_map == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(9, 1583, __pyx_L1_error)
+    __PYX_ERR(9, 1588, __pyx_L1_error)
   }
-  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_href, __pyx_v_flat_namespaces_map, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1583, __pyx_L1_error)
+  __pyx_t_2 = (__Pyx_PyDict_ContainsTF(__pyx_v_href, __pyx_v_flat_namespaces_map, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1588, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_2 != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1584
+    /* "src/lxml/serializer.pxi":1589
  *             return None
  *         if href in flat_namespaces_map:
  *             return flat_namespaces_map[href]             # <<<<<<<<<<<<<<
@@ -162781,15 +162909,15 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
     __Pyx_XDECREF(__pyx_r);
     if (unlikely(__pyx_v_flat_namespaces_map == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(9, 1584, __pyx_L1_error)
+      __PYX_ERR(9, 1589, __pyx_L1_error)
     }
-    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_flat_namespaces_map, __pyx_v_href); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1584, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_flat_namespaces_map, __pyx_v_href); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1589, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = __pyx_t_3;
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1583
+    /* "src/lxml/serializer.pxi":1588
  *         if href is None:
  *             return None
  *         if href in flat_namespaces_map:             # <<<<<<<<<<<<<<
@@ -162798,7 +162926,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
   }
 
-  /* "src/lxml/serializer.pxi":1586
+  /* "src/lxml/serializer.pxi":1591
  *             return flat_namespaces_map[href]
  *         # need to create a new prefix
  *         prefixes = flat_namespaces_map.values()             # <<<<<<<<<<<<<<
@@ -162807,14 +162935,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
   if (unlikely(__pyx_v_flat_namespaces_map == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "values");
-    __PYX_ERR(9, 1586, __pyx_L1_error)
+    __PYX_ERR(9, 1591, __pyx_L1_error)
   }
-  __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_flat_namespaces_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1586, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_Values(__pyx_v_flat_namespaces_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1591, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_prefixes = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1587
+  /* "src/lxml/serializer.pxi":1592
  *         # need to create a new prefix
  *         prefixes = flat_namespaces_map.values()
  *         i = 0             # <<<<<<<<<<<<<<
@@ -162824,7 +162952,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
   __Pyx_INCREF(__pyx_int_0);
   __pyx_v_i = __pyx_int_0;
 
-  /* "src/lxml/serializer.pxi":1588
+  /* "src/lxml/serializer.pxi":1593
  *         prefixes = flat_namespaces_map.values()
  *         i = 0
  *         while True:             # <<<<<<<<<<<<<<
@@ -162833,33 +162961,33 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
   while (1) {
 
-    /* "src/lxml/serializer.pxi":1589
+    /* "src/lxml/serializer.pxi":1594
  *         i = 0
  *         while True:
  *             prefix = _utf8('ns%d' % i)             # <<<<<<<<<<<<<<
  *             if prefix not in prefixes:
  *                 new_namespaces.append((b'xmlns', prefix, href))
  */
-    __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ns_d, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1589, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_ns_d, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1594, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1589, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1594, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XDECREF_SET(__pyx_v_prefix, ((PyObject*)__pyx_t_4));
     __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1590
+    /* "src/lxml/serializer.pxi":1595
  *         while True:
  *             prefix = _utf8('ns%d' % i)
  *             if prefix not in prefixes:             # <<<<<<<<<<<<<<
  *                 new_namespaces.append((b'xmlns', prefix, href))
  *                 flat_namespaces_map[href] = prefix
  */
-    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_prefix, __pyx_v_prefixes, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1590, __pyx_L1_error)
+    __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_prefix, __pyx_v_prefixes, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(9, 1595, __pyx_L1_error)
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/serializer.pxi":1591
+      /* "src/lxml/serializer.pxi":1596
  *             prefix = _utf8('ns%d' % i)
  *             if prefix not in prefixes:
  *                 new_namespaces.append((b'xmlns', prefix, href))             # <<<<<<<<<<<<<<
@@ -162868,9 +162996,9 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
       if (unlikely(__pyx_v_new_namespaces == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-        __PYX_ERR(9, 1591, __pyx_L1_error)
+        __PYX_ERR(9, 1596, __pyx_L1_error)
       }
-      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1591, __pyx_L1_error)
+      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1596, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_INCREF(__pyx_n_b_xmlns_2);
       __Pyx_GIVEREF(__pyx_n_b_xmlns_2);
@@ -162881,10 +163009,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
       __Pyx_INCREF(__pyx_v_href);
       __Pyx_GIVEREF(__pyx_v_href);
       PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_href);
-      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(9, 1591, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_4); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(9, 1596, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-      /* "src/lxml/serializer.pxi":1592
+      /* "src/lxml/serializer.pxi":1597
  *             if prefix not in prefixes:
  *                 new_namespaces.append((b'xmlns', prefix, href))
  *                 flat_namespaces_map[href] = prefix             # <<<<<<<<<<<<<<
@@ -162893,11 +163021,11 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
       if (unlikely(__pyx_v_flat_namespaces_map == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 1592, __pyx_L1_error)
+        __PYX_ERR(9, 1597, __pyx_L1_error)
       }
-      if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_href, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1592, __pyx_L1_error)
+      if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_href, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1597, __pyx_L1_error)
 
-      /* "src/lxml/serializer.pxi":1593
+      /* "src/lxml/serializer.pxi":1598
  *                 new_namespaces.append((b'xmlns', prefix, href))
  *                 flat_namespaces_map[href] = prefix
  *                 return prefix             # <<<<<<<<<<<<<<
@@ -162909,7 +163037,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
       __pyx_r = __pyx_v_prefix;
       goto __pyx_L0;
 
-      /* "src/lxml/serializer.pxi":1590
+      /* "src/lxml/serializer.pxi":1595
  *         while True:
  *             prefix = _utf8('ns%d' % i)
  *             if prefix not in prefixes:             # <<<<<<<<<<<<<<
@@ -162918,20 +163046,20 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
  */
     }
 
-    /* "src/lxml/serializer.pxi":1594
+    /* "src/lxml/serializer.pxi":1599
  *                 flat_namespaces_map[href] = prefix
  *                 return prefix
  *             i += 1             # <<<<<<<<<<<<<<
  * 
  *     cdef _collect_namespaces(self, dict nsmap):
  */
-    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1594, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1599, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF_SET(__pyx_v_i, __pyx_t_4);
     __pyx_t_4 = 0;
   }
 
-  /* "src/lxml/serializer.pxi":1580
+  /* "src/lxml/serializer.pxi":1585
  *             self._handle_error(self._c_out.error)
  * 
  *     cdef _find_prefix(self, bytes href, dict flat_namespaces_map, list new_namespaces):             # <<<<<<<<<<<<<<
@@ -162956,7 +163084,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__find_prefix(CYTH
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1596
+/* "src/lxml/serializer.pxi":1601
  *             i += 1
  * 
  *     cdef _collect_namespaces(self, dict nsmap):             # <<<<<<<<<<<<<<
@@ -162986,31 +163114,31 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_collect_namespaces", 0);
 
-  /* "src/lxml/serializer.pxi":1597
+  /* "src/lxml/serializer.pxi":1602
  * 
  *     cdef _collect_namespaces(self, dict nsmap):
  *         new_namespaces = []             # <<<<<<<<<<<<<<
  *         flat_namespaces_map = {}
  *         for ns, prefix in nsmap.iteritems():
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1597, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_new_namespaces = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1598
+  /* "src/lxml/serializer.pxi":1603
  *     cdef _collect_namespaces(self, dict nsmap):
  *         new_namespaces = []
  *         flat_namespaces_map = {}             # <<<<<<<<<<<<<<
  *         for ns, prefix in nsmap.iteritems():
  *             flat_namespaces_map[ns] = prefix
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1598, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1603, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_flat_namespaces_map = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1599
+  /* "src/lxml/serializer.pxi":1604
  *         new_namespaces = []
  *         flat_namespaces_map = {}
  *         for ns, prefix in nsmap.iteritems():             # <<<<<<<<<<<<<<
@@ -163020,9 +163148,9 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   __pyx_t_2 = 0;
   if (unlikely(__pyx_v_nsmap == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
-    __PYX_ERR(9, 1599, __pyx_L1_error)
+    __PYX_ERR(9, 1604, __pyx_L1_error)
   }
-  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_nsmap, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1599, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_nsmap, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1604, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_XDECREF(__pyx_t_1);
   __pyx_t_1 = __pyx_t_5;
@@ -163030,7 +163158,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   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(9, 1599, __pyx_L1_error)
+    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(9, 1604, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_5);
@@ -163038,16 +163166,16 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "src/lxml/serializer.pxi":1600
+    /* "src/lxml/serializer.pxi":1605
  *         flat_namespaces_map = {}
  *         for ns, prefix in nsmap.iteritems():
  *             flat_namespaces_map[ns] = prefix             # <<<<<<<<<<<<<<
  *             if prefix is None:
  *                 # use empty bytes rather than None to allow sorting
  */
-    if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_ns, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1600, __pyx_L1_error)
+    if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_ns, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1605, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1601
+    /* "src/lxml/serializer.pxi":1606
  *         for ns, prefix in nsmap.iteritems():
  *             flat_namespaces_map[ns] = prefix
  *             if prefix is None:             # <<<<<<<<<<<<<<
@@ -163058,14 +163186,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     __pyx_t_9 = (__pyx_t_8 != 0);
     if (__pyx_t_9) {
 
-      /* "src/lxml/serializer.pxi":1603
+      /* "src/lxml/serializer.pxi":1608
  *             if prefix is None:
  *                 # use empty bytes rather than None to allow sorting
  *                 new_namespaces.append((b'', b'xmlns', ns))             # <<<<<<<<<<<<<<
  *             else:
  *                 new_namespaces.append((b'xmlns', prefix, ns))
  */
-      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1603, __pyx_L1_error)
+      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1608, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_kp_b__12);
       __Pyx_GIVEREF(__pyx_kp_b__12);
@@ -163076,10 +163204,10 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       __Pyx_INCREF(__pyx_v_ns);
       __Pyx_GIVEREF(__pyx_v_ns);
       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ns);
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 1603, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 1608, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "src/lxml/serializer.pxi":1601
+      /* "src/lxml/serializer.pxi":1606
  *         for ns, prefix in nsmap.iteritems():
  *             flat_namespaces_map[ns] = prefix
  *             if prefix is None:             # <<<<<<<<<<<<<<
@@ -163089,7 +163217,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       goto __pyx_L5;
     }
 
-    /* "src/lxml/serializer.pxi":1605
+    /* "src/lxml/serializer.pxi":1610
  *                 new_namespaces.append((b'', b'xmlns', ns))
  *             else:
  *                 new_namespaces.append((b'xmlns', prefix, ns))             # <<<<<<<<<<<<<<
@@ -163097,7 +163225,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
  *         if self._element_stack:
  */
     /*else*/ {
-      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1605, __pyx_L1_error)
+      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1610, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_INCREF(__pyx_n_b_xmlns_2);
       __Pyx_GIVEREF(__pyx_n_b_xmlns_2);
@@ -163108,14 +163236,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       __Pyx_INCREF(__pyx_v_ns);
       __Pyx_GIVEREF(__pyx_v_ns);
       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ns);
-      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 1605, __pyx_L1_error)
+      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_new_namespaces, __pyx_t_6); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(9, 1610, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     }
     __pyx_L5:;
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1607
+  /* "src/lxml/serializer.pxi":1612
  *                 new_namespaces.append((b'xmlns', prefix, ns))
  *         # merge in flat namespace map of parent
  *         if self._element_stack:             # <<<<<<<<<<<<<<
@@ -163125,7 +163253,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   __pyx_t_9 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
   if (__pyx_t_9) {
 
-    /* "src/lxml/serializer.pxi":1608
+    /* "src/lxml/serializer.pxi":1613
  *         # merge in flat namespace map of parent
  *         if self._element_stack:
  *             for ns, prefix in (<dict>self._element_stack[-1][-1]).iteritems():             # <<<<<<<<<<<<<<
@@ -163135,18 +163263,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     __pyx_t_3 = 0;
     if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
       PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-      __PYX_ERR(9, 1608, __pyx_L1_error)
+      __PYX_ERR(9, 1613, __pyx_L1_error)
     }
-    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1608, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1613, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1608, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1613, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (unlikely(__pyx_t_5 == Py_None)) {
       PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
-      __PYX_ERR(9, 1608, __pyx_L1_error)
+      __PYX_ERR(9, 1613, __pyx_L1_error)
     }
-    __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_t_5), 1, __pyx_n_s_iteritems, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1608, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_dict_iterator(((PyObject*)__pyx_t_5), 1, __pyx_n_s_iteritems, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1613, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_XDECREF(__pyx_t_1);
@@ -163155,7 +163283,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     while (1) {
       __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
       if (unlikely(__pyx_t_7 == 0)) break;
-      if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(9, 1608, __pyx_L1_error)
+      if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(9, 1613, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_6);
@@ -163163,30 +163291,30 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
       __Pyx_XDECREF_SET(__pyx_v_prefix, __pyx_t_5);
       __pyx_t_5 = 0;
 
-      /* "src/lxml/serializer.pxi":1609
+      /* "src/lxml/serializer.pxi":1614
  *         if self._element_stack:
  *             for ns, prefix in (<dict>self._element_stack[-1][-1]).iteritems():
  *                 if flat_namespaces_map.get(ns) is None:             # <<<<<<<<<<<<<<
  *                     # unknown or empty prefix => prefer a 'real' prefix
  *                     flat_namespaces_map[ns] = prefix
  */
-      __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_flat_namespaces_map, __pyx_v_ns, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1609, __pyx_L1_error)
+      __pyx_t_5 = __Pyx_PyDict_GetItemDefault(__pyx_v_flat_namespaces_map, __pyx_v_ns, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1614, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __pyx_t_9 = (__pyx_t_5 == Py_None);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_8 = (__pyx_t_9 != 0);
       if (__pyx_t_8) {
 
-        /* "src/lxml/serializer.pxi":1611
+        /* "src/lxml/serializer.pxi":1616
  *                 if flat_namespaces_map.get(ns) is None:
  *                     # unknown or empty prefix => prefer a 'real' prefix
  *                     flat_namespaces_map[ns] = prefix             # <<<<<<<<<<<<<<
  *         return flat_namespaces_map, new_namespaces
  * 
  */
-        if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_ns, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1611, __pyx_L1_error)
+        if (unlikely(PyDict_SetItem(__pyx_v_flat_namespaces_map, __pyx_v_ns, __pyx_v_prefix) < 0)) __PYX_ERR(9, 1616, __pyx_L1_error)
 
-        /* "src/lxml/serializer.pxi":1609
+        /* "src/lxml/serializer.pxi":1614
  *         if self._element_stack:
  *             for ns, prefix in (<dict>self._element_stack[-1][-1]).iteritems():
  *                 if flat_namespaces_map.get(ns) is None:             # <<<<<<<<<<<<<<
@@ -163197,7 +163325,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
     }
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-    /* "src/lxml/serializer.pxi":1607
+    /* "src/lxml/serializer.pxi":1612
  *                 new_namespaces.append((b'xmlns', prefix, ns))
  *         # merge in flat namespace map of parent
  *         if self._element_stack:             # <<<<<<<<<<<<<<
@@ -163206,7 +163334,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
  */
   }
 
-  /* "src/lxml/serializer.pxi":1612
+  /* "src/lxml/serializer.pxi":1617
  *                     # unknown or empty prefix => prefer a 'real' prefix
  *                     flat_namespaces_map[ns] = prefix
  *         return flat_namespaces_map, new_namespaces             # <<<<<<<<<<<<<<
@@ -163214,7 +163342,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
  *     def write(self, *args, bint with_tail=True, bint pretty_print=False, method=None):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1612, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1617, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v_flat_namespaces_map);
   __Pyx_GIVEREF(__pyx_v_flat_namespaces_map);
@@ -163226,7 +163354,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1596
+  /* "src/lxml/serializer.pxi":1601
  *             i += 1
  * 
  *     cdef _collect_namespaces(self, dict nsmap):             # <<<<<<<<<<<<<<
@@ -163251,7 +163379,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespac
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1614
+/* "src/lxml/serializer.pxi":1619
  *         return flat_namespaces_map, new_namespaces
  * 
  *     def write(self, *args, bint with_tail=True, bint pretty_print=False, method=None):             # <<<<<<<<<<<<<<
@@ -163304,19 +163432,19 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_13write(PyObject
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "write") < 0)) __PYX_ERR(9, 1614, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "write") < 0)) __PYX_ERR(9, 1619, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
       goto __pyx_L5_argtuple_error;
     } else {
     }
     if (values[0]) {
-      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1614, __pyx_L3_error)
+      __pyx_v_with_tail = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_with_tail == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1619, __pyx_L3_error)
     } else {
       __pyx_v_with_tail = ((int)1);
     }
     if (values[1]) {
-      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1614, __pyx_L3_error)
+      __pyx_v_pretty_print = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_pretty_print == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1619, __pyx_L3_error)
     } else {
       __pyx_v_pretty_print = ((int)0);
     }
@@ -163324,7 +163452,7 @@ static PyObject *__pyx_pw_4lxml_5etree_22_IncrementalFileWriter_13write(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1614, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1619, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_AddTraceback("lxml.etree._IncrementalFileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -163369,7 +163497,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("write", 0);
 
-  /* "src/lxml/serializer.pxi":1622
+  /* "src/lxml/serializer.pxi":1627
  *         to temporarily override the output method.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -163380,12 +163508,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1622, __pyx_L1_error)
+      __PYX_ERR(9, 1627, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1623
+  /* "src/lxml/serializer.pxi":1628
  *         """
  *         assert self._c_out is not NULL
  *         c_method = self._method if method is None else _findOutputMethod(method)             # <<<<<<<<<<<<<<
@@ -163396,12 +163524,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   if ((__pyx_t_2 != 0)) {
     __pyx_t_1 = __pyx_v_self->_method;
   } else {
-    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1623, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1628, __pyx_L1_error)
     __pyx_t_1 = __pyx_t_3;
   }
   __pyx_v_c_method = __pyx_t_1;
 
-  /* "src/lxml/serializer.pxi":1625
+  /* "src/lxml/serializer.pxi":1630
  *         c_method = self._method if method is None else _findOutputMethod(method)
  * 
  *         for content in args:             # <<<<<<<<<<<<<<
@@ -163412,15 +163540,15 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   for (;;) {
     if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1625, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_6); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(9, 1630, __pyx_L1_error)
     #else
-    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1625, __pyx_L1_error)
+    __pyx_t_6 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1630, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_content, __pyx_t_6);
     __pyx_t_6 = 0;
 
-    /* "src/lxml/serializer.pxi":1626
+    /* "src/lxml/serializer.pxi":1631
  * 
  *         for content in args:
  *             if _isString(content):             # <<<<<<<<<<<<<<
@@ -163430,7 +163558,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
     __pyx_t_2 = (_isString(__pyx_v_content) != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/serializer.pxi":1627
+      /* "src/lxml/serializer.pxi":1632
  *         for content in args:
  *             if _isString(content):
  *                 if self._status != WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -163440,7 +163568,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_2 = ((__pyx_v_self->_status != __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT) != 0);
       if (__pyx_t_2) {
 
-        /* "src/lxml/serializer.pxi":1628
+        /* "src/lxml/serializer.pxi":1633
  *             if _isString(content):
  *                 if self._status != WRITER_IN_ELEMENT:
  *                     if self._status > WRITER_IN_ELEMENT or content.strip():             # <<<<<<<<<<<<<<
@@ -163453,7 +163581,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
           __pyx_t_2 = __pyx_t_7;
           goto __pyx_L8_bool_binop_done;
         }
-        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_content, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1628, __pyx_L1_error)
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_content, __pyx_n_s_strip); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1633, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
         __pyx_t_9 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
@@ -163467,23 +163595,23 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         }
         __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_8);
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1628, __pyx_L1_error)
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1633, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(9, 1628, __pyx_L1_error)
+        __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(9, 1633, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __pyx_t_2 = __pyx_t_7;
         __pyx_L8_bool_binop_done:;
         if (unlikely(__pyx_t_2)) {
 
-          /* "src/lxml/serializer.pxi":1629
+          /* "src/lxml/serializer.pxi":1634
  *                 if self._status != WRITER_IN_ELEMENT:
  *                     if self._status > WRITER_IN_ELEMENT or content.strip():
  *                         raise LxmlSyntaxError("not in an element")             # <<<<<<<<<<<<<<
  *                 bstring = _utf8(content)
  *                 if not bstring:
  */
-          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1629, __pyx_L1_error)
+          __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_8)) __PYX_ERR(9, 1634, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_8);
           __pyx_t_9 = NULL;
           if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
@@ -163497,14 +163625,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
           }
           __pyx_t_6 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_s_not_in_an_element) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_s_not_in_an_element);
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
-          if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1629, __pyx_L1_error)
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1634, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_6);
           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
           __Pyx_Raise(__pyx_t_6, 0, 0, 0);
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-          __PYX_ERR(9, 1629, __pyx_L1_error)
+          __PYX_ERR(9, 1634, __pyx_L1_error)
 
-          /* "src/lxml/serializer.pxi":1628
+          /* "src/lxml/serializer.pxi":1633
  *             if _isString(content):
  *                 if self._status != WRITER_IN_ELEMENT:
  *                     if self._status > WRITER_IN_ELEMENT or content.strip():             # <<<<<<<<<<<<<<
@@ -163513,7 +163641,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
         }
 
-        /* "src/lxml/serializer.pxi":1627
+        /* "src/lxml/serializer.pxi":1632
  *         for content in args:
  *             if _isString(content):
  *                 if self._status != WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -163522,19 +163650,19 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       }
 
-      /* "src/lxml/serializer.pxi":1630
+      /* "src/lxml/serializer.pxi":1635
  *                     if self._status > WRITER_IN_ELEMENT or content.strip():
  *                         raise LxmlSyntaxError("not in an element")
  *                 bstring = _utf8(content)             # <<<<<<<<<<<<<<
  *                 if not bstring:
  *                     continue
  */
-      __pyx_t_6 = __pyx_f_4lxml_5etree__utf8(__pyx_v_content); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1630, __pyx_L1_error)
+      __pyx_t_6 = __pyx_f_4lxml_5etree__utf8(__pyx_v_content); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1635, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_XDECREF_SET(__pyx_v_bstring, ((PyObject*)__pyx_t_6));
       __pyx_t_6 = 0;
 
-      /* "src/lxml/serializer.pxi":1631
+      /* "src/lxml/serializer.pxi":1636
  *                         raise LxmlSyntaxError("not in an element")
  *                 bstring = _utf8(content)
  *                 if not bstring:             # <<<<<<<<<<<<<<
@@ -163545,7 +163673,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_7 = ((!__pyx_t_2) != 0);
       if (__pyx_t_7) {
 
-        /* "src/lxml/serializer.pxi":1632
+        /* "src/lxml/serializer.pxi":1637
  *                 bstring = _utf8(content)
  *                 if not bstring:
  *                     continue             # <<<<<<<<<<<<<<
@@ -163554,7 +163682,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
         goto __pyx_L3_continue;
 
-        /* "src/lxml/serializer.pxi":1631
+        /* "src/lxml/serializer.pxi":1636
  *                         raise LxmlSyntaxError("not in an element")
  *                 bstring = _utf8(content)
  *                 if not bstring:             # <<<<<<<<<<<<<<
@@ -163563,7 +163691,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       }
 
-      /* "src/lxml/serializer.pxi":1634
+      /* "src/lxml/serializer.pxi":1639
  *                     continue
  * 
  *                 ns, name, _, _ = self._element_stack[-1]             # <<<<<<<<<<<<<<
@@ -163572,9 +163700,9 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
         PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-        __PYX_ERR(9, 1634, __pyx_L1_error)
+        __PYX_ERR(9, 1639, __pyx_L1_error)
       }
-      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1634, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_GetItemInt_List(__pyx_v_self->_element_stack, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1639, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       if ((likely(PyTuple_CheckExact(__pyx_t_6))) || (PyList_CheckExact(__pyx_t_6))) {
         PyObject* sequence = __pyx_t_6;
@@ -163582,7 +163710,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         if (unlikely(size != 4)) {
           if (size > 4) __Pyx_RaiseTooManyValuesError(4);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(9, 1634, __pyx_L1_error)
+          __PYX_ERR(9, 1639, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -163605,7 +163733,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
           Py_ssize_t i;
           PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
           for (i=0; i < 4; i++) {
-            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(9, 1634, __pyx_L1_error)
+            PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(9, 1639, __pyx_L1_error)
             __Pyx_GOTREF(item);
             *(temps[i]) = item;
           }
@@ -163615,7 +163743,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       } else {
         Py_ssize_t index = -1;
         PyObject** temps[4] = {&__pyx_t_8,&__pyx_t_9,&__pyx_t_10,&__pyx_t_11};
-        __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 1634, __pyx_L1_error)
+        __pyx_t_12 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(9, 1639, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_12);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __pyx_t_13 = Py_TYPE(__pyx_t_12)->tp_iternext;
@@ -163624,7 +163752,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
           __Pyx_GOTREF(item);
           *(temps[index]) = item;
         }
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) __PYX_ERR(9, 1634, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_12), 4) < 0) __PYX_ERR(9, 1639, __pyx_L1_error)
         __pyx_t_13 = NULL;
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         goto __pyx_L12_unpacking_done;
@@ -163632,7 +163760,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         __pyx_t_13 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(9, 1634, __pyx_L1_error)
+        __PYX_ERR(9, 1639, __pyx_L1_error)
         __pyx_L12_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_ns, __pyx_t_8);
@@ -163644,7 +163772,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __Pyx_DECREF_SET(__pyx_v__, __pyx_t_11);
       __pyx_t_11 = 0;
 
-      /* "src/lxml/serializer.pxi":1635
+      /* "src/lxml/serializer.pxi":1640
  * 
  *                 ns, name, _, _ = self._element_stack[-1]
  *                 if (c_method == OUTPUT_METHOD_HTML and             # <<<<<<<<<<<<<<
@@ -163658,7 +163786,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         goto __pyx_L14_bool_binop_done;
       }
 
-      /* "src/lxml/serializer.pxi":1636
+      /* "src/lxml/serializer.pxi":1641
  *                 ns, name, _, _ = self._element_stack[-1]
  *                 if (c_method == OUTPUT_METHOD_HTML and
  *                         ns in (None, b'http://www.w3.org/1999/xhtml') and             # <<<<<<<<<<<<<<
@@ -163667,15 +163795,15 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       __Pyx_INCREF(__pyx_v_ns);
       __pyx_t_6 = __pyx_v_ns;
-      __pyx_t_11 = PyObject_RichCompare(__pyx_t_6, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1636, __pyx_L1_error)
-      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(9, 1636, __pyx_L1_error)
+      __pyx_t_11 = PyObject_RichCompare(__pyx_t_6, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1641, __pyx_L1_error)
+      __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(9, 1641, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       if (!__pyx_t_14) {
       } else {
         __pyx_t_2 = __pyx_t_14;
         goto __pyx_L17_bool_binop_done;
       }
-      __pyx_t_14 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_kp_b_http_www_w3_org_1999_xhtml, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(9, 1636, __pyx_L1_error)
+      __pyx_t_14 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_kp_b_http_www_w3_org_1999_xhtml, Py_EQ)); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(9, 1641, __pyx_L1_error)
       __pyx_t_2 = __pyx_t_14;
       __pyx_L17_bool_binop_done:;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -163686,7 +163814,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         goto __pyx_L14_bool_binop_done;
       }
 
-      /* "src/lxml/serializer.pxi":1637
+      /* "src/lxml/serializer.pxi":1642
  *                 if (c_method == OUTPUT_METHOD_HTML and
  *                         ns in (None, b'http://www.w3.org/1999/xhtml') and
  *                         name in (b'script', b'style')):             # <<<<<<<<<<<<<<
@@ -163695,13 +163823,13 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       __Pyx_INCREF(__pyx_v_name);
       __pyx_t_6 = __pyx_v_name;
-      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_n_b_script, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1637, __pyx_L1_error)
+      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_n_b_script, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1642, __pyx_L1_error)
       if (!__pyx_t_2) {
       } else {
         __pyx_t_14 = __pyx_t_2;
         goto __pyx_L19_bool_binop_done;
       }
-      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_n_b_style, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1637, __pyx_L1_error)
+      __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_6, __pyx_n_b_style, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(9, 1642, __pyx_L1_error)
       __pyx_t_14 = __pyx_t_2;
       __pyx_L19_bool_binop_done:;
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -163709,7 +163837,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_7 = __pyx_t_2;
       __pyx_L14_bool_binop_done:;
 
-      /* "src/lxml/serializer.pxi":1635
+      /* "src/lxml/serializer.pxi":1640
  * 
  *                 ns, name, _, _ = self._element_stack[-1]
  *                 if (c_method == OUTPUT_METHOD_HTML and             # <<<<<<<<<<<<<<
@@ -163718,7 +163846,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       if (__pyx_t_7) {
 
-        /* "src/lxml/serializer.pxi":1638
+        /* "src/lxml/serializer.pxi":1643
  *                         ns in (None, b'http://www.w3.org/1999/xhtml') and
  *                         name in (b'script', b'style')):
  *                     tree.xmlOutputBufferWrite(self._c_out, len(bstring), _cstr(bstring))             # <<<<<<<<<<<<<<
@@ -163727,12 +163855,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
         if (unlikely(__pyx_v_bstring == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-          __PYX_ERR(9, 1638, __pyx_L1_error)
+          __PYX_ERR(9, 1643, __pyx_L1_error)
         }
-        __pyx_t_15 = PyBytes_GET_SIZE(__pyx_v_bstring); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1638, __pyx_L1_error)
+        __pyx_t_15 = PyBytes_GET_SIZE(__pyx_v_bstring); if (unlikely(__pyx_t_15 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1643, __pyx_L1_error)
         (void)(xmlOutputBufferWrite(__pyx_v_self->_c_out, __pyx_t_15, PyBytes_AS_STRING(__pyx_v_bstring)));
 
-        /* "src/lxml/serializer.pxi":1635
+        /* "src/lxml/serializer.pxi":1640
  * 
  *                 ns, name, _, _ = self._element_stack[-1]
  *                 if (c_method == OUTPUT_METHOD_HTML and             # <<<<<<<<<<<<<<
@@ -163742,7 +163870,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         goto __pyx_L13;
       }
 
-      /* "src/lxml/serializer.pxi":1641
+      /* "src/lxml/serializer.pxi":1646
  * 
  *                 else:
  *                     tree.xmlOutputBufferWriteEscape(self._c_out, _xcstr(bstring), NULL)             # <<<<<<<<<<<<<<
@@ -163754,7 +163882,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       }
       __pyx_L13:;
 
-      /* "src/lxml/serializer.pxi":1626
+      /* "src/lxml/serializer.pxi":1631
  * 
  *         for content in args:
  *             if _isString(content):             # <<<<<<<<<<<<<<
@@ -163764,14 +163892,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       goto __pyx_L5;
     }
 
-    /* "src/lxml/serializer.pxi":1643
+    /* "src/lxml/serializer.pxi":1648
  *                     tree.xmlOutputBufferWriteEscape(self._c_out, _xcstr(bstring), NULL)
  * 
  *             elif iselement(content):             # <<<<<<<<<<<<<<
  *                 if self._status > WRITER_IN_ELEMENT:
  *                     raise LxmlSyntaxError("cannot append trailing element to complete XML document")
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_iselement); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1643, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_iselement); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1648, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_11);
     __pyx_t_10 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
@@ -163785,14 +163913,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
     }
     __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_v_content) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_v_content);
     __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-    if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1643, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1648, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
-    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(9, 1643, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(9, 1648, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     if (__pyx_t_7) {
 
-      /* "src/lxml/serializer.pxi":1644
+      /* "src/lxml/serializer.pxi":1649
  * 
  *             elif iselement(content):
  *                 if self._status > WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -163802,14 +163930,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_7 = ((__pyx_v_self->_status > __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT) != 0);
       if (unlikely(__pyx_t_7)) {
 
-        /* "src/lxml/serializer.pxi":1645
+        /* "src/lxml/serializer.pxi":1650
  *             elif iselement(content):
  *                 if self._status > WRITER_IN_ELEMENT:
  *                     raise LxmlSyntaxError("cannot append trailing element to complete XML document")             # <<<<<<<<<<<<<<
  *                 _writeNodeToBuffer(self._c_out, (<_Element>content)._c_node,
  *                                    self._c_encoding, NULL, c_method,
  */
-        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1645, __pyx_L1_error)
+        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1650, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_11);
         __pyx_t_10 = NULL;
         if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_11))) {
@@ -163823,14 +163951,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         }
         __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_10, __pyx_kp_s_cannot_append_trailing_element_t) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_kp_s_cannot_append_trailing_element_t);
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1645, __pyx_L1_error)
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1650, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         __Pyx_Raise(__pyx_t_6, 0, 0, 0);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-        __PYX_ERR(9, 1645, __pyx_L1_error)
+        __PYX_ERR(9, 1650, __pyx_L1_error)
 
-        /* "src/lxml/serializer.pxi":1644
+        /* "src/lxml/serializer.pxi":1649
  * 
  *             elif iselement(content):
  *                 if self._status > WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -163839,7 +163967,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       }
 
-      /* "src/lxml/serializer.pxi":1646
+      /* "src/lxml/serializer.pxi":1651
  *                 if self._status > WRITER_IN_ELEMENT:
  *                     raise LxmlSyntaxError("cannot append trailing element to complete XML document")
  *                 _writeNodeToBuffer(self._c_out, (<_Element>content)._c_node,             # <<<<<<<<<<<<<<
@@ -163848,7 +163976,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       __pyx_f_4lxml_5etree__writeNodeToBuffer(__pyx_v_self->_c_out, ((struct LxmlElement *)__pyx_v_content)->_c_node, __pyx_v_self->_c_encoding, NULL, __pyx_v_c_method, 0, 0, __pyx_v_pretty_print, __pyx_v_with_tail, 0);
 
-      /* "src/lxml/serializer.pxi":1649
+      /* "src/lxml/serializer.pxi":1654
  *                                    self._c_encoding, NULL, c_method,
  *                                    False, False, pretty_print, with_tail, False)
  *                 if (<_Element>content)._c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -163858,7 +163986,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_7 = ((((struct LxmlElement *)__pyx_v_content)->_c_node->type == XML_ELEMENT_NODE) != 0);
       if (__pyx_t_7) {
 
-        /* "src/lxml/serializer.pxi":1650
+        /* "src/lxml/serializer.pxi":1655
  *                                    False, False, pretty_print, with_tail, False)
  *                 if (<_Element>content)._c_node.type == tree.XML_ELEMENT_NODE:
  *                     if not self._element_stack:             # <<<<<<<<<<<<<<
@@ -163869,7 +163997,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
         __pyx_t_2 = ((!__pyx_t_7) != 0);
         if (__pyx_t_2) {
 
-          /* "src/lxml/serializer.pxi":1651
+          /* "src/lxml/serializer.pxi":1656
  *                 if (<_Element>content)._c_node.type == tree.XML_ELEMENT_NODE:
  *                     if not self._element_stack:
  *                         self._status = WRITER_FINISHED             # <<<<<<<<<<<<<<
@@ -163878,7 +164006,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
           __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_FINISHED;
 
-          /* "src/lxml/serializer.pxi":1650
+          /* "src/lxml/serializer.pxi":1655
  *                                    False, False, pretty_print, with_tail, False)
  *                 if (<_Element>content)._c_node.type == tree.XML_ELEMENT_NODE:
  *                     if not self._element_stack:             # <<<<<<<<<<<<<<
@@ -163887,7 +164015,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
         }
 
-        /* "src/lxml/serializer.pxi":1649
+        /* "src/lxml/serializer.pxi":1654
  *                                    self._c_encoding, NULL, c_method,
  *                                    False, False, pretty_print, with_tail, False)
  *                 if (<_Element>content)._c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<<
@@ -163896,7 +164024,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
       }
 
-      /* "src/lxml/serializer.pxi":1643
+      /* "src/lxml/serializer.pxi":1648
  *                     tree.xmlOutputBufferWriteEscape(self._c_out, _xcstr(bstring), NULL)
  * 
  *             elif iselement(content):             # <<<<<<<<<<<<<<
@@ -163906,7 +164034,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       goto __pyx_L5;
     }
 
-    /* "src/lxml/serializer.pxi":1653
+    /* "src/lxml/serializer.pxi":1658
  *                         self._status = WRITER_FINISHED
  * 
  *             elif content is not None:             # <<<<<<<<<<<<<<
@@ -163917,14 +164045,14 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
     __pyx_t_7 = (__pyx_t_2 != 0);
     if (unlikely(__pyx_t_7)) {
 
-      /* "src/lxml/serializer.pxi":1655
+      /* "src/lxml/serializer.pxi":1660
  *             elif content is not None:
  *                 raise TypeError(
  *                     f"got invalid input value of type {type(content)}, expected string or Element")             # <<<<<<<<<<<<<<
  *             self._handle_error(self._c_out.error)
  *         if not self._buffered:
  */
-      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1655, __pyx_L1_error)
+      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1660, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_15 = 0;
       __pyx_t_16 = 127;
@@ -163932,7 +164060,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_15 += 32;
       __Pyx_GIVEREF(__pyx_kp_u_got_invalid_input_value_of_type);
       PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_kp_u_got_invalid_input_value_of_type);
-      __pyx_t_11 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_content)), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1655, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyObject_FormatSimple(((PyObject *)Py_TYPE(__pyx_v_content)), __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1660, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       __pyx_t_16 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_16) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_16;
       __pyx_t_15 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
@@ -163943,25 +164071,25 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
       __pyx_t_15 += 28;
       __Pyx_GIVEREF(__pyx_kp_u_expected_string_or_Element);
       PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_kp_u_expected_string_or_Element);
-      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1655, __pyx_L1_error)
+      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_15, __pyx_t_16); if (unlikely(!__pyx_t_11)) __PYX_ERR(9, 1660, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_11);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "src/lxml/serializer.pxi":1654
+      /* "src/lxml/serializer.pxi":1659
  * 
  *             elif content is not None:
  *                 raise TypeError(             # <<<<<<<<<<<<<<
  *                     f"got invalid input value of type {type(content)}, expected string or Element")
  *             self._handle_error(self._c_out.error)
  */
-      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1654, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1659, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(9, 1654, __pyx_L1_error)
+      __PYX_ERR(9, 1659, __pyx_L1_error)
 
-      /* "src/lxml/serializer.pxi":1653
+      /* "src/lxml/serializer.pxi":1658
  *                         self._status = WRITER_FINISHED
  * 
  *             elif content is not None:             # <<<<<<<<<<<<<<
@@ -163971,18 +164099,18 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
     }
     __pyx_L5:;
 
-    /* "src/lxml/serializer.pxi":1656
+    /* "src/lxml/serializer.pxi":1661
  *                 raise TypeError(
  *                     f"got invalid input value of type {type(content)}, expected string or Element")
  *             self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)
  */
-    __pyx_t_6 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1656, __pyx_L1_error)
+    __pyx_t_6 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_6)) __PYX_ERR(9, 1661, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "src/lxml/serializer.pxi":1625
+    /* "src/lxml/serializer.pxi":1630
  *         c_method = self._method if method is None else _findOutputMethod(method)
  * 
  *         for content in args:             # <<<<<<<<<<<<<<
@@ -163993,7 +164121,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-  /* "src/lxml/serializer.pxi":1657
+  /* "src/lxml/serializer.pxi":1662
  *                     f"got invalid input value of type {type(content)}, expected string or Element")
  *             self._handle_error(self._c_out.error)
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -164003,7 +164131,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   __pyx_t_7 = ((!(__pyx_v_self->_buffered != 0)) != 0);
   if (__pyx_t_7) {
 
-    /* "src/lxml/serializer.pxi":1658
+    /* "src/lxml/serializer.pxi":1663
  *             self._handle_error(self._c_out.error)
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -164012,18 +164140,18 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
     (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-    /* "src/lxml/serializer.pxi":1659
+    /* "src/lxml/serializer.pxi":1664
  *         if not self._buffered:
  *             tree.xmlOutputBufferFlush(self._c_out)
  *             self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *     def flush(self):
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1659, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1664, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1657
+    /* "src/lxml/serializer.pxi":1662
  *                     f"got invalid input value of type {type(content)}, expected string or Element")
  *             self._handle_error(self._c_out.error)
  *         if not self._buffered:             # <<<<<<<<<<<<<<
@@ -164032,7 +164160,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
  */
   }
 
-  /* "src/lxml/serializer.pxi":1614
+  /* "src/lxml/serializer.pxi":1619
  *         return flat_namespaces_map, new_namespaces
  * 
  *     def write(self, *args, bint with_tail=True, bint pretty_print=False, method=None):             # <<<<<<<<<<<<<<
@@ -164064,7 +164192,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_12write(struct _
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1661
+/* "src/lxml/serializer.pxi":1666
  *             self._handle_error(self._c_out.error)
  * 
  *     def flush(self):             # <<<<<<<<<<<<<<
@@ -164096,7 +164224,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_14flush(struct _
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("flush", 0);
 
-  /* "src/lxml/serializer.pxi":1666
+  /* "src/lxml/serializer.pxi":1671
  *         Write any pending content of the current output buffer to the stream.
  *         """
  *         assert self._c_out is not NULL             # <<<<<<<<<<<<<<
@@ -164107,12 +164235,12 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_14flush(struct _
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_out != NULL) != 0))) {
       PyErr_SetNone(PyExc_AssertionError);
-      __PYX_ERR(9, 1666, __pyx_L1_error)
+      __PYX_ERR(9, 1671, __pyx_L1_error)
     }
   }
   #endif
 
-  /* "src/lxml/serializer.pxi":1667
+  /* "src/lxml/serializer.pxi":1672
  *         """
  *         assert self._c_out is not NULL
  *         tree.xmlOutputBufferFlush(self._c_out)             # <<<<<<<<<<<<<<
@@ -164121,18 +164249,18 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_14flush(struct _
  */
   (void)(xmlOutputBufferFlush(__pyx_v_self->_c_out));
 
-  /* "src/lxml/serializer.pxi":1668
+  /* "src/lxml/serializer.pxi":1673
  *         assert self._c_out is not NULL
  *         tree.xmlOutputBufferFlush(self._c_out)
  *         self._handle_error(self._c_out.error)             # <<<<<<<<<<<<<<
  * 
  *     cdef _close(self, bint raise_on_error):
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1668, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_self->_c_out->error); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1673, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1661
+  /* "src/lxml/serializer.pxi":1666
  *             self._handle_error(self._c_out.error)
  * 
  *     def flush(self):             # <<<<<<<<<<<<<<
@@ -164153,7 +164281,7 @@ static PyObject *__pyx_pf_4lxml_5etree_22_IncrementalFileWriter_14flush(struct _
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1670
+/* "src/lxml/serializer.pxi":1675
  *         self._handle_error(self._c_out.error)
  * 
  *     cdef _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
@@ -164175,7 +164303,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_close", 0);
 
-  /* "src/lxml/serializer.pxi":1671
+  /* "src/lxml/serializer.pxi":1676
  * 
  *     cdef _close(self, bint raise_on_error):
  *         if raise_on_error:             # <<<<<<<<<<<<<<
@@ -164185,7 +164313,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   __pyx_t_1 = (__pyx_v_raise_on_error != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1672
+    /* "src/lxml/serializer.pxi":1677
  *     cdef _close(self, bint raise_on_error):
  *         if raise_on_error:
  *             if self._status < WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -164195,14 +164323,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
     __pyx_t_1 = ((__pyx_v_self->_status < __pyx_e_4lxml_5etree_WRITER_IN_ELEMENT) != 0);
     if (unlikely(__pyx_t_1)) {
 
-      /* "src/lxml/serializer.pxi":1673
+      /* "src/lxml/serializer.pxi":1678
  *         if raise_on_error:
  *             if self._status < WRITER_IN_ELEMENT:
  *                 raise LxmlSyntaxError("no content written")             # <<<<<<<<<<<<<<
  *             if self._element_stack:
  *                 raise LxmlSyntaxError("pending open tags on close")
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1673, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1678, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_4 = NULL;
       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -164216,14 +164344,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
       }
       __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_no_content_written) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_no_content_written);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1673, __pyx_L1_error)
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1678, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(9, 1673, __pyx_L1_error)
+      __PYX_ERR(9, 1678, __pyx_L1_error)
 
-      /* "src/lxml/serializer.pxi":1672
+      /* "src/lxml/serializer.pxi":1677
  *     cdef _close(self, bint raise_on_error):
  *         if raise_on_error:
  *             if self._status < WRITER_IN_ELEMENT:             # <<<<<<<<<<<<<<
@@ -164232,7 +164360,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
     }
 
-    /* "src/lxml/serializer.pxi":1674
+    /* "src/lxml/serializer.pxi":1679
  *             if self._status < WRITER_IN_ELEMENT:
  *                 raise LxmlSyntaxError("no content written")
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -164242,14 +164370,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
     __pyx_t_1 = (__pyx_v_self->_element_stack != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_element_stack) != 0);
     if (unlikely(__pyx_t_1)) {
 
-      /* "src/lxml/serializer.pxi":1675
+      /* "src/lxml/serializer.pxi":1680
  *                 raise LxmlSyntaxError("no content written")
  *             if self._element_stack:
  *                 raise LxmlSyntaxError("pending open tags on close")             # <<<<<<<<<<<<<<
  *         error_result = self._c_out.error
  *         if error_result == xmlerror.XML_ERR_OK:
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1675, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1680, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_4 = NULL;
       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -164263,14 +164391,14 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
       }
       __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_pending_open_tags_on_close) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_pending_open_tags_on_close);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1675, __pyx_L1_error)
+      if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1680, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
       __Pyx_Raise(__pyx_t_2, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-      __PYX_ERR(9, 1675, __pyx_L1_error)
+      __PYX_ERR(9, 1680, __pyx_L1_error)
 
-      /* "src/lxml/serializer.pxi":1674
+      /* "src/lxml/serializer.pxi":1679
  *             if self._status < WRITER_IN_ELEMENT:
  *                 raise LxmlSyntaxError("no content written")
  *             if self._element_stack:             # <<<<<<<<<<<<<<
@@ -164279,7 +164407,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
     }
 
-    /* "src/lxml/serializer.pxi":1671
+    /* "src/lxml/serializer.pxi":1676
  * 
  *     cdef _close(self, bint raise_on_error):
  *         if raise_on_error:             # <<<<<<<<<<<<<<
@@ -164288,7 +164416,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
   }
 
-  /* "src/lxml/serializer.pxi":1676
+  /* "src/lxml/serializer.pxi":1681
  *             if self._element_stack:
  *                 raise LxmlSyntaxError("pending open tags on close")
  *         error_result = self._c_out.error             # <<<<<<<<<<<<<<
@@ -164298,7 +164426,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   __pyx_t_5 = __pyx_v_self->_c_out->error;
   __pyx_v_error_result = __pyx_t_5;
 
-  /* "src/lxml/serializer.pxi":1677
+  /* "src/lxml/serializer.pxi":1682
  *                 raise LxmlSyntaxError("pending open tags on close")
  *         error_result = self._c_out.error
  *         if error_result == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -164308,7 +164436,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   __pyx_t_1 = ((__pyx_v_error_result == XML_ERR_OK) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1678
+    /* "src/lxml/serializer.pxi":1683
  *         error_result = self._c_out.error
  *         if error_result == xmlerror.XML_ERR_OK:
  *             error_result = tree.xmlOutputBufferClose(self._c_out)             # <<<<<<<<<<<<<<
@@ -164317,7 +164445,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
     __pyx_v_error_result = xmlOutputBufferClose(__pyx_v_self->_c_out);
 
-    /* "src/lxml/serializer.pxi":1679
+    /* "src/lxml/serializer.pxi":1684
  *         if error_result == xmlerror.XML_ERR_OK:
  *             error_result = tree.xmlOutputBufferClose(self._c_out)
  *             if error_result != -1:             # <<<<<<<<<<<<<<
@@ -164327,7 +164455,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
     __pyx_t_1 = ((__pyx_v_error_result != -1L) != 0);
     if (__pyx_t_1) {
 
-      /* "src/lxml/serializer.pxi":1680
+      /* "src/lxml/serializer.pxi":1685
  *             error_result = tree.xmlOutputBufferClose(self._c_out)
  *             if error_result != -1:
  *                 error_result = xmlerror.XML_ERR_OK             # <<<<<<<<<<<<<<
@@ -164336,7 +164464,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
       __pyx_v_error_result = XML_ERR_OK;
 
-      /* "src/lxml/serializer.pxi":1679
+      /* "src/lxml/serializer.pxi":1684
  *         if error_result == xmlerror.XML_ERR_OK:
  *             error_result = tree.xmlOutputBufferClose(self._c_out)
  *             if error_result != -1:             # <<<<<<<<<<<<<<
@@ -164345,7 +164473,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
     }
 
-    /* "src/lxml/serializer.pxi":1677
+    /* "src/lxml/serializer.pxi":1682
  *                 raise LxmlSyntaxError("pending open tags on close")
  *         error_result = self._c_out.error
  *         if error_result == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -164355,7 +164483,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
     goto __pyx_L6;
   }
 
-  /* "src/lxml/serializer.pxi":1682
+  /* "src/lxml/serializer.pxi":1687
  *                 error_result = xmlerror.XML_ERR_OK
  *         else:
  *             tree.xmlOutputBufferClose(self._c_out)             # <<<<<<<<<<<<<<
@@ -164367,7 +164495,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   }
   __pyx_L6:;
 
-  /* "src/lxml/serializer.pxi":1683
+  /* "src/lxml/serializer.pxi":1688
  *         else:
  *             tree.xmlOutputBufferClose(self._c_out)
  *         self._status = WRITER_FINISHED             # <<<<<<<<<<<<<<
@@ -164376,7 +164504,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
   __pyx_v_self->_status = __pyx_e_4lxml_5etree_WRITER_FINISHED;
 
-  /* "src/lxml/serializer.pxi":1684
+  /* "src/lxml/serializer.pxi":1689
  *             tree.xmlOutputBufferClose(self._c_out)
  *         self._status = WRITER_FINISHED
  *         self._c_out = NULL             # <<<<<<<<<<<<<<
@@ -164385,7 +164513,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
   __pyx_v_self->_c_out = NULL;
 
-  /* "src/lxml/serializer.pxi":1685
+  /* "src/lxml/serializer.pxi":1690
  *         self._status = WRITER_FINISHED
  *         self._c_out = NULL
  *         del self._element_stack[:]             # <<<<<<<<<<<<<<
@@ -164394,11 +164522,11 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
   if (unlikely(__pyx_v_self->_element_stack == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1685, __pyx_L1_error)
+    __PYX_ERR(9, 1690, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_element_stack, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1685, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_element_stack, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1690, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1686
+  /* "src/lxml/serializer.pxi":1691
  *         self._c_out = NULL
  *         del self._element_stack[:]
  *         if raise_on_error:             # <<<<<<<<<<<<<<
@@ -164408,18 +164536,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   __pyx_t_1 = (__pyx_v_raise_on_error != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1687
+    /* "src/lxml/serializer.pxi":1692
  *         del self._element_stack[:]
  *         if raise_on_error:
  *             self._handle_error(error_result)             # <<<<<<<<<<<<<<
  * 
  *     cdef _handle_error(self, int error_result):
  */
-    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_error_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1687, __pyx_L1_error)
+    __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(__pyx_v_self, __pyx_v_error_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1692, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "src/lxml/serializer.pxi":1686
+    /* "src/lxml/serializer.pxi":1691
  *         self._c_out = NULL
  *         del self._element_stack[:]
  *         if raise_on_error:             # <<<<<<<<<<<<<<
@@ -164428,7 +164556,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
  */
   }
 
-  /* "src/lxml/serializer.pxi":1670
+  /* "src/lxml/serializer.pxi":1675
  *         self._handle_error(self._c_out.error)
  * 
  *     cdef _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
@@ -164451,7 +164579,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(struct __p
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1689
+/* "src/lxml/serializer.pxi":1694
  *             self._handle_error(error_result)
  * 
  *     cdef _handle_error(self, int error_result):             # <<<<<<<<<<<<<<
@@ -164471,7 +164599,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_handle_error", 0);
 
-  /* "src/lxml/serializer.pxi":1690
+  /* "src/lxml/serializer.pxi":1695
  * 
  *     cdef _handle_error(self, int error_result):
  *         if error_result != xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -164481,7 +164609,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
   __pyx_t_1 = ((__pyx_v_error_result != XML_ERR_OK) != 0);
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1691
+    /* "src/lxml/serializer.pxi":1696
  *     cdef _handle_error(self, int error_result):
  *         if error_result != xmlerror.XML_ERR_OK:
  *             if self._target is not None:             # <<<<<<<<<<<<<<
@@ -164492,16 +164620,16 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
     __pyx_t_2 = (__pyx_t_1 != 0);
     if (__pyx_t_2) {
 
-      /* "src/lxml/serializer.pxi":1692
+      /* "src/lxml/serializer.pxi":1697
  *         if error_result != xmlerror.XML_ERR_OK:
  *             if self._target is not None:
  *                 self._target._exc_context._raise_if_stored()             # <<<<<<<<<<<<<<
  *             _raiseSerialisationError(error_result)
  * 
  */
-      __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_target->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_target->_exc_context); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1692, __pyx_L1_error)
+      __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_target->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_target->_exc_context); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(9, 1697, __pyx_L1_error)
 
-      /* "src/lxml/serializer.pxi":1691
+      /* "src/lxml/serializer.pxi":1696
  *     cdef _handle_error(self, int error_result):
  *         if error_result != xmlerror.XML_ERR_OK:
  *             if self._target is not None:             # <<<<<<<<<<<<<<
@@ -164510,18 +164638,18 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
  */
     }
 
-    /* "src/lxml/serializer.pxi":1693
+    /* "src/lxml/serializer.pxi":1698
  *             if self._target is not None:
  *                 self._target._exc_context._raise_if_stored()
  *             _raiseSerialisationError(error_result)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-    __pyx_t_4 = __pyx_f_4lxml_5etree__raiseSerialisationError(__pyx_v_error_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1693, __pyx_L1_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree__raiseSerialisationError(__pyx_v_error_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(9, 1698, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
-    /* "src/lxml/serializer.pxi":1690
+    /* "src/lxml/serializer.pxi":1695
  * 
  *     cdef _handle_error(self, int error_result):
  *         if error_result != xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<<
@@ -164530,7 +164658,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
  */
   }
 
-  /* "src/lxml/serializer.pxi":1689
+  /* "src/lxml/serializer.pxi":1694
  *             self._handle_error(error_result)
  * 
  *     cdef _handle_error(self, int error_result):             # <<<<<<<<<<<<<<
@@ -164551,7 +164679,7 @@ static PyObject *__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error(str
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1700
+/* "src/lxml/serializer.pxi":1705
  * cdef class _AsyncDataWriter:
  *     cdef list _data
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -164584,14 +164712,14 @@ static int __pyx_pf_4lxml_5etree_16_AsyncDataWriter___cinit__(struct __pyx_obj_4
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/serializer.pxi":1701
+  /* "src/lxml/serializer.pxi":1706
  *     cdef list _data
  *     def __cinit__(self):
  *         self._data = []             # <<<<<<<<<<<<<<
  * 
  *     cdef bytes collect(self):
  */
-  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1701, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1706, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_data);
@@ -164599,7 +164727,7 @@ static int __pyx_pf_4lxml_5etree_16_AsyncDataWriter___cinit__(struct __pyx_obj_4
   __pyx_v_self->_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1700
+  /* "src/lxml/serializer.pxi":1705
  * cdef class _AsyncDataWriter:
  *     cdef list _data
  *     def __cinit__(self):             # <<<<<<<<<<<<<<
@@ -164619,7 +164747,7 @@ static int __pyx_pf_4lxml_5etree_16_AsyncDataWriter___cinit__(struct __pyx_obj_4
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1703
+/* "src/lxml/serializer.pxi":1708
  *         self._data = []
  * 
  *     cdef bytes collect(self):             # <<<<<<<<<<<<<<
@@ -164638,7 +164766,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_ob
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("collect", 0);
 
-  /* "src/lxml/serializer.pxi":1704
+  /* "src/lxml/serializer.pxi":1709
  * 
  *     cdef bytes collect(self):
  *         data = b''.join(self._data)             # <<<<<<<<<<<<<<
@@ -164647,13 +164775,13 @@ static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_ob
  */
   __pyx_t_1 = __pyx_v_self->_data;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyBytes_Join(__pyx_kp_b__12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1704, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyBytes_Join(__pyx_kp_b__12, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1709, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_v_data = __pyx_t_2;
   __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1705
+  /* "src/lxml/serializer.pxi":1710
  *     cdef bytes collect(self):
  *         data = b''.join(self._data)
  *         del self._data[:]             # <<<<<<<<<<<<<<
@@ -164662,11 +164790,11 @@ static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_ob
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-    __PYX_ERR(9, 1705, __pyx_L1_error)
+    __PYX_ERR(9, 1710, __pyx_L1_error)
   }
-  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1705, __pyx_L1_error)
+  if (__Pyx_PyObject_DelSlice(__pyx_v_self->_data, 0, 0, NULL, NULL, NULL, 0, 0, 1) < 0) __PYX_ERR(9, 1710, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1706
+  /* "src/lxml/serializer.pxi":1711
  *         data = b''.join(self._data)
  *         del self._data[:]
  *         return data             # <<<<<<<<<<<<<<
@@ -164674,12 +164802,12 @@ static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_ob
  *     def write(self, data):
  */
   __Pyx_XDECREF(__pyx_r);
-  if (!(likely(PyBytes_CheckExact(__pyx_v_data))||((__pyx_v_data) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_data)->tp_name), 0))) __PYX_ERR(9, 1706, __pyx_L1_error)
+  if (!(likely(PyBytes_CheckExact(__pyx_v_data))||((__pyx_v_data) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_data)->tp_name), 0))) __PYX_ERR(9, 1711, __pyx_L1_error)
   __Pyx_INCREF(__pyx_v_data);
   __pyx_r = ((PyObject*)__pyx_v_data);
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1703
+  /* "src/lxml/serializer.pxi":1708
  *         self._data = []
  * 
  *     cdef bytes collect(self):             # <<<<<<<<<<<<<<
@@ -164700,7 +164828,7 @@ static PyObject *__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1708
+/* "src/lxml/serializer.pxi":1713
  *         return data
  * 
  *     def write(self, data):             # <<<<<<<<<<<<<<
@@ -164731,7 +164859,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_AsyncDataWriter_2write(struct __pyx_ob
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("write", 0);
 
-  /* "src/lxml/serializer.pxi":1709
+  /* "src/lxml/serializer.pxi":1714
  * 
  *     def write(self, data):
  *         self._data.append(data)             # <<<<<<<<<<<<<<
@@ -164740,11 +164868,11 @@ static PyObject *__pyx_pf_4lxml_5etree_16_AsyncDataWriter_2write(struct __pyx_ob
  */
   if (unlikely(__pyx_v_self->_data == Py_None)) {
     PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
-    __PYX_ERR(9, 1709, __pyx_L1_error)
+    __PYX_ERR(9, 1714, __pyx_L1_error)
   }
-  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 1709, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_data, __pyx_v_data); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(9, 1714, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1708
+  /* "src/lxml/serializer.pxi":1713
  *         return data
  * 
  *     def write(self, data):             # <<<<<<<<<<<<<<
@@ -164764,7 +164892,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_AsyncDataWriter_2write(struct __pyx_ob
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1711
+/* "src/lxml/serializer.pxi":1716
  *         self._data.append(data)
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
@@ -164798,7 +164926,7 @@ static PyObject *__pyx_pf_4lxml_5etree_16_AsyncDataWriter_4close(CYTHON_UNUSED s
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1725
+/* "src/lxml/serializer.pxi":1730
  *     cdef bint _buffered
  * 
  *     def __cinit__(self, async_outfile, bytes encoding, int compresslevel, bint close,             # <<<<<<<<<<<<<<
@@ -164852,35 +164980,35 @@ static int __pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_1__cinit__(PyObje
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_encoding)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(9, 1725, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 1); __PYX_ERR(9, 1730, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compresslevel)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(9, 1725, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 2); __PYX_ERR(9, 1730, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_close)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(9, 1725, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 3); __PYX_ERR(9, 1730, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  4:
         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_buffered)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(9, 1725, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 4); __PYX_ERR(9, 1730, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  5:
         if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(9, 1725, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, 5); __PYX_ERR(9, 1730, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1725, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1730, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
       goto __pyx_L5_argtuple_error;
@@ -164894,20 +165022,20 @@ static int __pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_1__cinit__(PyObje
     }
     __pyx_v_async_outfile = values[0];
     __pyx_v_encoding = ((PyObject*)values[1]);
-    __pyx_v_compresslevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_compresslevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1725, __pyx_L3_error)
-    __pyx_v_close = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_close == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1725, __pyx_L3_error)
-    __pyx_v_buffered = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_buffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1726, __pyx_L3_error)
-    __pyx_v_method = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1726, __pyx_L3_error)
+    __pyx_v_compresslevel = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_compresslevel == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1730, __pyx_L3_error)
+    __pyx_v_close = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_close == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1730, __pyx_L3_error)
+    __pyx_v_buffered = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_buffered == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1731, __pyx_L3_error)
+    __pyx_v_method = __Pyx_PyInt_As_int(values[5]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1731, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1725, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1730, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._AsyncIncrementalFileWriter.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyBytes_Type), 1, "encoding", 1))) __PYX_ERR(9, 1725, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_encoding), (&PyBytes_Type), 1, "encoding", 1))) __PYX_ERR(9, 1730, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(((struct __pyx_obj_4lxml_5etree__AsyncIncrementalFileWriter *)__pyx_v_self), __pyx_v_async_outfile, __pyx_v_encoding, __pyx_v_compresslevel, __pyx_v_close, __pyx_v_buffered, __pyx_v_method);
 
   /* function exit code */
@@ -164930,7 +165058,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/serializer.pxi":1727
+  /* "src/lxml/serializer.pxi":1732
  *     def __cinit__(self, async_outfile, bytes encoding, int compresslevel, bint close,
  *                   bint buffered, int method):
  *         self._flush_after_writes = 20             # <<<<<<<<<<<<<<
@@ -164939,7 +165067,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
  */
   __pyx_v_self->_flush_after_writes = 20;
 
-  /* "src/lxml/serializer.pxi":1728
+  /* "src/lxml/serializer.pxi":1733
  *                   bint buffered, int method):
  *         self._flush_after_writes = 20
  *         self._async_outfile = async_outfile             # <<<<<<<<<<<<<<
@@ -164952,7 +165080,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   __Pyx_DECREF(__pyx_v_self->_async_outfile);
   __pyx_v_self->_async_outfile = __pyx_v_async_outfile;
 
-  /* "src/lxml/serializer.pxi":1729
+  /* "src/lxml/serializer.pxi":1734
  *         self._flush_after_writes = 20
  *         self._async_outfile = async_outfile
  *         self._should_close = close             # <<<<<<<<<<<<<<
@@ -164961,7 +165089,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
  */
   __pyx_v_self->_should_close = __pyx_v_close;
 
-  /* "src/lxml/serializer.pxi":1730
+  /* "src/lxml/serializer.pxi":1735
  *         self._async_outfile = async_outfile
  *         self._should_close = close
  *         self._buffered = buffered             # <<<<<<<<<<<<<<
@@ -164970,14 +165098,14 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
  */
   __pyx_v_self->_buffered = __pyx_v_buffered;
 
-  /* "src/lxml/serializer.pxi":1731
+  /* "src/lxml/serializer.pxi":1736
  *         self._should_close = close
  *         self._buffered = buffered
  *         self._buffer = _AsyncDataWriter()             # <<<<<<<<<<<<<<
  *         self._writer = _IncrementalFileWriter(
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1731, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1736, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_buffer);
@@ -164985,24 +165113,24 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   __pyx_v_self->_buffer = ((struct __pyx_obj_4lxml_5etree__AsyncDataWriter *)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1733
+  /* "src/lxml/serializer.pxi":1738
  *         self._buffer = _AsyncDataWriter()
  *         self._writer = _IncrementalFileWriter(
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)             # <<<<<<<<<<<<<<
  * 
  *     cdef bytes _flush(self):
  */
-  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_compresslevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1733, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_compresslevel); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1738, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "src/lxml/serializer.pxi":1732
+  /* "src/lxml/serializer.pxi":1737
  *         self._buffered = buffered
  *         self._buffer = _AsyncDataWriter()
  *         self._writer = _IncrementalFileWriter(             # <<<<<<<<<<<<<<
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)
  * 
  */
-  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1732, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1737, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_v_self->_buffer));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_buffer));
@@ -165014,30 +165142,30 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1733
+  /* "src/lxml/serializer.pxi":1738
  *         self._buffer = _AsyncDataWriter()
  *         self._writer = _IncrementalFileWriter(
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)             # <<<<<<<<<<<<<<
  * 
  *     cdef bytes _flush(self):
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1733, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1738, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_close, Py_True) < 0) __PYX_ERR(9, 1733, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_buffered, Py_False) < 0) __PYX_ERR(9, 1733, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1733, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_close, Py_True) < 0) __PYX_ERR(9, 1738, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_buffered, Py_False) < 0) __PYX_ERR(9, 1738, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_method); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1738, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_method, __pyx_t_3) < 0) __PYX_ERR(9, 1733, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_method, __pyx_t_3) < 0) __PYX_ERR(9, 1738, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1732
+  /* "src/lxml/serializer.pxi":1737
  *         self._buffered = buffered
  *         self._buffer = _AsyncDataWriter()
  *         self._writer = _IncrementalFileWriter(             # <<<<<<<<<<<<<<
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1732, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter), __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1737, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -165047,7 +165175,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   __pyx_v_self->_writer = ((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1725
+  /* "src/lxml/serializer.pxi":1730
  *     cdef bint _buffered
  * 
  *     def __cinit__(self, async_outfile, bytes encoding, int compresslevel, bint close,             # <<<<<<<<<<<<<<
@@ -165069,7 +165197,7 @@ static int __pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter___cinit__(struct
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1735
+/* "src/lxml/serializer.pxi":1740
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)
  * 
  *     cdef bytes _flush(self):             # <<<<<<<<<<<<<<
@@ -165089,7 +165217,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("_flush", 0);
 
-  /* "src/lxml/serializer.pxi":1736
+  /* "src/lxml/serializer.pxi":1741
  * 
  *     cdef bytes _flush(self):
  *         if not self._buffered or len(self._buffer._data) > self._flush_after_writes:             # <<<<<<<<<<<<<<
@@ -165106,16 +165234,16 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
   __Pyx_INCREF(__pyx_t_3);
   if (unlikely(__pyx_t_3 == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(9, 1736, __pyx_L1_error)
+    __PYX_ERR(9, 1741, __pyx_L1_error)
   }
-  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1736, __pyx_L1_error)
+  __pyx_t_4 = PyList_GET_SIZE(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(9, 1741, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_2 = ((__pyx_t_4 > __pyx_v_self->_flush_after_writes) != 0);
   __pyx_t_1 = __pyx_t_2;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
 
-    /* "src/lxml/serializer.pxi":1737
+    /* "src/lxml/serializer.pxi":1742
  *     cdef bytes _flush(self):
  *         if not self._buffered or len(self._buffer._data) > self._flush_after_writes:
  *             return self._buffer.collect()             # <<<<<<<<<<<<<<
@@ -165123,13 +165251,13 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
  * 
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_v_self->_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1737, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_v_self->_buffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1742, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_r = ((PyObject*)__pyx_t_3);
     __pyx_t_3 = 0;
     goto __pyx_L0;
 
-    /* "src/lxml/serializer.pxi":1736
+    /* "src/lxml/serializer.pxi":1741
  * 
  *     cdef bytes _flush(self):
  *         if not self._buffered or len(self._buffer._data) > self._flush_after_writes:             # <<<<<<<<<<<<<<
@@ -165138,7 +165266,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
  */
   }
 
-  /* "src/lxml/serializer.pxi":1738
+  /* "src/lxml/serializer.pxi":1743
  *         if not self._buffered or len(self._buffer._data) > self._flush_after_writes:
  *             return self._buffer.collect()
  *         return None             # <<<<<<<<<<<<<<
@@ -165149,7 +165277,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
   __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1735
+  /* "src/lxml/serializer.pxi":1740
  *             self._buffer, encoding, compresslevel, close=True, buffered=False, method=method)
  * 
  *     cdef bytes _flush(self):             # <<<<<<<<<<<<<<
@@ -165169,7 +165297,7 @@ static PyObject *__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(struc
 }
 static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1740
+/* "src/lxml/serializer.pxi":1745
  *         return None
  * 
  *     async def flush(self):             # <<<<<<<<<<<<<<
@@ -165203,7 +165331,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_2flush(stru
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_4_flush *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1740, __pyx_L1_error)
+    __PYX_ERR(9, 1745, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -165211,7 +165339,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_2flush(stru
   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4, __pyx_codeobj__84, (PyObject *) __pyx_cur_scope, __pyx_n_s_flush, __pyx_n_s_AsyncIncrementalFileWriter_flus, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1740, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4, __pyx_codeobj__84, (PyObject *) __pyx_cur_scope, __pyx_n_s_flush, __pyx_n_s_AsyncIncrementalFileWriter_flus, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1745, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -165248,16 +165376,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1740, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1745, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1741
+  /* "src/lxml/serializer.pxi":1746
  * 
  *     async def flush(self):
  *         self._writer.flush()             # <<<<<<<<<<<<<<
  *         data = self._buffer.collect()
  *         if data:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1741, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1746, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -165271,25 +165399,25 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
   }
   __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(9, 1741, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1746, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1742
+  /* "src/lxml/serializer.pxi":1747
  *     async def flush(self):
  *         self._writer.flush()
  *         data = self._buffer.collect()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._async_outfile.write(data)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_cur_scope->__pyx_v_self->_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1742, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_cur_scope->__pyx_v_self->_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1747, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1743
+  /* "src/lxml/serializer.pxi":1748
  *         self._writer.flush()
  *         data = self._buffer.collect()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165299,14 +165427,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
   __pyx_t_4 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/serializer.pxi":1744
+    /* "src/lxml/serializer.pxi":1749
  *         data = self._buffer.collect()
  *         if data:
  *             await self._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1744, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -165320,7 +165448,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
     }
     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1744, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1749, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -165334,16 +165462,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1744, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1749, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1744, __pyx_L1_error)
+        else __PYX_ERR(9, 1749, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1743
+    /* "src/lxml/serializer.pxi":1748
  *         self._writer.flush()
  *         data = self._buffer.collect()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165353,7 +165481,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1740
+  /* "src/lxml/serializer.pxi":1745
  *         return None
  * 
  *     async def flush(self):             # <<<<<<<<<<<<<<
@@ -165381,7 +165509,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_4generator4
 }
 static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1746
+/* "src/lxml/serializer.pxi":1751
  *             await self._async_outfile.write(data)
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
@@ -165442,7 +165570,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_decl
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_declaration") < 0)) __PYX_ERR(9, 1746, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_declaration") < 0)) __PYX_ERR(9, 1751, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -165462,7 +165590,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_decl
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_declaration", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1746, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write_declaration", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1751, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._AsyncIncrementalFileWriter.write_declaration", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -165487,7 +165615,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_5write_decl
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_5_write_declaration *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1746, __pyx_L1_error)
+    __PYX_ERR(9, 1751, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -165504,7 +165632,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_5write_decl
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_doctype);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_doctype);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5, __pyx_codeobj__85, (PyObject *) __pyx_cur_scope, __pyx_n_s_write_declaration, __pyx_n_s_AsyncIncrementalFileWriter_writ, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1746, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5, __pyx_codeobj__85, (PyObject *) __pyx_cur_scope, __pyx_n_s_write_declaration, __pyx_n_s_AsyncIncrementalFileWriter_writ, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1751, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -165543,16 +165671,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1746, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1751, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1747
+  /* "src/lxml/serializer.pxi":1752
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):
  *         self._writer.write_declaration(version, standalone, doctype)             # <<<<<<<<<<<<<<
  *         data = self._flush()
  *         if data:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write_declaration); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1747, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write_declaration); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1752, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -165569,7 +165697,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_version, __pyx_cur_scope->__pyx_v_standalone, __pyx_cur_scope->__pyx_v_doctype};
-    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1747, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1752, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -165577,13 +165705,13 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
     PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_version, __pyx_cur_scope->__pyx_v_standalone, __pyx_cur_scope->__pyx_v_doctype};
-    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1747, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1752, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
   #endif
   {
-    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1747, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(9, 1752, __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;
@@ -165597,27 +165725,27 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
     __Pyx_INCREF(__pyx_cur_scope->__pyx_v_doctype);
     __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_doctype);
     PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_cur_scope->__pyx_v_doctype);
-    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1747, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1752, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1748
+  /* "src/lxml/serializer.pxi":1753
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._async_outfile.write(data)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1748, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1753, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1749
+  /* "src/lxml/serializer.pxi":1754
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165627,14 +165755,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
   __pyx_t_6 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_6) {
 
-    /* "src/lxml/serializer.pxi":1750
+    /* "src/lxml/serializer.pxi":1755
  *         data = self._flush()
  *         if data:
  *             await self._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  *     async def write_doctype(self, doctype):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1750, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -165648,7 +165776,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
     }
     __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1750, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1755, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -165662,16 +165790,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1750, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1755, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1750, __pyx_L1_error)
+        else __PYX_ERR(9, 1755, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1749
+    /* "src/lxml/serializer.pxi":1754
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165681,7 +165809,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1746
+  /* "src/lxml/serializer.pxi":1751
  *             await self._async_outfile.write(data)
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
@@ -165710,7 +165838,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_7generator5
 }
 static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1752
+/* "src/lxml/serializer.pxi":1757
  *             await self._async_outfile.write(data)
  * 
  *     async def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
@@ -165744,7 +165872,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_8write_doct
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_6_write_doctype *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1752, __pyx_L1_error)
+    __PYX_ERR(9, 1757, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -165755,7 +165883,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_8write_doct
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_doctype);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_doctype);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator6, __pyx_codeobj__86, (PyObject *) __pyx_cur_scope, __pyx_n_s_write_doctype, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1752, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator6, __pyx_codeobj__86, (PyObject *) __pyx_cur_scope, __pyx_n_s_write_doctype, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1757, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -165792,16 +165920,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1752, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1757, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1753
+  /* "src/lxml/serializer.pxi":1758
  * 
  *     async def write_doctype(self, doctype):
  *         self._writer.write_doctype(doctype)             # <<<<<<<<<<<<<<
  *         data = self._flush()
  *         if data:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write_doctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1753, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write_doctype); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1758, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -165815,25 +165943,25 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_doctype) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_doctype);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1753, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1758, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1754
+  /* "src/lxml/serializer.pxi":1759
  *     async def write_doctype(self, doctype):
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._async_outfile.write(data)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1754, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1759, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1755
+  /* "src/lxml/serializer.pxi":1760
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165843,14 +165971,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
   __pyx_t_4 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/serializer.pxi":1756
+    /* "src/lxml/serializer.pxi":1761
  *         data = self._flush()
  *         if data:
  *             await self._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1756, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1761, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -165864,7 +165992,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
     }
     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1756, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1761, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -165878,16 +166006,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1756, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1761, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1756, __pyx_L1_error)
+        else __PYX_ERR(9, 1761, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1755
+    /* "src/lxml/serializer.pxi":1760
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -165897,7 +166025,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1752
+  /* "src/lxml/serializer.pxi":1757
  *             await self._async_outfile.write(data)
  * 
  *     async def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
@@ -165925,7 +166053,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_10generator
 }
 static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1758
+/* "src/lxml/serializer.pxi":1763
  *             await self._async_outfile.write(data)
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):             # <<<<<<<<<<<<<<
@@ -165979,7 +166107,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_12write(PyO
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "write") < 0)) __PYX_ERR(9, 1758, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "write") < 0)) __PYX_ERR(9, 1763, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
       goto __pyx_L5_argtuple_error;
@@ -165991,7 +166119,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_12write(PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1758, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1763, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_CLEAR(__pyx_v_args);
   __Pyx_AddTraceback("lxml.etree._AsyncIncrementalFileWriter.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -166018,7 +166146,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_11write(str
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_7_write *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1758, __pyx_L1_error)
+    __PYX_ERR(9, 1763, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -166038,7 +166166,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_11write(str
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator7, __pyx_codeobj__87, (PyObject *) __pyx_cur_scope, __pyx_n_s_write, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1758, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator7, __pyx_codeobj__87, (PyObject *) __pyx_cur_scope, __pyx_n_s_write, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1763, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -166075,42 +166203,42 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1758, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1763, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1759
+  /* "src/lxml/serializer.pxi":1764
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)             # <<<<<<<<<<<<<<
  *         data = self._flush()
  *         if data:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1759, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_writer), __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1759, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_with_tail, __pyx_cur_scope->__pyx_v_with_tail) < 0) __PYX_ERR(9, 1759, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pretty_print, __pyx_cur_scope->__pyx_v_pretty_print) < 0) __PYX_ERR(9, 1759, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_method, __pyx_cur_scope->__pyx_v_method) < 0) __PYX_ERR(9, 1759, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1759, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_with_tail, __pyx_cur_scope->__pyx_v_with_tail) < 0) __PYX_ERR(9, 1764, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_pretty_print, __pyx_cur_scope->__pyx_v_pretty_print) < 0) __PYX_ERR(9, 1764, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_method, __pyx_cur_scope->__pyx_v_method) < 0) __PYX_ERR(9, 1764, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1764, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1760
+  /* "src/lxml/serializer.pxi":1765
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._async_outfile.write(data)
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1760, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1765, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_GIVEREF(__pyx_t_3);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_3);
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1761
+  /* "src/lxml/serializer.pxi":1766
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -166120,14 +166248,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
   __pyx_t_4 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/serializer.pxi":1762
+    /* "src/lxml/serializer.pxi":1767
  *         data = self._flush()
  *         if data:
  *             await self._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  *     def method(self, method):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1762, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_1 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -166141,7 +166269,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
     }
     __pyx_t_3 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_1, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1762, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1767, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_3);
@@ -166155,16 +166283,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1762, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1767, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1762, __pyx_L1_error)
+        else __PYX_ERR(9, 1767, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1761
+    /* "src/lxml/serializer.pxi":1766
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -166174,7 +166302,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1758
+  /* "src/lxml/serializer.pxi":1763
  *             await self._async_outfile.write(data)
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):             # <<<<<<<<<<<<<<
@@ -166201,7 +166329,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_13generator
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1764
+/* "src/lxml/serializer.pxi":1769
  *             await self._async_outfile.write(data)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
@@ -166234,7 +166362,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_14method(st
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("method", 0);
 
-  /* "src/lxml/serializer.pxi":1765
+  /* "src/lxml/serializer.pxi":1770
  * 
  *     def method(self, method):
  *         return self._writer.method(method)             # <<<<<<<<<<<<<<
@@ -166242,7 +166370,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_14method(st
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_writer), __pyx_n_s_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1765, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_writer), __pyx_n_s_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1770, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -166256,14 +166384,14 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_14method(st
   }
   __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_method) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_method);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1765, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1770, __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;
 
-  /* "src/lxml/serializer.pxi":1764
+  /* "src/lxml/serializer.pxi":1769
  *             await self._async_outfile.write(data)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
@@ -166284,7 +166412,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_14method(st
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1767
+/* "src/lxml/serializer.pxi":1772
  *         return self._writer.method(method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
@@ -166355,7 +166483,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_17element(P
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "element") < 0)) __PYX_ERR(9, 1767, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v__extra, values, pos_args, "element") < 0)) __PYX_ERR(9, 1772, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -166377,7 +166505,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_17element(P
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("element", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1767, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("element", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1772, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v__extra); __pyx_v__extra = 0;
   __Pyx_AddTraceback("lxml.etree._AsyncIncrementalFileWriter.element", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -166404,16 +166532,16 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("element", 0);
 
-  /* "src/lxml/serializer.pxi":1768
+  /* "src/lxml/serializer.pxi":1773
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)             # <<<<<<<<<<<<<<
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_writer), __pyx_n_s_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1768, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->_writer), __pyx_n_s_element); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1773, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1768, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1773, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_v_tag);
   __Pyx_GIVEREF(__pyx_v_tag);
@@ -166427,14 +166555,14 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
   __Pyx_INCREF(__pyx_v_method);
   __Pyx_GIVEREF(__pyx_v_method);
   PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_method);
-  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v__extra); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1768, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v__extra); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1773, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_v_element_writer = __pyx_t_3;
   __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1769
+  /* "src/lxml/serializer.pxi":1774
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)
  *         return _AsyncFileWriterElement(element_writer, self)             # <<<<<<<<<<<<<<
@@ -166442,7 +166570,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
  *     async def _close(self, bint raise_on_error):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1769, __pyx_L1_error)
+  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1774, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_INCREF(__pyx_v_element_writer);
   __Pyx_GIVEREF(__pyx_v_element_writer);
@@ -166450,14 +166578,14 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
   __Pyx_INCREF(((PyObject *)__pyx_v_self));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
   PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_self));
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1769, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1774, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_2;
   __pyx_t_2 = 0;
   goto __pyx_L0;
 
-  /* "src/lxml/serializer.pxi":1767
+  /* "src/lxml/serializer.pxi":1772
  *         return self._writer.method(method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
@@ -166480,7 +166608,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_16element(s
 }
 static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1771
+/* "src/lxml/serializer.pxi":1776
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  *     async def _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
@@ -166500,7 +166628,7 @@ static PyObject *__pyx_pw_4lxml_5etree_27_AsyncIncrementalFileWriter_19_close(Py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("_close (wrapper)", 0);
   assert(__pyx_arg_raise_on_error); {
-    __pyx_v_raise_on_error = __Pyx_PyObject_IsTrue(__pyx_arg_raise_on_error); if (unlikely((__pyx_v_raise_on_error == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1771, __pyx_L3_error)
+    __pyx_v_raise_on_error = __Pyx_PyObject_IsTrue(__pyx_arg_raise_on_error); if (unlikely((__pyx_v_raise_on_error == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1776, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L3_error:;
@@ -166527,7 +166655,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_18_close(st
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_8__close *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1771, __pyx_L1_error)
+    __PYX_ERR(9, 1776, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -166536,7 +166664,7 @@ static PyObject *__pyx_pf_4lxml_5etree_27_AsyncIncrementalFileWriter_18_close(st
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __pyx_cur_scope->__pyx_v_raise_on_error = __pyx_v_raise_on_error;
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator8, __pyx_codeobj__88, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_2, __pyx_n_s_AsyncIncrementalFileWriter__clo, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1771, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator8, __pyx_codeobj__88, (PyObject *) __pyx_cur_scope, __pyx_n_s_close_2, __pyx_n_s_AsyncIncrementalFileWriter__clo, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1776, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -166574,33 +166702,33 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1771, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1776, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1772
+  /* "src/lxml/serializer.pxi":1777
  * 
  *     async def _close(self, bint raise_on_error):
  *         self._writer._close(raise_on_error)             # <<<<<<<<<<<<<<
  *         data = self._buffer.collect()
  *         if data:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(__pyx_cur_scope->__pyx_v_self->_writer, __pyx_cur_scope->__pyx_v_raise_on_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1772, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__close(__pyx_cur_scope->__pyx_v_self->_writer, __pyx_cur_scope->__pyx_v_raise_on_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1777, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1773
+  /* "src/lxml/serializer.pxi":1778
  *     async def _close(self, bint raise_on_error):
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._async_outfile.write(data)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_cur_scope->__pyx_v_self->_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1773, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_16_AsyncDataWriter_collect(__pyx_cur_scope->__pyx_v_self->_buffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1778, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1774
+  /* "src/lxml/serializer.pxi":1779
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  *         if data:             # <<<<<<<<<<<<<<
@@ -166610,14 +166738,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   __pyx_t_2 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1775
+    /* "src/lxml/serializer.pxi":1780
  *         data = self._buffer.collect()
  *         if data:
  *             await self._async_outfile.write(data)             # <<<<<<<<<<<<<<
  *         if self._should_close:
  *             await self._async_outfile.close()
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1775, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1780, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -166631,7 +166759,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
     }
     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1775, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1780, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -166645,16 +166773,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1775, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1780, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1775, __pyx_L1_error)
+        else __PYX_ERR(9, 1780, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1774
+    /* "src/lxml/serializer.pxi":1779
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  *         if data:             # <<<<<<<<<<<<<<
@@ -166663,7 +166791,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
  */
   }
 
-  /* "src/lxml/serializer.pxi":1776
+  /* "src/lxml/serializer.pxi":1781
  *         if data:
  *             await self._async_outfile.write(data)
  *         if self._should_close:             # <<<<<<<<<<<<<<
@@ -166673,14 +166801,14 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   __pyx_t_2 = (__pyx_cur_scope->__pyx_v_self->_should_close != 0);
   if (__pyx_t_2) {
 
-    /* "src/lxml/serializer.pxi":1777
+    /* "src/lxml/serializer.pxi":1782
  *             await self._async_outfile.write(data)
  *         if self._should_close:
  *             await self._async_outfile.close()             # <<<<<<<<<<<<<<
  * 
  * 
  */
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1777, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_async_outfile, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1782, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -166694,7 +166822,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
     }
     __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1777, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1782, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -166708,16 +166836,16 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
       __pyx_generator->resume_label = 2;
       return __pyx_r;
       __pyx_L7_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1777, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1782, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1777, __pyx_L1_error)
+        else __PYX_ERR(9, 1782, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1776
+    /* "src/lxml/serializer.pxi":1781
  *         if data:
  *             await self._async_outfile.write(data)
  *         if self._should_close:             # <<<<<<<<<<<<<<
@@ -166727,7 +166855,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1771
+  /* "src/lxml/serializer.pxi":1776
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  *     async def _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
@@ -166754,7 +166882,7 @@ static PyObject *__pyx_gb_4lxml_5etree_27_AsyncIncrementalFileWriter_20generator
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1786
+/* "src/lxml/serializer.pxi":1791
  *     cdef _AsyncIncrementalFileWriter _writer
  * 
  *     def __cinit__(self, _FileWriterElement element_writer not None,             # <<<<<<<<<<<<<<
@@ -166796,11 +166924,11 @@ static int __pyx_pw_4lxml_5etree_23_AsyncFileWriterElement_1__cinit__(PyObject *
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_writer)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(9, 1786, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(9, 1791, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1786, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1791, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -166813,14 +166941,14 @@ static int __pyx_pw_4lxml_5etree_23_AsyncFileWriterElement_1__cinit__(PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1786, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1791, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._AsyncFileWriterElement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element_writer), __pyx_ptype_4lxml_5etree__FileWriterElement, 0, "element_writer", 0))) __PYX_ERR(9, 1786, __pyx_L1_error)
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1787, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element_writer), __pyx_ptype_4lxml_5etree__FileWriterElement, 0, "element_writer", 0))) __PYX_ERR(9, 1791, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1792, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(((struct __pyx_obj_4lxml_5etree__AsyncFileWriterElement *)__pyx_v_self), __pyx_v_element_writer, __pyx_v_writer);
 
   /* function exit code */
@@ -166837,7 +166965,7 @@ static int __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(struct __py
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/serializer.pxi":1788
+  /* "src/lxml/serializer.pxi":1793
  *     def __cinit__(self, _FileWriterElement element_writer not None,
  *                   _AsyncIncrementalFileWriter writer not None):
  *         self._element_writer = element_writer             # <<<<<<<<<<<<<<
@@ -166850,7 +166978,7 @@ static int __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(struct __py
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_element_writer));
   __pyx_v_self->_element_writer = __pyx_v_element_writer;
 
-  /* "src/lxml/serializer.pxi":1789
+  /* "src/lxml/serializer.pxi":1794
  *                   _AsyncIncrementalFileWriter writer not None):
  *         self._element_writer = element_writer
  *         self._writer = writer             # <<<<<<<<<<<<<<
@@ -166863,7 +166991,7 @@ static int __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(struct __py
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_writer));
   __pyx_v_self->_writer = __pyx_v_writer;
 
-  /* "src/lxml/serializer.pxi":1786
+  /* "src/lxml/serializer.pxi":1791
  *     cdef _AsyncIncrementalFileWriter _writer
  * 
  *     def __cinit__(self, _FileWriterElement element_writer not None,             # <<<<<<<<<<<<<<
@@ -166878,7 +167006,7 @@ static int __pyx_pf_4lxml_5etree_23_AsyncFileWriterElement___cinit__(struct __py
 }
 static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1791
+/* "src/lxml/serializer.pxi":1796
  *         self._writer = writer
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -166912,7 +167040,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_2__aenter__(str
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_9___aenter__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1791, __pyx_L1_error)
+    __PYX_ERR(9, 1796, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -166920,7 +167048,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_2__aenter__(str
   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9, __pyx_codeobj__89, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_AsyncFileWriterElement___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1791, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9, __pyx_codeobj__89, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_AsyncFileWriterElement___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1796, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -166957,16 +167085,16 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1791, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1796, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1792
+  /* "src/lxml/serializer.pxi":1797
  * 
  *     async def __aenter__(self):
  *         self._element_writer.__enter__()             # <<<<<<<<<<<<<<
  *         data = self._writer._flush()
  *         if data:
  */
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_element_writer), __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1792, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_element_writer), __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1797, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -166980,25 +167108,25 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
   }
   __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(9, 1792, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1797, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1793
+  /* "src/lxml/serializer.pxi":1798
  *     async def __aenter__(self):
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._writer._async_outfile.write(data)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self->_writer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1793, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self->_writer); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1798, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "src/lxml/serializer.pxi":1794
+  /* "src/lxml/serializer.pxi":1799
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -167008,14 +167136,14 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
   __pyx_t_4 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_4) {
 
-    /* "src/lxml/serializer.pxi":1795
+    /* "src/lxml/serializer.pxi":1800
  *         data = self._writer._flush()
  *         if data:
  *             await self._writer._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  *     async def __aexit__(self, *args):
  */
-    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_writer->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1795, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_writer->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1800, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -167029,7 +167157,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
     }
     __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1795, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1800, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_1);
@@ -167043,16 +167171,16 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1795, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1800, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1795, __pyx_L1_error)
+        else __PYX_ERR(9, 1800, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1794
+    /* "src/lxml/serializer.pxi":1799
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -167062,7 +167190,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1791
+  /* "src/lxml/serializer.pxi":1796
  *         self._writer = writer
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -167090,7 +167218,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_4generator9(__p
 }
 static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1797
+/* "src/lxml/serializer.pxi":1802
  *             await self._writer._async_outfile.write(data)
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -167129,7 +167257,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_5__aexit__(stru
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_10___aexit__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1797, __pyx_L1_error)
+    __PYX_ERR(9, 1802, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -167140,7 +167268,7 @@ static PyObject *__pyx_pf_4lxml_5etree_23_AsyncFileWriterElement_5__aexit__(stru
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10, __pyx_codeobj__90, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_AsyncFileWriterElement___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1797, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10, __pyx_codeobj__90, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_AsyncFileWriterElement___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1802, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -167177,36 +167305,36 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1797, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1802, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1798
+  /* "src/lxml/serializer.pxi":1803
  * 
  *     async def __aexit__(self, *args):
  *         self._element_writer.__exit__(*args)             # <<<<<<<<<<<<<<
  *         data = self._writer._flush()
  *         if data:
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_element_writer), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1798, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self->_element_writer), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1803, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1798, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1803, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1799
+  /* "src/lxml/serializer.pxi":1804
  *     async def __aexit__(self, *args):
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()             # <<<<<<<<<<<<<<
  *         if data:
  *             await self._writer._async_outfile.write(data)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self->_writer); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1799, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush(__pyx_cur_scope->__pyx_v_self->_writer); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1804, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_2);
   __pyx_cur_scope->__pyx_v_data = ((PyObject*)__pyx_t_2);
   __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1800
+  /* "src/lxml/serializer.pxi":1805
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -167216,14 +167344,14 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
   __pyx_t_3 = (__pyx_cur_scope->__pyx_v_data != Py_None)&&(PyBytes_GET_SIZE(__pyx_cur_scope->__pyx_v_data) != 0);
   if (__pyx_t_3) {
 
-    /* "src/lxml/serializer.pxi":1801
+    /* "src/lxml/serializer.pxi":1806
  *         data = self._writer._flush()
  *         if data:
  *             await self._writer._async_outfile.write(data)             # <<<<<<<<<<<<<<
  * 
  * 
  */
-    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_writer->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1801, __pyx_L1_error)
+    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->_writer->_async_outfile, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1806, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -167237,7 +167365,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_cur_scope->__pyx_v_data) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_cur_scope->__pyx_v_data);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1801, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1806, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     __pyx_r = __Pyx_Coroutine_Yield_From(__pyx_generator, __pyx_t_2);
@@ -167251,16 +167379,16 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
       __pyx_generator->resume_label = 1;
       return __pyx_r;
       __pyx_L5_resume_from_await:;
-      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1801, __pyx_L1_error)
+      if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1806, __pyx_L1_error)
     } else {
       PyObject* exc_type = __Pyx_PyErr_Occurred();
       if (exc_type) {
         if (likely(exc_type == PyExc_StopIteration || (exc_type != PyExc_GeneratorExit && __Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))) PyErr_Clear();
-        else __PYX_ERR(9, 1801, __pyx_L1_error)
+        else __PYX_ERR(9, 1806, __pyx_L1_error)
       }
     }
 
-    /* "src/lxml/serializer.pxi":1800
+    /* "src/lxml/serializer.pxi":1805
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  *         if data:             # <<<<<<<<<<<<<<
@@ -167270,7 +167398,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
   }
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1797
+  /* "src/lxml/serializer.pxi":1802
  *             await self._writer._async_outfile.write(data)
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -167297,7 +167425,7 @@ static PyObject *__pyx_gb_4lxml_5etree_23_AsyncFileWriterElement_7generator10(__
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1813
+/* "src/lxml/serializer.pxi":1818
  *     cdef int _old_method
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, element_config, int method):             # <<<<<<<<<<<<<<
@@ -167342,17 +167470,17 @@ static int __pyx_pw_4lxml_5etree_18_FileWriterElement_1__cinit__(PyObject *__pyx
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_element_config)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(9, 1813, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); __PYX_ERR(9, 1818, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(9, 1813, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); __PYX_ERR(9, 1818, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1813, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1818, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -167363,17 +167491,17 @@ static int __pyx_pw_4lxml_5etree_18_FileWriterElement_1__cinit__(PyObject *__pyx
     }
     __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)values[0]);
     __pyx_v_element_config = values[1];
-    __pyx_v_method = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1813, __pyx_L3_error)
+    __pyx_v_method = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1818, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1813, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1818, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._FileWriterElement.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__IncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1813, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__IncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1818, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(((struct __pyx_obj_4lxml_5etree__FileWriterElement *)__pyx_v_self), __pyx_v_writer, __pyx_v_element_config, __pyx_v_method);
 
   /* function exit code */
@@ -167391,7 +167519,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/serializer.pxi":1814
+  /* "src/lxml/serializer.pxi":1819
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, element_config, int method):
  *         self._writer = writer             # <<<<<<<<<<<<<<
@@ -167404,7 +167532,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_writer));
   __pyx_v_self->_writer = __pyx_v_writer;
 
-  /* "src/lxml/serializer.pxi":1815
+  /* "src/lxml/serializer.pxi":1820
  *     def __cinit__(self, _IncrementalFileWriter writer not None, element_config, int method):
  *         self._writer = writer
  *         self._element = element_config             # <<<<<<<<<<<<<<
@@ -167417,7 +167545,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
   __Pyx_DECREF(__pyx_v_self->_element);
   __pyx_v_self->_element = __pyx_v_element_config;
 
-  /* "src/lxml/serializer.pxi":1816
+  /* "src/lxml/serializer.pxi":1821
  *         self._writer = writer
  *         self._element = element_config
  *         self._new_method = method             # <<<<<<<<<<<<<<
@@ -167426,7 +167554,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
  */
   __pyx_v_self->_new_method = __pyx_v_method;
 
-  /* "src/lxml/serializer.pxi":1817
+  /* "src/lxml/serializer.pxi":1822
  *         self._element = element_config
  *         self._new_method = method
  *         self._old_method = writer._method             # <<<<<<<<<<<<<<
@@ -167436,7 +167564,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
   __pyx_t_1 = __pyx_v_writer->_method;
   __pyx_v_self->_old_method = __pyx_t_1;
 
-  /* "src/lxml/serializer.pxi":1813
+  /* "src/lxml/serializer.pxi":1818
  *     cdef int _old_method
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, element_config, int method):             # <<<<<<<<<<<<<<
@@ -167450,7 +167578,7 @@ static int __pyx_pf_4lxml_5etree_18_FileWriterElement___cinit__(struct __pyx_obj
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1819
+/* "src/lxml/serializer.pxi":1824
  *         self._old_method = writer._method
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -167483,7 +167611,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_2__enter__(struct __
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__enter__", 0);
 
-  /* "src/lxml/serializer.pxi":1820
+  /* "src/lxml/serializer.pxi":1825
  * 
  *     def __enter__(self):
  *         self._writer._method = self._new_method             # <<<<<<<<<<<<<<
@@ -167493,7 +167621,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_2__enter__(struct __
   __pyx_t_1 = __pyx_v_self->_new_method;
   __pyx_v_self->_writer->_method = __pyx_t_1;
 
-  /* "src/lxml/serializer.pxi":1821
+  /* "src/lxml/serializer.pxi":1826
  *     def __enter__(self):
  *         self._writer._method = self._new_method
  *         self._writer._write_start_element(self._element)             # <<<<<<<<<<<<<<
@@ -167502,12 +167630,12 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_2__enter__(struct __
  */
   __pyx_t_2 = __pyx_v_self->_element;
   __Pyx_INCREF(__pyx_t_2);
-  __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_element(__pyx_v_self->_writer, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1821, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_start_element(__pyx_v_self->_writer, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
-  /* "src/lxml/serializer.pxi":1819
+  /* "src/lxml/serializer.pxi":1824
  *         self._old_method = writer._method
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -167529,7 +167657,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_2__enter__(struct __
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1823
+/* "src/lxml/serializer.pxi":1828
  *         self._writer._write_start_element(self._element)
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -167575,17 +167703,17 @@ static PyObject *__pyx_pw_4lxml_5etree_18_FileWriterElement_5__exit__(PyObject *
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1823, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1828, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1823, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1828, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1823, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1828, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -167600,7 +167728,7 @@ static PyObject *__pyx_pw_4lxml_5etree_18_FileWriterElement_5__exit__(PyObject *
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1823, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1828, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._FileWriterElement.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -167624,7 +167752,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_4__exit__(struct __p
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__exit__", 0);
 
-  /* "src/lxml/serializer.pxi":1824
+  /* "src/lxml/serializer.pxi":1829
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         self._writer._write_end_element(self._element)             # <<<<<<<<<<<<<<
@@ -167633,12 +167761,12 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_4__exit__(struct __p
  */
   __pyx_t_1 = __pyx_v_self->_element;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_element(__pyx_v_self->_writer, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1824, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_end_element(__pyx_v_self->_writer, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1829, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-  /* "src/lxml/serializer.pxi":1825
+  /* "src/lxml/serializer.pxi":1830
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         self._writer._write_end_element(self._element)
  *         self._writer._method = self._old_method             # <<<<<<<<<<<<<<
@@ -167648,7 +167776,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_4__exit__(struct __p
   __pyx_t_3 = __pyx_v_self->_old_method;
   __pyx_v_self->_writer->_method = __pyx_t_3;
 
-  /* "src/lxml/serializer.pxi":1823
+  /* "src/lxml/serializer.pxi":1828
  *         self._writer._write_start_element(self._element)
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -167670,7 +167798,7 @@ static PyObject *__pyx_pf_4lxml_5etree_18_FileWriterElement_4__exit__(struct __p
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1838
+/* "src/lxml/serializer.pxi":1843
  *     cdef bint _exited
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, int method):             # <<<<<<<<<<<<<<
@@ -167712,11 +167840,11 @@ static int __pyx_pw_4lxml_5etree_14_MethodChanger_1__cinit__(PyObject *__pyx_v_s
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(9, 1838, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, 1); __PYX_ERR(9, 1843, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1838, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(9, 1843, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -167725,17 +167853,17 @@ static int __pyx_pw_4lxml_5etree_14_MethodChanger_1__cinit__(PyObject *__pyx_v_s
       values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
     }
     __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *)values[0]);
-    __pyx_v_method = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1838, __pyx_L3_error)
+    __pyx_v_method = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_method == (int)-1) && PyErr_Occurred())) __PYX_ERR(9, 1843, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1838, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1843, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._MethodChanger.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__IncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1838, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_writer), __pyx_ptype_4lxml_5etree__IncrementalFileWriter, 0, "writer", 0))) __PYX_ERR(9, 1843, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(((struct __pyx_obj_4lxml_5etree__MethodChanger *)__pyx_v_self), __pyx_v_writer, __pyx_v_method);
 
   /* function exit code */
@@ -167753,7 +167881,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
   int __pyx_t_1;
   __Pyx_RefNannySetupContext("__cinit__", 0);
 
-  /* "src/lxml/serializer.pxi":1839
+  /* "src/lxml/serializer.pxi":1844
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, int method):
  *         self._writer = writer             # <<<<<<<<<<<<<<
@@ -167766,7 +167894,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
   __Pyx_DECREF(((PyObject *)__pyx_v_self->_writer));
   __pyx_v_self->_writer = __pyx_v_writer;
 
-  /* "src/lxml/serializer.pxi":1840
+  /* "src/lxml/serializer.pxi":1845
  *     def __cinit__(self, _IncrementalFileWriter writer not None, int method):
  *         self._writer = writer
  *         self._new_method = method             # <<<<<<<<<<<<<<
@@ -167775,7 +167903,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
  */
   __pyx_v_self->_new_method = __pyx_v_method;
 
-  /* "src/lxml/serializer.pxi":1841
+  /* "src/lxml/serializer.pxi":1846
  *         self._writer = writer
  *         self._new_method = method
  *         self._old_method = writer._method             # <<<<<<<<<<<<<<
@@ -167785,7 +167913,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
   __pyx_t_1 = __pyx_v_writer->_method;
   __pyx_v_self->_old_method = __pyx_t_1;
 
-  /* "src/lxml/serializer.pxi":1842
+  /* "src/lxml/serializer.pxi":1847
  *         self._new_method = method
  *         self._old_method = writer._method
  *         self._entered = False             # <<<<<<<<<<<<<<
@@ -167794,7 +167922,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
  */
   __pyx_v_self->_entered = 0;
 
-  /* "src/lxml/serializer.pxi":1843
+  /* "src/lxml/serializer.pxi":1848
  *         self._old_method = writer._method
  *         self._entered = False
  *         self._exited = False             # <<<<<<<<<<<<<<
@@ -167803,7 +167931,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
  */
   __pyx_v_self->_exited = 0;
 
-  /* "src/lxml/serializer.pxi":1838
+  /* "src/lxml/serializer.pxi":1843
  *     cdef bint _exited
  * 
  *     def __cinit__(self, _IncrementalFileWriter writer not None, int method):             # <<<<<<<<<<<<<<
@@ -167817,7 +167945,7 @@ static int __pyx_pf_4lxml_5etree_14_MethodChanger___cinit__(struct __pyx_obj_4lx
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1845
+/* "src/lxml/serializer.pxi":1850
  *         self._exited = False
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -167852,7 +167980,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__enter__", 0);
 
-  /* "src/lxml/serializer.pxi":1846
+  /* "src/lxml/serializer.pxi":1851
  * 
  *     def __enter__(self):
  *         if self._entered:             # <<<<<<<<<<<<<<
@@ -167862,14 +167990,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
   __pyx_t_1 = (__pyx_v_self->_entered != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1847
+    /* "src/lxml/serializer.pxi":1852
  *     def __enter__(self):
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")             # <<<<<<<<<<<<<<
  *         self._writer._method = self._new_method
  *         self._entered = True
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1847, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1852, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -167883,14 +168011,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Inconsistent_enter_action_in_con) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Inconsistent_enter_action_in_con);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1847, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1852, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1847, __pyx_L1_error)
+    __PYX_ERR(9, 1852, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1846
+    /* "src/lxml/serializer.pxi":1851
  * 
  *     def __enter__(self):
  *         if self._entered:             # <<<<<<<<<<<<<<
@@ -167899,7 +168027,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
  */
   }
 
-  /* "src/lxml/serializer.pxi":1848
+  /* "src/lxml/serializer.pxi":1853
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  *         self._writer._method = self._new_method             # <<<<<<<<<<<<<<
@@ -167909,7 +168037,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
   __pyx_t_5 = __pyx_v_self->_new_method;
   __pyx_v_self->_writer->_method = __pyx_t_5;
 
-  /* "src/lxml/serializer.pxi":1849
+  /* "src/lxml/serializer.pxi":1854
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  *         self._writer._method = self._new_method
  *         self._entered = True             # <<<<<<<<<<<<<<
@@ -167918,7 +168046,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
  */
   __pyx_v_self->_entered = 1;
 
-  /* "src/lxml/serializer.pxi":1845
+  /* "src/lxml/serializer.pxi":1850
  *         self._exited = False
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
@@ -167941,7 +168069,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_2__enter__(struct __pyx_
   return __pyx_r;
 }
 
-/* "src/lxml/serializer.pxi":1851
+/* "src/lxml/serializer.pxi":1856
  *         self._entered = True
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -167987,17 +168115,17 @@ static PyObject *__pyx_pw_4lxml_5etree_14_MethodChanger_5__exit__(PyObject *__py
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1851, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(9, 1856, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1851, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(9, 1856, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1851, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__exit__") < 0)) __PYX_ERR(9, 1856, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -168012,7 +168140,7 @@ static PyObject *__pyx_pw_4lxml_5etree_14_MethodChanger_5__exit__(PyObject *__py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1851, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(9, 1856, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._MethodChanger.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -168038,7 +168166,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("__exit__", 0);
 
-  /* "src/lxml/serializer.pxi":1852
+  /* "src/lxml/serializer.pxi":1857
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self._exited:             # <<<<<<<<<<<<<<
@@ -168048,14 +168176,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
   __pyx_t_1 = (__pyx_v_self->_exited != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1853
+    /* "src/lxml/serializer.pxi":1858
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")             # <<<<<<<<<<<<<<
  *         if self._writer._method != self._new_method:
  *             raise LxmlSyntaxError("Method changed outside of context manager")
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1853, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1858, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -168069,14 +168197,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Inconsistent_exit_action_in_cont) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Inconsistent_exit_action_in_cont);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1853, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1858, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1853, __pyx_L1_error)
+    __PYX_ERR(9, 1858, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1852
+    /* "src/lxml/serializer.pxi":1857
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):
  *         if self._exited:             # <<<<<<<<<<<<<<
@@ -168085,7 +168213,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
  */
   }
 
-  /* "src/lxml/serializer.pxi":1854
+  /* "src/lxml/serializer.pxi":1859
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  *         if self._writer._method != self._new_method:             # <<<<<<<<<<<<<<
@@ -168095,14 +168223,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
   __pyx_t_1 = ((__pyx_v_self->_writer->_method != __pyx_v_self->_new_method) != 0);
   if (unlikely(__pyx_t_1)) {
 
-    /* "src/lxml/serializer.pxi":1855
+    /* "src/lxml/serializer.pxi":1860
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  *         if self._writer._method != self._new_method:
  *             raise LxmlSyntaxError("Method changed outside of context manager")             # <<<<<<<<<<<<<<
  *         self._writer._method = self._old_method
  *         self._exited = True
  */
-    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1855, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_3)) __PYX_ERR(9, 1860, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
@@ -168116,14 +168244,14 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_s_Method_changed_outside_of_contex) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_s_Method_changed_outside_of_contex);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1855, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1860, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(9, 1855, __pyx_L1_error)
+    __PYX_ERR(9, 1860, __pyx_L1_error)
 
-    /* "src/lxml/serializer.pxi":1854
+    /* "src/lxml/serializer.pxi":1859
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  *         if self._writer._method != self._new_method:             # <<<<<<<<<<<<<<
@@ -168132,7 +168260,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
  */
   }
 
-  /* "src/lxml/serializer.pxi":1856
+  /* "src/lxml/serializer.pxi":1861
  *         if self._writer._method != self._new_method:
  *             raise LxmlSyntaxError("Method changed outside of context manager")
  *         self._writer._method = self._old_method             # <<<<<<<<<<<<<<
@@ -168142,7 +168270,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
   __pyx_t_5 = __pyx_v_self->_old_method;
   __pyx_v_self->_writer->_method = __pyx_t_5;
 
-  /* "src/lxml/serializer.pxi":1857
+  /* "src/lxml/serializer.pxi":1862
  *             raise LxmlSyntaxError("Method changed outside of context manager")
  *         self._writer._method = self._old_method
  *         self._exited = True             # <<<<<<<<<<<<<<
@@ -168151,7 +168279,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
  */
   __pyx_v_self->_exited = 1;
 
-  /* "src/lxml/serializer.pxi":1851
+  /* "src/lxml/serializer.pxi":1856
  *         self._entered = True
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
@@ -168175,7 +168303,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_4__exit__(struct __pyx_o
 }
 static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1859
+/* "src/lxml/serializer.pxi":1864
  *         self._exited = True
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -168209,7 +168337,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_6__aenter__(struct __pyx
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_11___aenter__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1859, __pyx_L1_error)
+    __PYX_ERR(9, 1864, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -168217,7 +168345,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_6__aenter__(struct __pyx
   __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_14_MethodChanger_8generator11, __pyx_codeobj__91, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_MethodChanger___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1859, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_14_MethodChanger_8generator11, __pyx_codeobj__91, (PyObject *) __pyx_cur_scope, __pyx_n_s_aenter, __pyx_n_s_MethodChanger___aenter, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1864, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -168252,9 +168380,9 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_Corou
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1859, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1864, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1861
+  /* "src/lxml/serializer.pxi":1866
  *     async def __aenter__(self):
  *         # for your async convenience
  *         return self.__enter__()             # <<<<<<<<<<<<<<
@@ -168262,7 +168390,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_Corou
  *     async def __aexit__(self, *args):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1861, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1866, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -168276,7 +168404,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_Corou
   }
   __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(9, 1861, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1866, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_1);
@@ -168284,7 +168412,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_Corou
   goto __pyx_L0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1859
+  /* "src/lxml/serializer.pxi":1864
  *         self._exited = True
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
@@ -168310,7 +168438,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_8generator11(__pyx_Corou
 }
 static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
 
-/* "src/lxml/serializer.pxi":1863
+/* "src/lxml/serializer.pxi":1868
  *         return self.__enter__()
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -168349,7 +168477,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_9__aexit__(struct __pyx_
   if (unlikely(!__pyx_cur_scope)) {
     __pyx_cur_scope = ((struct __pyx_obj_4lxml_5etree___pyx_scope_struct_12___aexit__ *)Py_None);
     __Pyx_INCREF(Py_None);
-    __PYX_ERR(9, 1863, __pyx_L1_error)
+    __PYX_ERR(9, 1868, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
@@ -168360,7 +168488,7 @@ static PyObject *__pyx_pf_4lxml_5etree_14_MethodChanger_9__aexit__(struct __pyx_
   __Pyx_INCREF(__pyx_cur_scope->__pyx_v_args);
   __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_args);
   {
-    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_14_MethodChanger_11generator12, __pyx_codeobj__92, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_MethodChanger___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1863, __pyx_L1_error)
+    __pyx_CoroutineObject *gen = __Pyx_Coroutine_New((__pyx_coroutine_body_t) __pyx_gb_4lxml_5etree_14_MethodChanger_11generator12, __pyx_codeobj__92, (PyObject *) __pyx_cur_scope, __pyx_n_s_aexit, __pyx_n_s_MethodChanger___aexit, __pyx_n_s_lxml_etree); if (unlikely(!gen)) __PYX_ERR(9, 1868, __pyx_L1_error)
     __Pyx_DECREF(__pyx_cur_scope);
     __Pyx_RefNannyFinishContext();
     return (PyObject *) gen;
@@ -168394,17 +168522,17 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator12(__pyx_Coro
     return NULL;
   }
   __pyx_L3_first_run:;
-  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1863, __pyx_L1_error)
+  if (unlikely(!__pyx_sent_value)) __PYX_ERR(9, 1868, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1865
+  /* "src/lxml/serializer.pxi":1870
  *     async def __aexit__(self, *args):
  *         # for your async convenience
  *         return self.__exit__(*args)             # <<<<<<<<<<<<<<
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1865, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1870, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1865, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_cur_scope->__pyx_v_args, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1870, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = NULL; __Pyx_ReturnWithStopIteration(__pyx_t_2);
@@ -168412,7 +168540,7 @@ static PyObject *__pyx_gb_4lxml_5etree_14_MethodChanger_11generator12(__pyx_Coro
   goto __pyx_L0;
   CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
 
-  /* "src/lxml/serializer.pxi":1863
+  /* "src/lxml/serializer.pxi":1868
  *         return self.__enter__()
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
@@ -196790,7 +196918,7 @@ static struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_f_4lxml_5etree_
  *         _initXSLTResolverContext(context, self._parser)
  *         context._c_style_doc = self._c_style_doc
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResolverContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 55, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResolverContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 55, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -196804,7 +196932,7 @@ static struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_f_4lxml_5etree_
  */
   __pyx_t_1 = ((PyObject *)__pyx_v_self->_parser);
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__initXSLTResolverContext(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 56, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__initXSLTResolverContext(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 56, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -196877,10 +197005,10 @@ static PyObject *__pyx_f_4lxml_5etree__initXSLTResolverContext(struct __pyx_obj_
  *     context._parser = parser
  *     context._c_style_doc = NULL
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_resolvers); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 62, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_parser), __pyx_n_s_resolvers); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 62, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ResolverRegistry))))) __PYX_ERR(3, 62, __pyx_L1_error)
-  __pyx_t_2 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context), ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 62, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__ResolverRegistry))))) __PYX_ERR(4, 62, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context), ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 62, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -197060,7 +197188,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                 return c_return_doc  # 'goto', see 'finally' below
  * 
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 83, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 83, __pyx_L6_error)
             __pyx_v_c_return_doc = __pyx_t_2;
 
             /* "src/lxml/xslt.pxi":84
@@ -197138,7 +197266,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *         doc_ref = resolvers.resolve(uri, None, context)
  * 
  */
-        __pyx_t_1 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 90, __pyx_L6_error)
+        __pyx_t_1 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 90, __pyx_L6_error)
         __Pyx_GOTREF(__pyx_t_1);
         __pyx_v_uri = __pyx_t_1;
         __pyx_t_1 = 0;
@@ -197150,7 +197278,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  * 
  *         if doc_ref is not None:
  */
-        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_resolvers), __pyx_n_s_resolve); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 91, __pyx_L6_error)
+        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_resolvers), __pyx_n_s_resolve); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 91, __pyx_L6_error)
         __Pyx_GOTREF(__pyx_t_8);
         __pyx_t_9 = NULL;
         __pyx_t_10 = 0;
@@ -197167,7 +197295,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_8)) {
           PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_uri, Py_None, ((PyObject *)__pyx_v_context)};
-          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 91, __pyx_L6_error)
+          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 91, __pyx_L6_error)
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_GOTREF(__pyx_t_1);
         } else
@@ -197175,13 +197303,13 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
           PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_uri, Py_None, ((PyObject *)__pyx_v_context)};
-          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 91, __pyx_L6_error)
+          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 91, __pyx_L6_error)
           __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_GOTREF(__pyx_t_1);
         } else
         #endif
         {
-          __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 91, __pyx_L6_error)
+          __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 91, __pyx_L6_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;
@@ -197195,12 +197323,12 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
           __Pyx_INCREF(((PyObject *)__pyx_v_context));
           __Pyx_GIVEREF(((PyObject *)__pyx_v_context));
           PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, ((PyObject *)__pyx_v_context));
-          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 91, __pyx_L6_error)
+          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 91, __pyx_L6_error)
           __Pyx_GOTREF(__pyx_t_1);
           __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
         }
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__InputDocument))))) __PYX_ERR(3, 91, __pyx_L6_error)
+        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__InputDocument))))) __PYX_ERR(4, 91, __pyx_L6_error)
         __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_t_1);
         __pyx_t_1 = 0;
 
@@ -197246,7 +197374,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_FILENAME:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDoc(__pyx_t_1, __pyx_t_8, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_11)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 95, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDoc(__pyx_t_1, __pyx_t_8, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_11)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 95, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
@@ -197281,7 +197409,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_FILE:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_8)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 98, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_8)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 98, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __pyx_v_c_return_doc = __pyx_t_2;
@@ -197317,7 +197445,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *                     doc_ref._file, doc_ref._filename, context._parser)
  *             elif doc_ref._type == PARSER_DATA_EMPTY:
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_t_8, __pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 101, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_t_8, __pyx_t_11, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1)); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 101, __pyx_L6_error)
             __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
             __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
             __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -197340,7 +197468,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  *             if c_return_doc is not NULL and c_return_doc.URL is NULL:
  *                 c_return_doc.URL = tree.xmlStrdup(c_uri)
  */
-            __pyx_t_2 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 104, __pyx_L6_error)
+            __pyx_t_2 = __pyx_f_4lxml_5etree__newXMLDoc(); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 104, __pyx_L6_error)
             __pyx_v_c_return_doc = __pyx_t_2;
 
             /* "src/lxml/xslt.pxi":103
@@ -197426,7 +197554,7 @@ static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(const xmlChar *__p
  */
       /*except:*/ {
         __Pyx_AddTraceback("lxml.etree._xslt_resolve_from_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_8) < 0) __PYX_ERR(3, 107, __pyx_L8_except_error)
+        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_11, &__pyx_t_8) < 0) __PYX_ERR(4, 107, __pyx_L8_except_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_GOTREF(__pyx_t_8);
@@ -197611,12 +197739,12 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *         if c_type == xslt.XSLT_LOAD_DOCUMENT:
  *             exception = XSLTApplyError(message)
  */
-        __pyx_t_4 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 117, __pyx_L6_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__decodeFilename(__pyx_v_c_uri); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 117, __pyx_L6_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 117, __pyx_L6_error)
+        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_4, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 117, __pyx_L6_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-        __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_resolve_URI, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 117, __pyx_L6_error)
+        __pyx_t_4 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Cannot_resolve_URI, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 117, __pyx_L6_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_v_message = ((PyObject*)__pyx_t_4);
@@ -197639,7 +197767,7 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *         else:
  *             exception = XSLTParseError(message)
  */
-          __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTApplyError), __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 119, __pyx_L6_error)
+          __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTApplyError), __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 119, __pyx_L6_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_v_exception = ((struct __pyx_obj_4lxml_5etree_XSLTError *)__pyx_t_4);
           __pyx_t_4 = 0;
@@ -197662,7 +197790,7 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *     except BaseException as e:
  */
         /*else*/ {
-          __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 121, __pyx_L6_error)
+          __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_v_message); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 121, __pyx_L6_error)
           __Pyx_GOTREF(__pyx_t_4);
           __pyx_v_exception = ((struct __pyx_obj_4lxml_5etree_XSLTError *)__pyx_t_4);
           __pyx_t_4 = 0;
@@ -197676,7 +197804,7 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *     except BaseException as e:
  *         (<_XSLTResolverContext>context)._store_exception(e)
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), ((PyObject *)__pyx_v_exception)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 122, __pyx_L6_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), ((PyObject *)__pyx_v_exception)); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(4, 122, __pyx_L6_error)
 
         /* "src/lxml/xslt.pxi":116
  * cdef void _xslt_store_resolver_exception(const_xmlChar* c_uri, void* context,
@@ -197704,7 +197832,7 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
       __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
       if (__pyx_t_7) {
         __Pyx_AddTraceback("lxml.etree._xslt_store_resolver_exception", __pyx_clineno, __pyx_lineno, __pyx_filename);
-        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(3, 123, __pyx_L8_except_error)
+        if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(4, 123, __pyx_L8_except_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_GOTREF(__pyx_t_8);
@@ -197718,7 +197846,7 @@ static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(const xmlChar *_
  *     finally:
  *         return  # and swallow any further exceptions
  */
-        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), __pyx_v_e); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(3, 124, __pyx_L8_except_error)
+        __pyx_t_7 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_v_context)), __pyx_v_e); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(4, 124, __pyx_L8_except_error)
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
@@ -198119,7 +198247,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl___cinit__(struct __pyx_obj_
  * 
  *     def __init__(self, *, bint read_file=True, bint write_file=True, bint create_dir=True,
  */
-    PyErr_NoMemory(); __PYX_ERR(3, 194, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(4, 194, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":193
  *     def __cinit__(self):
@@ -198190,29 +198318,29 @@ static int __pyx_pw_4lxml_5etree_17XSLTAccessControl_3__init__(PyObject *__pyx_v
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(3, 196, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(4, 196, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 0) {
       goto __pyx_L5_argtuple_error;
     } else {
     }
     if (values[0]) {
-      __pyx_v_read_file = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_read_file == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 196, __pyx_L3_error)
+      __pyx_v_read_file = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_read_file == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 196, __pyx_L3_error)
     } else {
       __pyx_v_read_file = ((int)1);
     }
     if (values[1]) {
-      __pyx_v_write_file = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_write_file == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 196, __pyx_L3_error)
+      __pyx_v_write_file = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_write_file == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 196, __pyx_L3_error)
     } else {
       __pyx_v_write_file = ((int)1);
     }
     if (values[2]) {
-      __pyx_v_create_dir = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_create_dir == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 196, __pyx_L3_error)
+      __pyx_v_create_dir = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_create_dir == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 196, __pyx_L3_error)
     } else {
       __pyx_v_create_dir = ((int)1);
     }
     if (values[3]) {
-      __pyx_v_read_network = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_read_network == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 197, __pyx_L3_error)
+      __pyx_v_read_network = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_read_network == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 197, __pyx_L3_error)
     } else {
 
       /* "src/lxml/xslt.pxi":197
@@ -198225,14 +198353,14 @@ static int __pyx_pw_4lxml_5etree_17XSLTAccessControl_3__init__(PyObject *__pyx_v
       __pyx_v_read_network = ((int)1);
     }
     if (values[4]) {
-      __pyx_v_write_network = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_write_network == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 197, __pyx_L3_error)
+      __pyx_v_write_network = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_write_network == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 197, __pyx_L3_error)
     } else {
       __pyx_v_write_network = ((int)1);
     }
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 196, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 196, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.XSLTAccessControl.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -198269,7 +198397,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl_2__init__(struct __pyx_obj_
  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_READ_FILE, __pyx_v_read_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 198, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_READ_FILE, __pyx_v_read_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 198, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -198280,7 +198408,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl_2__init__(struct __pyx_obj_
  *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_WRITE_FILE, __pyx_v_write_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 199, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_WRITE_FILE, __pyx_v_write_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -198291,7 +198419,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl_2__init__(struct __pyx_obj_
  *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_CREATE_DIRECTORY, __pyx_v_create_dir); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_CREATE_DIRECTORY, __pyx_v_create_dir); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 200, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -198302,7 +198430,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl_2__init__(struct __pyx_obj_
  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_READ_NETWORK, __pyx_v_read_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 201, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_READ_NETWORK, __pyx_v_read_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 201, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -198313,7 +198441,7 @@ static int __pyx_pf_4lxml_5etree_17XSLTAccessControl_2__init__(struct __pyx_obj_
  * 
  *     DENY_ALL = XSLTAccessControl(
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_WRITE_NETWORK, __pyx_v_write_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 202, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess(__pyx_v_self, XSLT_SECPREF_WRITE_NETWORK, __pyx_v_write_network); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 202, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -198561,11 +198689,11 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *             u'write_file': self._optval(xslt.XSLT_SECPREF_WRITE_FILE),
  *             u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 233, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_READ_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 233, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_READ_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_read_file, __pyx_t_2) < 0) __PYX_ERR(3, 233, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_read_file, __pyx_t_2) < 0) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xslt.pxi":234
@@ -198575,9 +198703,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *             u'create_dir': self._optval(xslt.XSLT_SECPREF_CREATE_DIRECTORY),
  *             u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_WRITE_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 234, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_WRITE_FILE); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 234, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_write_file, __pyx_t_2) < 0) __PYX_ERR(3, 233, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_write_file, __pyx_t_2) < 0) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xslt.pxi":235
@@ -198587,9 +198715,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *             u'read_network': self._optval(xslt.XSLT_SECPREF_READ_NETWORK),
  *             u'write_network': self._optval(xslt.XSLT_SECPREF_WRITE_NETWORK),
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_CREATE_DIRECTORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 235, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_CREATE_DIRECTORY); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 235, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_create_dir, __pyx_t_2) < 0) __PYX_ERR(3, 233, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_create_dir, __pyx_t_2) < 0) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xslt.pxi":236
@@ -198599,9 +198727,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *             u'write_network': self._optval(xslt.XSLT_SECPREF_WRITE_NETWORK),
  *         }
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_READ_NETWORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 236, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_READ_NETWORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_read_network, __pyx_t_2) < 0) __PYX_ERR(3, 233, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_read_network, __pyx_t_2) < 0) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xslt.pxi":237
@@ -198611,9 +198739,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_7options___get__(stru
  *         }
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_WRITE_NETWORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 237, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_17XSLTAccessControl__optval(__pyx_v_self, XSLT_SECPREF_WRITE_NETWORK); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 237, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_write_network, __pyx_t_2) < 0) __PYX_ERR(3, 233, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_write_network, __pyx_t_2) < 0) __PYX_ERR(4, 233, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -198800,9 +198928,9 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
  *         return u"%s(%s)" % (
  *             python._fqtypename(self).decode('UTF-8').split(u'.')[-1],
  */
-  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 252, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_options); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 252, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 252, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_items); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 252, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_t_3 = NULL;
@@ -198817,15 +198945,15 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
   }
   __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
   __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-  if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 252, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 252, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 252, __pyx_L1_error)
+  __pyx_t_4 = PySequence_List(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 252, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_1 = ((PyObject*)__pyx_t_4);
   __pyx_t_4 = 0;
-  __pyx_t_5 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(3, 252, __pyx_L1_error)
+  __pyx_t_5 = PyList_Sort(__pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(4, 252, __pyx_L1_error)
   __pyx_v_items = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
@@ -198837,7 +198965,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
  *             u', '.join([u"%s=%r" % item for item in items]))
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 253, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 253, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_6 = 0;
   __pyx_t_7 = 127;
@@ -198850,15 +198978,15 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
  * 
  */
   __pyx_t_8 = _fqtypename(((PyObject *)__pyx_v_self));
-  __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 254, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_decode_c_string(__pyx_t_8, 0, strlen(__pyx_t_8), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
-  __pyx_t_2 = PyUnicode_Split(__pyx_t_4, __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 254, __pyx_L1_error)
+  __pyx_t_2 = PyUnicode_Split(__pyx_t_4, __pyx_kp_u__4, -1L); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 254, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_t_2, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 254, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Unicode(__pyx_t_4), __pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 254, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) : __pyx_t_7;
@@ -198878,30 +199006,30 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
  * 
  * ################################################################################
  */
-  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 255, __pyx_L1_error)
+  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 255, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   if (unlikely(__pyx_v_items == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-    __PYX_ERR(3, 255, __pyx_L1_error)
+    __PYX_ERR(4, 255, __pyx_L1_error)
   }
   __pyx_t_4 = __pyx_v_items; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
   for (;;) {
     if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
-    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(3, 255, __pyx_L1_error)
+    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(4, 255, __pyx_L1_error)
     #else
-    __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 255, __pyx_L1_error)
+    __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 255, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     #endif
     __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_3);
     __pyx_t_3 = 0;
-    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_r, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 255, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_s_r, __pyx_v_item); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 255, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(3, 255, __pyx_L1_error)
+    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_3))) __PYX_ERR(4, 255, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__100, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 255, __pyx_L1_error)
+  __pyx_t_4 = PyUnicode_Join(__pyx_kp_u__100, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 255, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_t_7 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) > __pyx_t_7) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4) : __pyx_t_7;
@@ -198921,7 +199049,7 @@ static PyObject *__pyx_pf_4lxml_5etree_17XSLTAccessControl_6__repr__(struct __py
  *             python._fqtypename(self).decode('UTF-8').split(u'.')[-1],
  *             u', '.join([u"%s=%r" % item for item in items]))
  */
-  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 253, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_1, 4, __pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 253, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_r = __pyx_t_4;
@@ -199137,29 +199265,29 @@ static int __pyx_pw_4lxml_5etree_12_XSLTContext_3__init__(PyObject *__pyx_v_self
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extensions)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(3, 280, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 1); __PYX_ERR(4, 280, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  2:
         if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_error_log)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(3, 280, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 2); __PYX_ERR(4, 280, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
         if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_enable_regexp)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(3, 280, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 3); __PYX_ERR(4, 280, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  4:
         if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_build_smart_strings)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(3, 280, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, 4); __PYX_ERR(4, 280, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(3, 280, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 280, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
       goto __pyx_L5_argtuple_error;
@@ -199178,7 +199306,7 @@ static int __pyx_pw_4lxml_5etree_12_XSLTContext_3__init__(PyObject *__pyx_v_self
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 280, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 280, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._XSLTContext.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -199230,7 +199358,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
     __pyx_t_1 = __pyx_t_3;
     goto __pyx_L4_bool_binop_done;
   }
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_extensions); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 282, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_extensions); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 282, __pyx_L1_error)
   __pyx_t_1 = __pyx_t_3;
   __pyx_L4_bool_binop_done:;
   if (__pyx_t_1) {
@@ -199242,7 +199370,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                 if ns_name_tuple[0] is None:
  *                     raise XSLTExtensionError, \
  */
-    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_items); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 283, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -199256,16 +199384,16 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
     }
     __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(3, 283, __pyx_L1_error)
+    if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 283, __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_7 = 0;
       __pyx_t_8 = NULL;
     } else {
-      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 283, __pyx_L1_error)
+      __pyx_t_7 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 283, __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(3, 283, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 283, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     for (;;) {
@@ -199273,17 +199401,17 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         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_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 283, __pyx_L1_error)
+          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 283, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 283, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 283, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         } else {
           if (__pyx_t_7 >= 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_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(3, 283, __pyx_L1_error)
+          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(4, 283, __pyx_L1_error)
           #else
-          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 283, __pyx_L1_error)
+          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 283, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -199293,7 +199421,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
           PyObject* exc_type = PyErr_Occurred();
           if (exc_type) {
             if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
-            else __PYX_ERR(3, 283, __pyx_L1_error)
+            else __PYX_ERR(4, 283, __pyx_L1_error)
           }
           break;
         }
@@ -199305,7 +199433,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         if (unlikely(size != 2)) {
           if (size > 2) __Pyx_RaiseTooManyValuesError(2);
           else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
-          __PYX_ERR(3, 283, __pyx_L1_error)
+          __PYX_ERR(4, 283, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -199318,15 +199446,15 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         __Pyx_INCREF(__pyx_t_6);
         __Pyx_INCREF(__pyx_t_9);
         #else
-        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 283, __pyx_L1_error)
+        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 283, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_6);
-        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 283, __pyx_L1_error)
+        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 283, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         #endif
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       } else {
         Py_ssize_t index = -1;
-        __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 283, __pyx_L1_error)
+        __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 283, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
@@ -199334,7 +199462,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         __Pyx_GOTREF(__pyx_t_6);
         index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
         __Pyx_GOTREF(__pyx_t_9);
-        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(3, 283, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) __PYX_ERR(4, 283, __pyx_L1_error)
         __pyx_t_11 = NULL;
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         goto __pyx_L9_unpacking_done;
@@ -199342,7 +199470,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
         __pyx_t_11 = NULL;
         if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
-        __PYX_ERR(3, 283, __pyx_L1_error)
+        __PYX_ERR(4, 283, __pyx_L1_error)
         __pyx_L9_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_ns_name_tuple, __pyx_t_6);
@@ -199357,7 +199485,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                     raise XSLTExtensionError, \
  *                         u"extensions must not have empty namespaces"
  */
-      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 284, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 284, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_1 = (__pyx_t_4 == Py_None);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
@@ -199372,7 +199500,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                 if isinstance(extension, XSLTExtension):
  */
         __Pyx_Raise(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTExtensionError), __pyx_kp_u_extensions_must_not_have_empty_n, 0, 0);
-        __PYX_ERR(3, 285, __pyx_L1_error)
+        __PYX_ERR(4, 285, __pyx_L1_error)
 
         /* "src/lxml/xslt.pxi":284
  *         if extensions is not None and extensions:
@@ -199412,7 +199540,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                         extensions = extensions.copy()
  *                     ns_utf   = _utf8(ns_name_tuple[0])
  */
-          __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 289, __pyx_L1_error)
+          __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 289, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_GIVEREF(__pyx_t_4);
           __Pyx_GOTREF(__pyx_v_self->_extension_elements);
@@ -199427,7 +199555,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                     ns_utf   = _utf8(ns_name_tuple[0])
  *                     name_utf = _utf8(ns_name_tuple[1])
  */
-          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 290, __pyx_L1_error)
+          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_extensions, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 290, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_9);
           __pyx_t_6 = NULL;
           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
@@ -199441,7 +199569,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
           }
           __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_9);
           __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
-          if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 290, __pyx_L1_error)
+          if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 290, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_DECREF_SET(__pyx_v_extensions, __pyx_t_4);
@@ -199463,9 +199591,9 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                     name_utf = _utf8(ns_name_tuple[1])
  *                     self._extension_elements[(ns_utf, name_utf)] = extension
  */
-        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 291, __pyx_L1_error)
+        __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 291, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
-        __pyx_t_9 = __pyx_f_4lxml_5etree__utf8(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 291, __pyx_L1_error)
+        __pyx_t_9 = __pyx_f_4lxml_5etree__utf8(__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 291, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
         __Pyx_XDECREF_SET(__pyx_v_ns_utf, ((PyObject*)__pyx_t_9));
@@ -199478,9 +199606,9 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                     self._extension_elements[(ns_utf, name_utf)] = extension
  *                     del extensions[ns_name_tuple]
  */
-        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 292, __pyx_L1_error)
+        __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_ns_name_tuple, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 292, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_9);
-        __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 292, __pyx_L1_error)
+        __pyx_t_4 = __pyx_f_4lxml_5etree__utf8(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 292, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_XDECREF_SET(__pyx_v_name_utf, ((PyObject*)__pyx_t_4));
@@ -199495,9 +199623,9 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  */
         if (unlikely(__pyx_v_self->_extension_elements == Py_None)) {
           PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
-          __PYX_ERR(3, 293, __pyx_L1_error)
+          __PYX_ERR(4, 293, __pyx_L1_error)
         }
-        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 293, __pyx_L1_error)
+        __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 293, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_4);
         __Pyx_INCREF(__pyx_v_ns_utf);
         __Pyx_GIVEREF(__pyx_v_ns_utf);
@@ -199505,7 +199633,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
         __Pyx_INCREF(__pyx_v_name_utf);
         __Pyx_GIVEREF(__pyx_v_name_utf);
         PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name_utf);
-        if (unlikely(PyDict_SetItem(__pyx_v_self->_extension_elements, __pyx_t_4, __pyx_v_extension) < 0)) __PYX_ERR(3, 293, __pyx_L1_error)
+        if (unlikely(PyDict_SetItem(__pyx_v_self->_extension_elements, __pyx_t_4, __pyx_v_extension) < 0)) __PYX_ERR(4, 293, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
         /* "src/lxml/xslt.pxi":294
@@ -199515,7 +199643,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *         _BaseContext.__init__(self, namespaces, extensions, error_log, enable_regexp,
  *                               build_smart_strings)
  */
-        if (unlikely(PyObject_DelItem(__pyx_v_extensions, __pyx_v_ns_name_tuple) < 0)) __PYX_ERR(3, 294, __pyx_L1_error)
+        if (unlikely(PyObject_DelItem(__pyx_v_extensions, __pyx_v_ns_name_tuple) < 0)) __PYX_ERR(4, 294, __pyx_L1_error)
 
         /* "src/lxml/xslt.pxi":287
  *                     raise XSLTExtensionError, \
@@ -199552,7 +199680,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
  *                               build_smart_strings)
  * 
  */
-  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree__BaseContext), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 295, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_4lxml_5etree__BaseContext), __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 295, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
 
   /* "src/lxml/xslt.pxi":296
@@ -199577,7 +199705,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
   #if CYTHON_FAST_PYCALL
   if (PyFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[7] = {__pyx_t_9, ((PyObject *)__pyx_v_self), __pyx_v_namespaces, __pyx_v_extensions, __pyx_v_error_log, __pyx_v_enable_regexp, __pyx_v_build_smart_strings};
-    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 6+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 295, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 6+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 295, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
@@ -199585,13 +199713,13 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
   #if CYTHON_FAST_PYCCALL
   if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
     PyObject *__pyx_temp[7] = {__pyx_t_9, ((PyObject *)__pyx_v_self), __pyx_v_namespaces, __pyx_v_extensions, __pyx_v_error_log, __pyx_v_enable_regexp, __pyx_v_build_smart_strings};
-    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 6+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 295, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_12, 6+__pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 295, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
   #endif
   {
-    __pyx_t_6 = PyTuple_New(6+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 295, __pyx_L1_error)
+    __pyx_t_6 = PyTuple_New(6+__pyx_t_12); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 295, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
     if (__pyx_t_9) {
       __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9); __pyx_t_9 = NULL;
@@ -199614,7 +199742,7 @@ static int __pyx_pf_4lxml_5etree_12_XSLTContext_2__init__(struct __pyx_obj_4lxml
     __Pyx_INCREF(__pyx_v_build_smart_strings);
     __Pyx_GIVEREF(__pyx_v_build_smart_strings);
     PyTuple_SET_ITEM(__pyx_t_6, 5+__pyx_t_12, __pyx_v_build_smart_strings);
-    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 295, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 295, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   }
@@ -199676,7 +199804,7 @@ static struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_XSLTC
  *         context._extension_elements = self._extension_elements
  *         return context
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_BaseContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 300, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_BaseContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 300, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -199775,7 +199903,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_register_context(struct __p
  *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__register_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 308, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__register_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 308, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199786,7 +199914,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_register_context(struct __p
  *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerLocalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 309, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerLocalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 309, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199797,7 +199925,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_register_context(struct __p
  *         _registerXSLTExtensions(xsltCtxt, self._extension_elements)
  * 
  */
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerGlobalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 310, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.registerGlobalFunctions(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self), __pyx_v_xsltCtxt, __pyx_f_4lxml_5etree__register_xslt_function); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199810,7 +199938,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_register_context(struct __p
  */
   __pyx_t_1 = __pyx_v_self->_extension_elements;
   __Pyx_INCREF(__pyx_t_1);
-  __pyx_t_2 = __pyx_f_4lxml_5etree__registerXSLTExtensions(__pyx_v_xsltCtxt, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 311, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__registerXSLTExtensions(__pyx_v_xsltCtxt, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 311, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -199862,7 +199990,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_free_context(struct __pyx_o
  *         self._release_context()
  *         if self._xsltCtxt is not NULL:
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 314, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 314, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199873,7 +200001,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_free_context(struct __pyx_o
  *         if self._xsltCtxt is not NULL:
  *             xslt.xsltFreeTransformContext(self._xsltCtxt)
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__release_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 315, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__release_context(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 315, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199921,7 +200049,7 @@ static PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_free_context(struct __pyx_o
  * 
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 319, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 319, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -199983,7 +200111,7 @@ static int __pyx_pw_4lxml_5etree_22_XSLTQuotedStringParam_1__cinit__(PyObject *_
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(3, 330, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 330, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -199994,7 +200122,7 @@ static int __pyx_pw_4lxml_5etree_22_XSLTQuotedStringParam_1__cinit__(PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 330, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 330, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._XSLTQuotedStringParam.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -200023,7 +200151,7 @@ static int __pyx_pf_4lxml_5etree_22_XSLTQuotedStringParam___cinit__(struct __pyx
  * 
  * 
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_strval); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 331, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_strval); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 331, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->strval);
@@ -200161,7 +200289,7 @@ static int __pyx_pw_4lxml_5etree_4XSLT_3__init__(PyObject *__pyx_v_self, PyObjec
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(3, 370, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 370, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -200175,7 +200303,7 @@ static int __pyx_pw_4lxml_5etree_4XSLT_3__init__(PyObject *__pyx_v_self, PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 370, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 370, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.XSLT.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -200240,7 +200368,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *         root_node = _rootNodeOrRaise(xslt_input)
  * 
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 377, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 377, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -200252,7 +200380,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  * 
  *         # set access control or raise TypeError
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 378, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 378, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -200264,7 +200392,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  * 
  *         # make a copy of the document as stylesheet parsing modifies it
  */
-  if (!(likely(((__pyx_v_access_control) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_access_control, __pyx_ptype_4lxml_5etree_XSLTAccessControl))))) __PYX_ERR(3, 381, __pyx_L1_error)
+  if (!(likely(((__pyx_v_access_control) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_access_control, __pyx_ptype_4lxml_5etree_XSLTAccessControl))))) __PYX_ERR(4, 381, __pyx_L1_error)
   __pyx_t_1 = __pyx_v_access_control;
   __Pyx_INCREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
@@ -200280,7 +200408,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  * 
  *         # make sure we always have a stylesheet URL
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 384, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 384, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":387
@@ -200300,7 +200428,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *             c_doc.URL = tree.xmlStrdup(_xcstr(doc_url_utf))
  * 
  */
-    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 389, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 389, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_4 = 0;
     __pyx_t_5 = 127;
@@ -200308,9 +200436,9 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
     __pyx_t_4 += 26;
     __Pyx_GIVEREF(__pyx_kp_u_string___STRING__XSLT);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_u_string___STRING__XSLT);
-    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 389, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 389, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 389, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 389, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_5 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_5) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_5;
@@ -200322,7 +200450,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
     __pyx_t_4 += 5;
     __Pyx_GIVEREF(__pyx_kp_u_xslt_2);
     PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_xslt_2);
-    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 389, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 389, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -200333,7 +200461,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                 f"string://__STRING__XSLT__/{id(self)}.xslt")
  *             c_doc.URL = tree.xmlStrdup(_xcstr(doc_url_utf))
  */
-    __pyx_t_1 = PyUnicode_AsASCIIString(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 388, __pyx_L1_error)
+    __pyx_t_1 = PyUnicode_AsASCIIString(__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 388, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
     __pyx_v_doc_url_utf = ((PyObject*)__pyx_t_1);
@@ -200364,7 +200492,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *         self._xslt_resolver_context = _XSLTResolverContext()
  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 392, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 392, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_error_log);
@@ -200379,7 +200507,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
  *         # keep a copy in case we need to access the stylesheet via 'document()'
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResolverContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 393, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResolverContext)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 393, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_self->_xslt_resolver_context);
@@ -200398,7 +200526,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
   __Pyx_INCREF(__pyx_t_1);
   __pyx_t_7 = ((PyObject *)__pyx_v_doc->_parser);
   __Pyx_INCREF(__pyx_t_7);
-  __pyx_t_6 = __pyx_f_4lxml_5etree__initXSLTResolverContext(((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1), ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 394, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__initXSLTResolverContext(((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1), ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_7)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 394, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
@@ -200411,7 +200539,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 396, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 396, __pyx_L1_error)
   __pyx_v_self->_xslt_resolver_context->_c_style_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":397
@@ -200431,9 +200559,9 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
  */
   /*with:*/ {
-    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 399, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 399, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_8);
-    __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 399, __pyx_L4_error)
+    __pyx_t_9 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 399, __pyx_L4_error)
     /*try:*/ {
       {
         (void)__pyx_t_10; (void)__pyx_t_11; (void)__pyx_t_12; /* mark used */
@@ -200481,7 +200609,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
         if (__pyx_t_8) {
           __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL);
           __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-          if (unlikely(!__pyx_t_12)) __PYX_ERR(3, 399, __pyx_L1_error)
+          if (unlikely(!__pyx_t_12)) __PYX_ERR(4, 399, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_12);
           __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
         }
@@ -200558,7 +200686,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *             # last error seems to be the most accurate here
  *             if self._error_log.last_error is not None and \
  */
-    __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_self->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self->_xslt_resolver_context)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 408, __pyx_L1_error)
+    __pyx_t_9 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_self->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self->_xslt_resolver_context)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 408, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":410
  *             self._xslt_resolver_context._raise_if_stored()
@@ -200582,9 +200710,9 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                 raise XSLTParseError(self._error_log.last_error.message,
  *                                      self._error_log)
  */
-    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_s_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 411, __pyx_L1_error)
+    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_s_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 411, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_6);
-    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(3, 411, __pyx_L1_error)
+    __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(4, 411, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __pyx_t_3 = __pyx_t_14;
     __pyx_L20_bool_binop_done:;
@@ -200605,7 +200733,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                                      self._error_log)
  *             else:
  */
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_s_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 412, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_s_message); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 412, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
 
       /* "src/lxml/xslt.pxi":413
@@ -200615,7 +200743,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *             else:
  *                 raise XSLTParseError(
  */
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 412, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 412, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_6);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
@@ -200631,12 +200759,12 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                                      self._error_log)
  *             else:
  */
-      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 412, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 412, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(3, 412, __pyx_L1_error)
+      __PYX_ERR(4, 412, __pyx_L1_error)
 
       /* "src/lxml/xslt.pxi":410
  *             self._xslt_resolver_context._raise_if_stored()
@@ -200663,7 +200791,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                         u"Cannot parse stylesheet"),
  *                     self._error_log)
  */
-      __pyx_t_6 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Cannot_parse_stylesheet); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 416, __pyx_L1_error)
+      __pyx_t_6 = __pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), __pyx_kp_u_Cannot_parse_stylesheet); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 416, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
 
       /* "src/lxml/xslt.pxi":415
@@ -200673,7 +200801,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  *                     self._error_log._buildExceptionMessage(
  *                         u"Cannot parse stylesheet"),
  */
-      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 415, __pyx_L1_error)
+      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 415, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GIVEREF(__pyx_t_6);
       PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
@@ -200681,12 +200809,12 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
       PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_v_self->_error_log));
       __pyx_t_6 = 0;
-      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 415, __pyx_L1_error)
+      __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTParseError), __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 415, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_6);
       __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_Raise(__pyx_t_6, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-      __PYX_ERR(3, 415, __pyx_L1_error)
+      __PYX_ERR(4, 415, __pyx_L1_error)
     }
 
     /* "src/lxml/xslt.pxi":404
@@ -200723,7 +200851,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
  * 
  *     def __dealloc__(self):
  */
-  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 422, __pyx_L1_error)
+  __pyx_t_6 = PyTuple_New(5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 422, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(Py_None);
   __Pyx_GIVEREF(Py_None);
@@ -200740,7 +200868,7 @@ static int __pyx_pf_4lxml_5etree_4XSLT_2__init__(struct __pyx_obj_4lxml_5etree_X
   __Pyx_INCREF(Py_True);
   __Pyx_GIVEREF(Py_True);
   PyTuple_SET_ITEM(__pyx_t_6, 4, Py_True);
-  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTContext), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 422, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTContext), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 422, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __Pyx_GIVEREF(__pyx_t_7);
@@ -200931,7 +201059,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(struct __pyx_obj
  *     @staticmethod
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 435, __pyx_L1_error)
+  __pyx_t_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.copy(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self->_error_log), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 435, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -200995,7 +201123,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_7strparam(CYTHON_UNUSED PyObject *_
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strparam") < 0)) __PYX_ERR(3, 438, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "strparam") < 0)) __PYX_ERR(4, 438, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -201006,7 +201134,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_7strparam(CYTHON_UNUSED PyObject *_
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("strparam", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 438, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("strparam", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 438, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.XSLT.strparam", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -201036,7 +201164,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_6strparam(PyObject *__pyx_v_strval)
  *     @staticmethod
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTQuotedStringParam), __pyx_v_strval); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 449, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_4lxml_5etree__XSLTQuotedStringParam), __pyx_v_strval); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 449, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -201100,18 +201228,18 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_9set_global_max_depth(CYTHON_UNUSED
         else goto __pyx_L5_argtuple_error;
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_global_max_depth") < 0)) __PYX_ERR(3, 452, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_global_max_depth") < 0)) __PYX_ERR(4, 452, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
     } else {
       values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
     }
-    __pyx_v_max_depth = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 452, __pyx_L3_error)
+    __pyx_v_max_depth = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_max_depth == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 452, __pyx_L3_error)
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set_global_max_depth", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 452, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set_global_max_depth", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 452, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree.XSLT.set_global_max_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -201151,11 +201279,11 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_8set_global_max_depth(int __pyx_v_m
  *         xslt.xsltMaxDepth = max_depth
  * 
  */
-    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 468, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 468, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_Raise(__pyx_t_2, 0, 0, 0);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-    __PYX_ERR(3, 468, __pyx_L1_error)
+    __PYX_ERR(4, 468, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":467
  *         libxslt does not support it at a per-stylesheet level.
@@ -201245,7 +201373,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_11apply(PyObject *__pyx_v_self, PyO
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "apply") < 0)) __PYX_ERR(3, 471, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "apply") < 0)) __PYX_ERR(4, 471, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -201257,7 +201385,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_11apply(PyObject *__pyx_v_self, PyO
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 471, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("apply", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 471, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
   __Pyx_AddTraceback("lxml.etree.XSLT.apply", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -201291,18 +201419,18 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_10apply(struct __pyx_obj_4lxml_5etr
  *     def tostring(self, _ElementTree result_tree):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 475, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 475, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_v__input);
   __Pyx_GIVEREF(__pyx_v__input);
   PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__input);
-  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 475, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 475, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_profile_run, __pyx_v_profile_run) < 0) __PYX_ERR(3, 475, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_profile_run, __pyx_v_profile_run) < 0) __PYX_ERR(4, 475, __pyx_L1_error)
   __pyx_t_2 = __pyx_t_3;
   __pyx_t_3 = 0;
-  if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_kw) < 0) __PYX_ERR(3, 475, __pyx_L1_error)
-  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_self), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 475, __pyx_L1_error)
+  if (__Pyx_MergeKeywords(__pyx_t_2, __pyx_v_kw) < 0) __PYX_ERR(4, 475, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_self), __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 475, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -201350,7 +201478,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_13tostring(PyObject *__pyx_v_self,
   PyObject *__pyx_r = 0;
   __Pyx_RefNannyDeclarations
   __Pyx_RefNannySetupContext("tostring (wrapper)", 0);
-  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result_tree), __pyx_ptype_4lxml_5etree__ElementTree, 1, "result_tree", 0))) __PYX_ERR(3, 477, __pyx_L1_error)
+  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result_tree), __pyx_ptype_4lxml_5etree__ElementTree, 1, "result_tree", 0))) __PYX_ERR(4, 477, __pyx_L1_error)
   __pyx_r = __pyx_pf_4lxml_5etree_4XSLT_12tostring(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self), ((struct LxmlElementTree *)__pyx_v_result_tree));
 
   /* function exit code */
@@ -201379,7 +201507,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_12tostring(CYTHON_UNUSED struct __p
  *     def __deepcopy__(self, memo):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_result_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 484, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), ((PyObject *)__pyx_v_result_tree)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 484, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -201445,7 +201573,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_14__deepcopy__(struct __pyx_obj_4lx
  *     def __copy__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 487, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -201459,7 +201587,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_14__deepcopy__(struct __pyx_obj_4lx
   }
   __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(3, 487, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __pyx_r = __pyx_t_1;
@@ -201526,7 +201654,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_16__copy__(struct __pyx_obj_4lxml_5
  *     def __call__(self, _input, *, profile_run=False, **kw):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__copyXSLT(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 490, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__copyXSLT(__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 490, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -201602,7 +201730,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_19__call__(PyObject *__pyx_v_self,
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__call__") < 0)) __PYX_ERR(3, 492, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__call__") < 0)) __PYX_ERR(4, 492, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -201614,7 +201742,7 @@ static PyObject *__pyx_pw_4lxml_5etree_4XSLT_19__call__(PyObject *__pyx_v_self,
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 492, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 492, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
   __Pyx_AddTraceback("lxml.etree.XSLT.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
@@ -201721,7 +201849,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_self->_c_style != NULL) != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_XSLT_stylesheet_not_initialised);
-      __PYX_ERR(3, 514, __pyx_L1_error)
+      __PYX_ERR(4, 514, __pyx_L1_error)
     }
   }
   #endif
@@ -201733,7 +201861,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *         root_node = _rootNodeOrRaise(_input)
  * 
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 515, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 515, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_input_doc = ((struct LxmlDocument *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -201745,7 +201873,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 516, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__input)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 516, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_root_node = ((struct LxmlElement *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -201757,7 +201885,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 518, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc, __pyx_v_root_node->_c_node); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 518, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":520
@@ -201795,7 +201923,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         # using the stylesheet dict is safer than using a possibly
  */
-    PyErr_NoMemory(); __PYX_ERR(3, 523, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(4, 523, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":521
  * 
@@ -201841,7 +201969,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             # parameter values are stored in the dict
  *             # => avoid unnecessarily cluttering the global dict
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 531, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_kw); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 531, __pyx_L1_error)
   if (__pyx_t_3) {
 
     /* "src/lxml/xslt.pxi":534
@@ -201879,7 +202007,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *         else:
  *             transform_ctxt.dict = self._c_style.doc.dict
  */
-      PyErr_NoMemory(); __PYX_ERR(3, 537, __pyx_L1_error)
+      PyErr_NoMemory(); __PYX_ERR(4, 537, __pyx_L1_error)
 
       /* "src/lxml/xslt.pxi":535
  *             # => avoid unnecessarily cluttering the global dict
@@ -201938,7 +202066,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             transform_ctxt.profile = 1
  * 
  */
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_profile_run); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 545, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_profile_run); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 545, __pyx_L1_error)
   if (__pyx_t_3) {
 
     /* "src/lxml/xslt.pxi":546
@@ -201975,9 +202103,9 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             context.register_context(transform_ctxt, input_doc)
  * 
  */
-    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 549, __pyx_L9_error)
+    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 549, __pyx_L9_error)
     __Pyx_GOTREF(__pyx_t_1);
-    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(3, 549, __pyx_L9_error)
+    if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(4, 549, __pyx_L9_error)
     __Pyx_DECREF_SET(__pyx_v_context, ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_t_1));
     __pyx_t_1 = 0;
 
@@ -201988,7 +202116,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *             resolver_context = self._xslt_resolver_context._copy()
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree_12_XSLTContext_register_context(__pyx_v_context, __pyx_v_transform_ctxt, __pyx_v_input_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 550, __pyx_L9_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree_12_XSLTContext_register_context(__pyx_v_context, __pyx_v_transform_ctxt, __pyx_v_input_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 550, __pyx_L9_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -201999,7 +202127,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             transform_ctxt._private = <python.PyObject*>resolver_context
  * 
  */
-    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(__pyx_v_self->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 552, __pyx_L9_error)
+    __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(__pyx_v_self->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 552, __pyx_L9_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_v_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_t_1);
     __pyx_t_1 = 0;
@@ -202020,7 +202148,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             c_result = self._run_transform(
  *                 c_doc, params, context, transform_ctxt)
  */
-    __pyx_t_1 = __pyx_f_4lxml_5etree__convert_xslt_parameters(__pyx_v_transform_ctxt, __pyx_v_kw, (&__pyx_v_params)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 555, __pyx_L9_error)
+    __pyx_t_1 = __pyx_f_4lxml_5etree__convert_xslt_parameters(__pyx_v_transform_ctxt, __pyx_v_kw, (&__pyx_v_params)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 555, __pyx_L9_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -202163,7 +202291,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                         c_profile_doc, input_doc._parser)
  *         finally:
  */
-        __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_profile_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 570, __pyx_L9_error)
+        __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_profile_doc, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_1))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 570, __pyx_L9_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_DECREF_SET(__pyx_v_profile_doc, ((struct LxmlDocument *)__pyx_t_5));
@@ -202208,7 +202336,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
  * 
  */
-        __pyx_t_5 = __pyx_f_4lxml_5etree_12_XSLTContext_free_context(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 574, __pyx_L1_error)
+        __pyx_t_5 = __pyx_f_4lxml_5etree_12_XSLTContext_free_context(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 574, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -202267,7 +202395,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *             _destroyFakeDoc(input_doc._c_doc, c_doc)
  * 
  */
-          __pyx_t_5 = __pyx_f_4lxml_5etree_12_XSLTContext_free_context(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 574, __pyx_L18_error)
+          __pyx_t_5 = __pyx_f_4lxml_5etree_12_XSLTContext_free_context(__pyx_v_context); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 574, __pyx_L18_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -202341,7 +202469,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
       __pyx_t_3 = __pyx_t_16;
       goto __pyx_L24_bool_binop_done;
     }
-    __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(3, 578, __pyx_L21_error)
+    __pyx_t_16 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_16 == ((int)-1))) __PYX_ERR(4, 578, __pyx_L21_error)
     __pyx_t_6 = (__pyx_t_16 != 0);
     __pyx_t_3 = __pyx_t_6;
     __pyx_L24_bool_binop_done:;
@@ -202391,7 +202519,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *             if context._exc._has_raised():
  */
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 582, __pyx_L21_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 582, __pyx_L21_error)
 
       /* "src/lxml/xslt.pxi":578
  * 
@@ -202409,7 +202537,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                 if c_result is not NULL:
  *                     tree.xmlFreeDoc(c_result)
  */
-    __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_has_raised(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(3, 584, __pyx_L21_error)
+    __pyx_t_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_has_raised(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 584, __pyx_L21_error)
     __pyx_t_6 = (__pyx_t_3 != 0);
     if (__pyx_t_6) {
 
@@ -202457,7 +202585,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *             if c_result is NULL:
  */
-      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 588, __pyx_L21_error)
+      __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_context->__pyx_base._exc); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 588, __pyx_L21_error)
 
       /* "src/lxml/xslt.pxi":584
  *                 resolver_context._raise_if_stored()
@@ -202504,9 +202632,9 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
         __pyx_t_6 = __pyx_t_16;
         goto __pyx_L31_bool_binop_done;
       }
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 593, __pyx_L21_error)
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 593, __pyx_L21_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(3, 593, __pyx_L21_error)
+      __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(4, 593, __pyx_L21_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
       __pyx_t_6 = __pyx_t_16;
       __pyx_L31_bool_binop_done:;
@@ -202519,11 +202647,11 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                         message = f"{error.message}, line {error.line}"
  *                     else:
  */
-        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 594, __pyx_L21_error)
+        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 594, __pyx_L21_error)
         __Pyx_GOTREF(__pyx_t_5);
-        __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 594, __pyx_L21_error)
+        __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 594, __pyx_L21_error)
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 594, __pyx_L21_error)
+        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(4, 594, __pyx_L21_error)
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         if (__pyx_t_6) {
 
@@ -202534,13 +202662,13 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                     else:
  *                         message = error.message
  */
-          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_1);
           __pyx_t_17 = 0;
           __pyx_t_18 = 127;
-          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_5);
-          __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_19 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_empty_unicode); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_19);
           __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
           __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_19) : __pyx_t_18;
@@ -202552,9 +202680,9 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
           __pyx_t_17 += 7;
           __Pyx_GIVEREF(__pyx_kp_u_line);
           PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_line);
-          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_19)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_19);
-          __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_19, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_19, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
           __pyx_t_18 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) > __pyx_t_18) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) : __pyx_t_18;
@@ -202562,7 +202690,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
           __Pyx_GIVEREF(__pyx_t_5);
           PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_5);
           __pyx_t_5 = 0;
-          __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 595, __pyx_L21_error)
+          __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_1, 3, __pyx_t_17, __pyx_t_18); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 595, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_5);
           __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
           __pyx_v_message = __pyx_t_5;
@@ -202586,7 +202714,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                     message = f"Error applying stylesheet, line {error.line}"
  */
         /*else*/ {
-          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 597, __pyx_L21_error)
+          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_message); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 597, __pyx_L21_error)
           __Pyx_GOTREF(__pyx_t_5);
           __pyx_v_message = __pyx_t_5;
           __pyx_t_5 = 0;
@@ -202617,11 +202745,11 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
         __pyx_t_6 = __pyx_t_3;
         goto __pyx_L34_bool_binop_done;
       }
-      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 598, __pyx_L21_error)
+      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 598, __pyx_L21_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 598, __pyx_L21_error)
+      __pyx_t_1 = PyObject_RichCompare(__pyx_t_5, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 598, __pyx_L21_error)
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 598, __pyx_L21_error)
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 598, __pyx_L21_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __pyx_t_6 = __pyx_t_3;
       __pyx_L34_bool_binop_done:;
@@ -202634,12 +202762,12 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *                 else:
  *                     message = u"Error applying stylesheet"
  */
-        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 599, __pyx_L21_error)
+        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_error, __pyx_n_s_line_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L21_error)
         __Pyx_GOTREF(__pyx_t_1);
-        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 599, __pyx_L21_error)
+        __pyx_t_5 = __Pyx_PyObject_FormatSimple(__pyx_t_1, __pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 599, __pyx_L21_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Error_applying_stylesheet_line, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 599, __pyx_L21_error)
+        __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Error_applying_stylesheet_line, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 599, __pyx_L21_error)
         __Pyx_GOTREF(__pyx_t_1);
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
         __pyx_v_message = __pyx_t_1;
@@ -202675,7 +202803,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *         finally:
  *             if resolver_context is not None:
  */
-      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 602, __pyx_L21_error)
+      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 602, __pyx_L21_error)
       __Pyx_GOTREF(__pyx_t_1);
       __Pyx_INCREF(__pyx_v_message);
       __Pyx_GIVEREF(__pyx_v_message);
@@ -202683,12 +202811,12 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
       __Pyx_INCREF(((PyObject *)__pyx_v_self->_error_log));
       __Pyx_GIVEREF(((PyObject *)__pyx_v_self->_error_log));
       PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_self->_error_log));
-      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTApplyError), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 602, __pyx_L21_error)
+      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTApplyError), __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 602, __pyx_L21_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
       __Pyx_Raise(__pyx_t_5, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
-      __PYX_ERR(3, 602, __pyx_L21_error)
+      __PYX_ERR(4, 602, __pyx_L21_error)
 
       /* "src/lxml/xslt.pxi":590
  *                 context._exc._raise_if_stored()
@@ -202720,7 +202848,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         result_doc = _documentFactory(c_result, input_doc._parser)
  */
-        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 605, __pyx_L1_error)
+        __pyx_t_8 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(4, 605, __pyx_L1_error)
 
         /* "src/lxml/xslt.pxi":604
  *                 raise XSLTApplyError(message, self._error_log)
@@ -202761,7 +202889,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  * 
  *         result_doc = _documentFactory(c_result, input_doc._parser)
  */
-          __pyx_t_21 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(3, 605, __pyx_L38_error)
+          __pyx_t_21 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_resolver_context)); if (unlikely(__pyx_t_21 == ((int)-1))) __PYX_ERR(4, 605, __pyx_L38_error)
 
           /* "src/lxml/xslt.pxi":604
  *                 raise XSLTApplyError(message, self._error_log)
@@ -202810,7 +202938,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_input_doc->_parser);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_result, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_5))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 607, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_result, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_t_5))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 607, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_t_1);
@@ -203037,7 +203165,7 @@ static PyObject *__pyx_pf_4lxml_5etree_4XSLT_18__call__(struct __pyx_obj_4lxml_5
  *     cdef xmlDoc* _run_transform(self, xmlDoc* c_input_doc,
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__xsltResultTreeFactory(__pyx_v_result_doc, __pyx_v_self, __pyx_v_profile_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 627, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__xsltResultTreeFactory(__pyx_v_result_doc, __pyx_v_self, __pyx_v_profile_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 627, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -203143,9 +203271,9 @@ static xmlDoc *__pyx_f_4lxml_5etree_4XSLT__run_transform(struct __pyx_obj_4lxml_
  *             c_result = xslt.xsltApplyStylesheetUser(
  */
   /*with:*/ {
-    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 637, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_v_self->_error_log), __pyx_n_s_exit); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 637, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 637, __pyx_L4_error)
+    __pyx_t_4 = __pyx_f_4lxml_5etree_9_ErrorLog___enter__(__pyx_v_self->_error_log); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 637, __pyx_L4_error)
     /*try:*/ {
       {
         (void)__pyx_t_5; (void)__pyx_t_6; (void)__pyx_t_7; /* mark used */
@@ -203212,7 +203340,7 @@ static xmlDoc *__pyx_f_4lxml_5etree_4XSLT__run_transform(struct __pyx_obj_4lxml_
         if (__pyx_t_3) {
           __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__35, NULL);
           __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-          if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 637, __pyx_L1_error)
+          if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 637, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_7);
           __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
         }
@@ -203320,9 +203448,9 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  */
   if (unlikely(__pyx_v_parameters == Py_None)) {
     PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-    __PYX_ERR(3, 651, __pyx_L1_error)
+    __PYX_ERR(4, 651, __pyx_L1_error)
   }
-  __pyx_t_2 = PyDict_Size(__pyx_v_parameters); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 651, __pyx_L1_error)
+  __pyx_t_2 = PyDict_Size(__pyx_v_parameters); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(4, 651, __pyx_L1_error)
   __pyx_v_parameter_count = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":652
@@ -203381,7 +203509,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  *     try:
  *         i = 0
  */
-    PyErr_NoMemory(); __PYX_ERR(3, 659, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(4, 659, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":658
  *     # and + 1 as array is NULL terminated
@@ -203427,9 +203555,9 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
       __pyx_t_2 = 0;
       if (unlikely(__pyx_v_parameters == Py_None)) {
         PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
-        __PYX_ERR(3, 662, __pyx_L5_error)
+        __PYX_ERR(4, 662, __pyx_L5_error)
       }
-      __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_parameters, 1, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 662, __pyx_L5_error)
+      __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_parameters, 1, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 662, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_10);
       __Pyx_XDECREF(__pyx_t_7);
       __pyx_t_7 = __pyx_t_10;
@@ -203437,7 +203565,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
       while (1) {
         __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_8, &__pyx_t_2, &__pyx_t_10, &__pyx_t_11, NULL, __pyx_t_9);
         if (unlikely(__pyx_t_12 == 0)) break;
-        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(3, 662, __pyx_L5_error)
+        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(4, 662, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_10);
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_10);
@@ -203452,7 +203580,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  *             if isinstance(value, _XSLTQuotedStringParam):
  *                 v = (<_XSLTQuotedStringParam>value).strval
  */
-        __pyx_t_11 = __pyx_f_4lxml_5etree__utf8(__pyx_v_key); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 663, __pyx_L5_error)
+        __pyx_t_11 = __pyx_f_4lxml_5etree__utf8(__pyx_v_key); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 663, __pyx_L5_error)
         __Pyx_GOTREF(__pyx_t_11);
         __Pyx_XDECREF_SET(__pyx_v_k, ((PyObject*)__pyx_t_11));
         __pyx_t_11 = 0;
@@ -203541,7 +203669,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  *                 i += 1
  */
           /*else*/ {
-            __pyx_t_11 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 672, __pyx_L5_error)
+            __pyx_t_11 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 672, __pyx_L5_error)
             __Pyx_GOTREF(__pyx_t_11);
             __Pyx_XDECREF_SET(__pyx_v_v, ((PyObject*)__pyx_t_11));
             __pyx_t_11 = 0;
@@ -203557,9 +203685,9 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  */
           if (unlikely(__pyx_v_k == Py_None)) {
             PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-            __PYX_ERR(3, 673, __pyx_L5_error)
+            __PYX_ERR(4, 673, __pyx_L5_error)
           }
-          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_k); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(3, 673, __pyx_L5_error)
+          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_k); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(4, 673, __pyx_L5_error)
           (__pyx_v_params[__pyx_v_i]) = ((const char *)xmlDictLookup(__pyx_v_c_dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_k), __pyx_t_14));
 
           /* "src/lxml/xslt.pxi":674
@@ -203580,9 +203708,9 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  */
           if (unlikely(__pyx_v_v == Py_None)) {
             PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
-            __PYX_ERR(3, 675, __pyx_L5_error)
+            __PYX_ERR(4, 675, __pyx_L5_error)
           }
-          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_v); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(3, 675, __pyx_L5_error)
+          __pyx_t_14 = PyBytes_GET_SIZE(__pyx_v_v); if (unlikely(__pyx_t_14 == ((Py_ssize_t)-1))) __PYX_ERR(4, 675, __pyx_L5_error)
           (__pyx_v_params[__pyx_v_i]) = ((const char *)xmlDictLookup(__pyx_v_c_dict, (const xmlChar*)PyBytes_AS_STRING(__pyx_v_v), __pyx_t_14));
 
           /* "src/lxml/xslt.pxi":676
@@ -203624,7 +203752,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
  */
     /*except:*/ {
       __Pyx_AddTraceback("lxml.etree._convert_xslt_parameters", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_10) < 0) __PYX_ERR(3, 677, __pyx_L7_except_error)
+      if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_11, &__pyx_t_10) < 0) __PYX_ERR(4, 677, __pyx_L7_except_error)
       __Pyx_GOTREF(__pyx_t_7);
       __Pyx_GOTREF(__pyx_t_11);
       __Pyx_GOTREF(__pyx_t_10);
@@ -203650,7 +203778,7 @@ static PyObject *__pyx_f_4lxml_5etree__convert_xslt_parameters(xsltTransformCont
       __Pyx_XGIVEREF(__pyx_t_10);
       __Pyx_ErrRestoreWithState(__pyx_t_7, __pyx_t_11, __pyx_t_10);
       __pyx_t_7 = 0; __pyx_t_11 = 0; __pyx_t_10 = 0; 
-      __PYX_ERR(3, 679, __pyx_L7_except_error)
+      __PYX_ERR(4, 679, __pyx_L7_except_error)
     }
     __pyx_L7_except_error:;
 
@@ -203746,7 +203874,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
   if (unlikely(!Py_OptimizeFlag)) {
     if (unlikely(!((__pyx_v_stylesheet->_c_style != NULL) != 0))) {
       PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_XSLT_stylesheet_not_initialised);
-      __PYX_ERR(3, 686, __pyx_L1_error)
+      __PYX_ERR(4, 686, __pyx_L1_error)
     }
   }
   #endif
@@ -203758,7 +203886,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *     new_xslt._access_control = stylesheet._access_control
  *     new_xslt._error_log = _ErrorLog()
  */
-  __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree_XSLT(((PyTypeObject *)__pyx_ptype_4lxml_5etree_XSLT), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 687, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_tp_new_4lxml_5etree_XSLT(((PyTypeObject *)__pyx_ptype_4lxml_5etree_XSLT), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 687, __pyx_L1_error)
   __Pyx_GOTREF(((PyObject *)__pyx_t_1));
   __pyx_v_new_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_t_1);
   __pyx_t_1 = 0;
@@ -203785,7 +203913,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *     new_xslt._context = stylesheet._context._copy()
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 689, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__ErrorLog)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 689, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_new_xslt->_error_log);
@@ -203800,9 +203928,9 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  * 
  *     new_xslt._xslt_resolver_context = stylesheet._xslt_resolver_context._copy()
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 690, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_12_XSLTContext__copy(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_stylesheet->_context))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 690, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(3, 690, __pyx_L1_error)
+  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_4lxml_5etree__XSLTContext))))) __PYX_ERR(4, 690, __pyx_L1_error)
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_new_xslt->_context);
   __Pyx_DECREF(((PyObject *)__pyx_v_new_xslt->_context));
@@ -203816,7 +203944,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *     new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(__pyx_v_stylesheet->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 692, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(__pyx_v_stylesheet->_xslt_resolver_context)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 692, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_1);
   __Pyx_GOTREF(__pyx_v_new_xslt->_xslt_resolver_context);
@@ -203831,7 +203959,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *         stylesheet._xslt_resolver_context._c_style_doc, 1)
  * 
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_xslt_resolver_context->_c_style_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 693, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_xslt_resolver_context->_c_style_doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 693, __pyx_L1_error)
   __pyx_v_new_xslt->_xslt_resolver_context->_c_style_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":696
@@ -203841,7 +203969,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  *     new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
  *     if new_xslt._c_style is NULL:
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_c_style->doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(3, 696, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_stylesheet->_c_style->doc, 1); if (unlikely(__pyx_t_2 == ((xmlDoc *)NULL))) __PYX_ERR(4, 696, __pyx_L1_error)
   __pyx_v_c_doc = __pyx_t_2;
 
   /* "src/lxml/xslt.pxi":697
@@ -203879,7 +204007,7 @@ static struct __pyx_obj_4lxml_5etree_XSLT *__pyx_f_4lxml_5etree__copyXSLT(struct
  * 
  *     return new_xslt
  */
-    PyErr_NoMemory(); __PYX_ERR(3, 700, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(4, 700, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":698
  *     c_doc = _copyDoc(stylesheet._c_style.doc, 1)
@@ -203968,7 +204096,7 @@ static PyObject *__pyx_pw_4lxml_5etree_15_XSLTResultTree_1write_output(PyObject
         if (value) { values[index] = value; kw_args--; }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_output") < 0)) __PYX_ERR(3, 717, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "write_output") < 0)) __PYX_ERR(4, 717, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
       goto __pyx_L5_argtuple_error;
@@ -203980,7 +204108,7 @@ static PyObject *__pyx_pw_4lxml_5etree_15_XSLTResultTree_1write_output(PyObject
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("write_output", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 717, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("write_output", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 717, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._XSLTResultTree.write_output", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -204121,7 +204249,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  *         c_compression = compression or 0
  *         xslt.LXML_GET_XSLT_ENCODING(c_encoding, self._xslt._c_style)
  */
-      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_XSLTSaveError); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 738, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_XSLTSaveError); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 738, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __pyx_t_5 = NULL;
       if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -204135,12 +204263,12 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
       }
       __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_s_No_document_to_serialise) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_s_No_document_to_serialise);
       __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-      if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 738, __pyx_L1_error)
+      if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 738, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       __Pyx_Raise(__pyx_t_3, 0, 0, 0);
       __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-      __PYX_ERR(3, 738, __pyx_L1_error)
+      __PYX_ERR(4, 738, __pyx_L1_error)
 
       /* "src/lxml/xslt.pxi":737
  *         if doc is None:
@@ -204167,10 +204295,10 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  *         xslt.LXML_GET_XSLT_ENCODING(c_encoding, self._xslt._c_style)
  *         writer = _create_output_buffer(file, <const_char*>c_encoding, compression, &c_buffer, close=False)
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compression); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 739, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_compression); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 739, __pyx_L1_error)
   if (!__pyx_t_2) {
   } else {
-    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 739, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 739, __pyx_L1_error)
     __pyx_t_6 = __pyx_t_7;
     goto __pyx_L6_bool_binop_done;
   }
@@ -204194,8 +204322,8 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  *         if writer is None:
  *             with nogil:
  */
-  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 741, __pyx_L1_error)
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__create_output_buffer(__pyx_v_file, ((const char *)__pyx_v_c_encoding), __pyx_t_6, (&__pyx_v_c_buffer), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 741, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_compression); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 741, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__create_output_buffer(__pyx_v_file, ((const char *)__pyx_v_c_encoding), __pyx_t_6, (&__pyx_v_c_buffer), 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF_SET(__pyx_v_writer, ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_t_3));
   __pyx_t_3 = 0;
@@ -204313,7 +204441,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  *         if r < 0 or rclose == -1:
  *             python.PyErr_SetFromErrno(IOError)  # raises IOError
  */
-    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(3, 750, __pyx_L1_error)
+    __pyx_t_6 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(4, 750, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":749
  *             r = xslt.xsltSaveResultTo(c_buffer, doc._c_doc, self._xslt._c_style)
@@ -204349,7 +204477,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_write_output(struct __p
  * 
  *     cdef _saveToStringAndSize(self, xmlChar** s, int* l):
  */
-    __pyx_t_3 = PyErr_SetFromErrno(__pyx_builtin_IOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 752, __pyx_L1_error)
+    __pyx_t_3 = PyErr_SetFromErrno(__pyx_builtin_IOError); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 752, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
@@ -204587,7 +204715,7 @@ static PyObject *__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(str
  * 
  *     def __str__(self):
  */
-    PyErr_NoMemory(); __PYX_ERR(3, 770, __pyx_L1_error)
+    PyErr_NoMemory(); __PYX_ERR(4, 770, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":769
  *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
@@ -204701,7 +204829,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_2__str__(struct __pyx_o
  *         if s is NULL:
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 776, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unicode_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -204715,7 +204843,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_2__str__(struct __pyx_o
     }
     __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-    if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 776, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 776, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_2;
@@ -204738,7 +204866,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_2__str__(struct __pyx_o
  *         if s is NULL:
  *             return ''
  */
-  __pyx_t_2 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 777, __pyx_L1_error)
+  __pyx_t_2 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 777, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
@@ -204789,7 +204917,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_2__str__(struct __pyx_o
  *         finally:
  *             tree.xmlFree(s)
  */
-    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_s) + 0, __pyx_v_l - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 782, __pyx_L6_error)
+    __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_s) + 0, __pyx_v_l - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 782, __pyx_L6_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_3 = __pyx_t_2;
     __Pyx_INCREF(__pyx_t_3);
@@ -204952,7 +205080,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_4__unicode__(struct __p
  *         if s is NULL:
  *             return u''
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 791, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, (&__pyx_v_s), (&__pyx_v_l)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 791, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
@@ -205023,7 +205151,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_4__unicode__(struct __p
  *             else:
  *                 result = s[:l].decode(encoding)
  */
-      __pyx_t_1 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_l, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 797, __pyx_L5_error)
+      __pyx_t_1 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_l, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 797, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_v_result = __pyx_t_1;
       __pyx_t_1 = 0;
@@ -205046,7 +205174,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_4__unicode__(struct __p
  *             tree.xmlFree(s)
  */
     /*else*/ {
-      __pyx_t_1 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_l, ((char const *)__pyx_v_encoding), NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 799, __pyx_L5_error)
+      __pyx_t_1 = __Pyx_decode_c_string(((char const *)__pyx_v_s), 0, __pyx_v_l, ((char const *)__pyx_v_encoding), NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 799, __pyx_L5_error)
       __Pyx_GOTREF(__pyx_t_1);
       __pyx_v_result = __pyx_t_1;
       __pyx_t_1 = 0;
@@ -205109,7 +205237,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_4__unicode__(struct __p
  *     def __getbuffer__(self, Py_buffer* buffer, int flags):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_1 = __pyx_f_4lxml_5etree__stripEncodingDeclaration(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 802, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__stripEncodingDeclaration(__pyx_v_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 802, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_r = __pyx_t_1;
   __pyx_t_1 = 0;
@@ -205239,7 +205367,7 @@ static int __pyx_pf_4lxml_5etree_15_XSLTResultTree_6__getbuffer__(struct __pyx_o
  *             buffer.len = l
  *             if self._buffer is NULL and not flags & python.PyBUF_WRITABLE:
  */
-    __pyx_t_3 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, ((xmlChar **)(&__pyx_v_buffer->buf)), (&__pyx_v_l)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
+    __pyx_t_3 = __pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize(__pyx_v_self, ((xmlChar **)(&__pyx_v_buffer->buf)), (&__pyx_v_l)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 809, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
 
@@ -205772,7 +205900,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(
  *             if root is None:
  *                 return None
  */
-  __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->_profile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_9_Document_getroot(__pyx_v_self->_profile); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 855, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_v_root = __pyx_t_3;
   __pyx_t_3 = 0;
@@ -205816,7 +205944,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(
  *         def __del__(self):
  */
   __Pyx_XDECREF(__pyx_r);
-  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ElementTree); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 858, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ElementTree); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 858, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -205830,7 +205958,7 @@ static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(
   }
   __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_root) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_root);
   __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 858, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 858, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_r = __pyx_t_3;
@@ -205938,7 +206066,7 @@ static PyObject *__pyx_f_4lxml_5etree__xsltResultTreeFactory(struct LxmlDocument
  *     result._xslt = xslt
  *     result._profile = profile
  */
-  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, ((struct LxmlElement *)Py_None), ((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 865, __pyx_L1_error)
+  __pyx_t_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc, ((struct LxmlElement *)Py_None), ((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree))); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 865, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_2 = __pyx_t_1;
   __Pyx_INCREF(__pyx_t_2);
@@ -206044,12 +206172,12 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
  *     return __findStylesheetByID(doc, id=id)
  * 
  */
-    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 891, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 891, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
-    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 891, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 891, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_xsl, __pyx_kp_u_http_www_w3_org_1999_XSL_Transfo) < 0) __PYX_ERR(3, 891, __pyx_L1_error)
-    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_t_4) < 0) __PYX_ERR(3, 891, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_4, __pyx_n_u_xsl, __pyx_kp_u_http_www_w3_org_1999_XSL_Transfo) < 0) __PYX_ERR(4, 891, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_namespaces, __pyx_t_4) < 0) __PYX_ERR(4, 891, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/xslt.pxi":889
@@ -206059,7 +206187,7 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
  *             u"//xsl:stylesheet[@xml:id = $id]",
  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
  */
-    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__102, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 889, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__102, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 889, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
@@ -206084,15 +206212,15 @@ static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *_
  * cdef class _XSLTProcessingInstruction(PIBase):
  */
   __Pyx_XDECREF(__pyx_r);
-  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 892, __pyx_L1_error)
+  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 892, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_INCREF(((PyObject *)__pyx_v_doc));
   __Pyx_GIVEREF(((PyObject *)__pyx_v_doc));
   PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_doc));
-  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 892, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 892, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_id, __pyx_v_id) < 0) __PYX_ERR(3, 892, __pyx_L1_error)
-  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 892, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_id, __pyx_v_id) < 0) __PYX_ERR(4, 892, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID), __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 892, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -206163,7 +206291,7 @@ static PyObject *__pyx_pw_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL(Py
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parseXSL") < 0)) __PYX_ERR(3, 895, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "parseXSL") < 0)) __PYX_ERR(4, 895, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -206177,7 +206305,7 @@ static PyObject *__pyx_pw_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL(Py
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("parseXSL", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 895, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("parseXSL", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 895, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.parseXSL", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -206229,7 +206357,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         if self._c_node.content is NULL:
  *             raise ValueError, u"PI lacks content"
  */
-  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 911, __pyx_L1_error)
+  __pyx_t_1 = __pyx_f_4lxml_5etree__assertValidNode(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(4, 911, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":912
  *         cdef xmlAttr* c_attr
@@ -206249,7 +206377,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         if len(hrefs) != 1:
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_PI_lacks_content, 0, 0);
-    __PYX_ERR(3, 913, __pyx_L1_error)
+    __PYX_ERR(4, 913, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":912
  *         cdef xmlAttr* c_attr
@@ -206268,9 +206396,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"malformed PI attributes"
  */
   __pyx_t_4 = ((unsigned char *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content);
-  __pyx_t_5 = __Pyx_decode_c_string(((char const *)__pyx_t_4), 0, strlen(((char const *)__pyx_t_4)), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 914, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_decode_c_string(((char const *)__pyx_t_4), 0, strlen(((char const *)__pyx_t_4)), NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 914, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 914, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u__11, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 914, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_INCREF(__pyx_v_4lxml_5etree__FIND_PI_HREF);
@@ -206287,7 +206415,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
   __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6);
   __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-  if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 914, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 914, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_v_hrefs = __pyx_t_3;
@@ -206300,7 +206428,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"malformed PI attributes"
  *         hrefs = hrefs[0]
  */
-  __pyx_t_8 = PyObject_Length(__pyx_v_hrefs); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(3, 915, __pyx_L1_error)
+  __pyx_t_8 = PyObject_Length(__pyx_v_hrefs); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 915, __pyx_L1_error)
   __pyx_t_2 = ((__pyx_t_8 != 1) != 0);
   if (unlikely(__pyx_t_2)) {
 
@@ -206312,7 +206440,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         href_utf = utf8(hrefs[0] or hrefs[1])
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_malformed_PI_attributes, 0, 0);
-    __PYX_ERR(3, 916, __pyx_L1_error)
+    __PYX_ERR(4, 916, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":915
  *             raise ValueError, u"PI lacks content"
@@ -206330,7 +206458,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         href_utf = utf8(hrefs[0] or hrefs[1])
  *         c_href = _xcstr(href_utf)
  */
-  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_hrefs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 917, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_hrefs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 917, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF_SET(__pyx_v_hrefs, __pyx_t_3);
   __pyx_t_3 = 0;
@@ -206342,9 +206470,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         c_href = _xcstr(href_utf)
  * 
  */
-  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_hrefs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 918, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_hrefs, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 918, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 918, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 918, __pyx_L1_error)
   if (!__pyx_t_2) {
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   } else {
@@ -206353,13 +206481,13 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     goto __pyx_L5_bool_binop_done;
   }
-  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_hrefs, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 918, __pyx_L1_error)
+  __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_hrefs, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 918, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_t_5);
   __pyx_t_3 = __pyx_t_5;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __pyx_L5_bool_binop_done:;
-  __pyx_t_5 = utf8(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 918, __pyx_L1_error)
+  __pyx_t_5 = utf8(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 918, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_v_href_utf = ((PyObject*)__pyx_t_5);
@@ -206419,7 +206547,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *                 finally:
  *                     tree.xmlFree(<char*>c_href)
  */
-        __pyx_t_5 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_href)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 928, __pyx_L10_error)
+        __pyx_t_5 = __Pyx_PyBytes_FromCString(((unsigned char *)__pyx_v_c_href)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 928, __pyx_L10_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF_SET(__pyx_v_href_utf, ((PyObject*)__pyx_t_5));
         __pyx_t_5 = 0;
@@ -206491,8 +206619,8 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             return _elementTreeFactory(result_doc, None)
  * 
  */
-    if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(3, 931, __pyx_L1_error)
-    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocumentFromURL(__pyx_v_href_utf, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 931, __pyx_L1_error)
+    if (!(likely(((__pyx_v_parser) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser))))) __PYX_ERR(4, 931, __pyx_L1_error)
+    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocumentFromURL(__pyx_v_href_utf, ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 931, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_t_5);
     __pyx_t_5 = 0;
@@ -206505,7 +206633,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         # ID reference to embedded stylesheet
  */
     __Pyx_XDECREF(__pyx_r);
-    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 932, __pyx_L1_error)
+    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_doc, ((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 932, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __pyx_r = __pyx_t_5;
     __pyx_t_5 = 0;
@@ -206529,7 +206657,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_5)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 936, __pyx_L1_error)
+  __pyx_t_9 = __pyx_f_4lxml_5etree__assertValidDoc(((struct LxmlDocument *)__pyx_t_5)); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 936, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
   /* "src/lxml/xslt.pxi":937
@@ -206577,7 +206705,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  */
     __pyx_t_5 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc);
     __Pyx_INCREF(__pyx_t_5);
-    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_attr->parent)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 940, __pyx_L1_error)
+    __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_t_5), __pyx_v_c_attr->parent)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 940, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_result_node = ((struct LxmlElement *)__pyx_t_3);
@@ -206593,7 +206721,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
     __Pyx_XDECREF(__pyx_r);
     __pyx_t_3 = ((PyObject *)__pyx_v_result_node->_doc);
     __Pyx_INCREF(__pyx_t_3);
-    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_result_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 941, __pyx_L1_error)
+    __pyx_t_5 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_3), __pyx_v_result_node)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 941, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     __pyx_r = __pyx_t_5;
@@ -206618,9 +206746,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  */
   __pyx_t_5 = ((PyObject *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc);
   __Pyx_INCREF(__pyx_t_5);
-  __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_href); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 944, __pyx_L1_error)
+  __pyx_t_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_href); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 944, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
-  __pyx_t_6 = __pyx_f_4lxml_5etree__findStylesheetByID(((struct LxmlDocument *)__pyx_t_5), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 944, __pyx_L1_error)
+  __pyx_t_6 = __pyx_f_4lxml_5etree__findStylesheetByID(((struct LxmlDocument *)__pyx_t_5), __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 944, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
@@ -206634,7 +206762,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"reference to non-existing embedded stylesheet"
  *         elif len(root) > 1:
  */
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_root); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 945, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_root); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 945, __pyx_L1_error)
   __pyx_t_17 = ((!__pyx_t_2) != 0);
   if (unlikely(__pyx_t_17)) {
 
@@ -206646,7 +206774,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_reference_to_non_existing_embedd, 0, 0);
-    __PYX_ERR(3, 946, __pyx_L1_error)
+    __PYX_ERR(4, 946, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":945
  *         # try XPath search
@@ -206664,7 +206792,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *             raise ValueError, u"ambiguous reference to embedded stylesheet"
  *         result_node = root[0]
  */
-  __pyx_t_8 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(3, 947, __pyx_L1_error)
+  __pyx_t_8 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 947, __pyx_L1_error)
   __pyx_t_17 = ((__pyx_t_8 > 1) != 0);
   if (unlikely(__pyx_t_17)) {
 
@@ -206676,7 +206804,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         return _elementTreeFactory(result_node._doc, result_node)
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_ambiguous_reference_to_embedded, 0, 0);
-    __PYX_ERR(3, 948, __pyx_L1_error)
+    __PYX_ERR(4, 948, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":947
  *         if not root:
@@ -206694,9 +206822,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
  *         return _elementTreeFactory(result_node._doc, result_node)
  * 
  */
-  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_root, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 949, __pyx_L1_error)
+  __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_root, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 949, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
-  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(3, 949, __pyx_L1_error)
+  if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_4lxml_5etree__Element))))) __PYX_ERR(4, 949, __pyx_L1_error)
   __pyx_v_result_node = ((struct LxmlElement *)__pyx_t_6);
   __pyx_t_6 = 0;
 
@@ -206710,7 +206838,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(str
   __Pyx_XDECREF(__pyx_r);
   __pyx_t_6 = ((PyObject *)__pyx_v_result_node->_doc);
   __Pyx_INCREF(__pyx_t_6);
-  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_6), __pyx_v_result_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 950, __pyx_L1_error)
+  __pyx_t_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)__pyx_t_6), __pyx_v_result_node)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 950, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
   __pyx_r = __pyx_t_3;
@@ -206788,11 +206916,11 @@ static PyObject *__pyx_pw_4lxml_5etree_26_XSLTProcessingInstruction_3set(PyObjec
         case  1:
         if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
         else {
-          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(3, 952, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, 1); __PYX_ERR(4, 952, __pyx_L3_error)
         }
       }
       if (unlikely(kw_args > 0)) {
-        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(3, 952, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set") < 0)) __PYX_ERR(4, 952, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -206805,7 +206933,7 @@ static PyObject *__pyx_pw_4lxml_5etree_26_XSLTProcessingInstruction_3set(PyObjec
   }
   goto __pyx_L4_argument_unpacking_done;
   __pyx_L5_argtuple_error:;
-  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 952, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("set", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 952, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.set", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -206845,7 +206973,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *             raise AttributeError, \
  *                 u"only setting the 'href' attribute is supported on XSLT-PIs"
  */
-  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_href, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 958, __pyx_L1_error)
+  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_key, __pyx_n_u_href, Py_NE)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 958, __pyx_L1_error)
   if (unlikely(__pyx_t_1)) {
 
     /* "src/lxml/xslt.pxi":959
@@ -206856,7 +206984,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *         if value is None:
  */
     __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_kp_u_only_setting_the_href_attribute, 0, 0);
-    __PYX_ERR(3, 959, __pyx_L1_error)
+    __PYX_ERR(4, 959, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":958
  *         the processing instruction.
@@ -206905,14 +207033,14 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *             raise ValueError, u"Invalid URL, must not contain '\"' or '>'"
  *         else:
  */
-  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__23, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(3, 963, __pyx_L1_error)
+  __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__23, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 963, __pyx_L1_error)
   __pyx_t_3 = (__pyx_t_1 != 0);
   if (!__pyx_t_3) {
   } else {
     __pyx_t_2 = __pyx_t_3;
     goto __pyx_L5_bool_binop_done;
   }
-  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__26, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(3, 963, __pyx_L1_error)
+  __pyx_t_3 = (__Pyx_PySequence_ContainsTF(__pyx_kp_u__26, __pyx_v_value, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(4, 963, __pyx_L1_error)
   __pyx_t_1 = (__pyx_t_3 != 0);
   __pyx_t_2 = __pyx_t_1;
   __pyx_L5_bool_binop_done:;
@@ -206926,7 +207054,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *             attrib = f' href="{value}"'
  */
     __Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_u_Invalid_URL_must_not_contain_or, 0, 0);
-    __PYX_ERR(3, 964, __pyx_L1_error)
+    __PYX_ERR(4, 964, __pyx_L1_error)
 
     /* "src/lxml/xslt.pxi":963
  *         if value is None:
@@ -206945,7 +207073,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *         if _FIND_PI_HREF(text):
  */
   /*else*/ {
-    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 966, __pyx_L1_error)
+    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 966, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = 0;
     __pyx_t_6 = 127;
@@ -206953,7 +207081,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
     __pyx_t_5 += 7;
     __Pyx_GIVEREF(__pyx_kp_u_href_2);
     PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_u_href_2);
-    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 966, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_v_value, __pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 966, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __pyx_t_6 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) > __pyx_t_6) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) : __pyx_t_6;
     __pyx_t_5 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7);
@@ -206964,7 +207092,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
     __pyx_t_5 += 1;
     __Pyx_GIVEREF(__pyx_kp_u__23);
     PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_u__23);
-    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 966, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_4, 3, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 966, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_v_attrib = ((PyObject*)__pyx_t_7);
@@ -206979,9 +207107,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *         if _FIND_PI_HREF(text):
  *             self.text = _REPLACE_PI_HREF(attrib, text)
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 967, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_4 = PyNumber_Add(__pyx_kp_u__11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 967, __pyx_L1_error)
+  __pyx_t_4 = PyNumber_Add(__pyx_kp_u__11, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 967, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __pyx_v_text = __pyx_t_4;
@@ -207007,10 +207135,10 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
   }
   __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_text) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_text);
   __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
-  if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 968, __pyx_L1_error)
+  if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 968, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 968, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 968, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_2) {
 
@@ -207037,7 +207165,7 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
     #if CYTHON_FAST_PYCALL
     if (PyFunction_Check(__pyx_t_7)) {
       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_attrib, __pyx_v_text};
-      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 969, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 969, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
@@ -207045,13 +207173,13 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
     #if CYTHON_FAST_PYCCALL
     if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
       PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_attrib, __pyx_v_text};
-      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 969, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 969, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
       __Pyx_GOTREF(__pyx_t_4);
     } else
     #endif
     {
-      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(3, 969, __pyx_L1_error)
+      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 969, __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;
@@ -207062,12 +207190,12 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
       __Pyx_INCREF(__pyx_v_text);
       __Pyx_GIVEREF(__pyx_v_text);
       PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_v_text);
-      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 969, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 969, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_4);
       __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     }
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text, __pyx_t_4) < 0) __PYX_ERR(3, 969, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text, __pyx_t_4) < 0) __PYX_ERR(4, 969, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
 
     /* "src/lxml/xslt.pxi":968
@@ -207086,9 +207214,9 @@ static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_2set(struct
  *             self.text = text + attrib             # <<<<<<<<<<<<<<
  */
   /*else*/ {
-    __pyx_t_4 = PyNumber_Add(__pyx_v_text, __pyx_v_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 971, __pyx_L1_error)
+    __pyx_t_4 = PyNumber_Add(__pyx_v_text, __pyx_v_attrib); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 971, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
-    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text, __pyx_t_4) < 0) __PYX_ERR(3, 971, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_text, __pyx_t_4) < 0) __PYX_ERR(4, 971, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   }
   __pyx_L7:;
@@ -231905,7 +232033,7 @@ static PyTypeObject __pyx_type_4lxml_5etree_PythonElementClassLookup = {
   0, /*tp_setattro*/
   0, /*tp_as_buffer*/
   Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
-  "PythonElementClassLookup(self, fallback=None)\n    Element class lookup based on a subclass method.\n\n    This class lookup scheme allows access to the entire XML tree in\n    read-only mode.  To use it, re-implement the ``lookup(self, doc,\n    root)`` method in a subclass::\n\n        from lxml import etree, pyclasslookup\n\n        class MyElementClass(etree.ElementBase):\n            honkey = True\n\n        class MyLookup(pyclasslookup.PythonElementClassLookup):\n            def lookup(self, doc, root):\n                if root.tag == \"sometag\":\n                    return MyElementClass\n                else:\n                    for child in root:\n                        if child.tag == \"someothertag\":\n                            return MyElementClass\n                # delegate to default\n                return None\n\n    If you return None from this method, the fallback will be called.\n\n    The first argument is the opaque document instance that contains\n    the Element.  The second argument is a lightweight Element proxy\n    implementation that is only valid during the lookup.  Do not try\n    to keep a reference to it.  Once the lookup is done, the proxy\n    will be invalid.\n\n    Also, you cannot wrap such a read-only Element in an ElementTree,\n    and you must take care not to keep a reference to them outside of\n    the `lookup()` method.\n\n    Note that the API of the Element objects is not complete.  It is\n    purely read-only and does not support all features of the normal\n    `lxml.etree` API (such as XPath, extended slicing or some\n    iteration methods).\n\n    See http://codespeak.net/lxml/element_classes.html\n    ", /*tp_doc*/
+  "PythonElementClassLookup(self, fallback=None)\n    Element class lookup based on a subclass method.\n\n    This class lookup scheme allows access to the entire XML tree in\n    read-only mode.  To use it, re-implement the ``lookup(self, doc,\n    root)`` method in a subclass::\n\n        from lxml import etree, pyclasslookup\n\n        class MyElementClass(etree.ElementBase):\n            honkey = True\n\n        class MyLookup(pyclasslookup.PythonElementClassLookup):\n            def lookup(self, doc, root):\n                if root.tag == \"sometag\":\n                    return MyElementClass\n                else:\n                    for child in root:\n                        if child.tag == \"someothertag\":\n                            return MyElementClass\n                # delegate to default\n                return None\n\n    If you return None from this method, the fallback will be called.\n\n    The first argument is the opaque document instance that contains\n    the Element.  The second argument is a lightweight Element proxy\n    implementation that is only valid during the lookup.  Do not try\n    to keep a reference to it.  Once the lookup is done, the proxy\n    will be invalid.\n\n    Also, you cannot wrap such a read-only Element in an ElementTree,\n    and you must take care not to keep a reference to them outside of\n    the `lookup()` method.\n\n    Note that the API of the Element objects is not complete.  It is\n    purely read-only and does not support all features of the normal\n    `lxml.etree` API (such as XPath, extended slicing or some\n    iteration methods).\n\n    See https://lxml.de/element_classes.html\n    ", /*tp_doc*/
   __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
   __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
   0, /*tp_richcompare*/
@@ -244287,6 +244415,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
   {&__pyx_n_u_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 1, 0, 1},
   {&__pyx_kp_s_All_strings_must_be_XML_compatib, __pyx_k_All_strings_must_be_XML_compatib, sizeof(__pyx_k_All_strings_must_be_XML_compatib), 0, 0, 1, 0},
+  {&__pyx_kp_s_An_XMLSyntaxError_that_addition, __pyx_k_An_XMLSyntaxError_that_addition, sizeof(__pyx_k_An_XMLSyntaxError_that_addition), 0, 0, 1, 0},
   {&__pyx_n_s_AncestorsIterator, __pyx_k_AncestorsIterator, sizeof(__pyx_k_AncestorsIterator), 0, 0, 1, 1},
   {&__pyx_n_s_AppendOnlyElementProxy_append, __pyx_k_AppendOnlyElementProxy_append, sizeof(__pyx_k_AppendOnlyElementProxy_append), 0, 0, 1, 1},
   {&__pyx_n_s_AppendOnlyElementProxy_extend, __pyx_k_AppendOnlyElementProxy_extend, sizeof(__pyx_k_AppendOnlyElementProxy_extend), 0, 0, 1, 1},
@@ -244829,6 +244958,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_XMLSchemaError, __pyx_k_XMLSchemaError, sizeof(__pyx_k_XMLSchemaError), 0, 0, 1, 1},
   {&__pyx_n_s_XMLSchemaParseError, __pyx_k_XMLSchemaParseError, sizeof(__pyx_k_XMLSchemaParseError), 0, 0, 1, 1},
   {&__pyx_n_s_XMLSchemaValidateError, __pyx_k_XMLSchemaValidateError, sizeof(__pyx_k_XMLSchemaValidateError), 0, 0, 1, 1},
+  {&__pyx_n_s_XMLSyntaxAssertionError, __pyx_k_XMLSyntaxAssertionError, sizeof(__pyx_k_XMLSyntaxAssertionError), 0, 0, 1, 1},
   {&__pyx_n_s_XMLSyntaxError, __pyx_k_XMLSyntaxError, sizeof(__pyx_k_XMLSyntaxError), 0, 0, 1, 1},
   {&__pyx_n_s_XMLTreeBuilder, __pyx_k_XMLTreeBuilder, sizeof(__pyx_k_XMLTreeBuilder), 0, 0, 1, 1},
   {&__pyx_kp_s_XML_declaration_already_written, __pyx_k_XML_declaration_already_written, sizeof(__pyx_k_XML_declaration_already_written), 0, 0, 1, 0},
@@ -245389,8 +245519,8 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
   {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
   {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
-  {&__pyx_kp_u_missing_end_tags, __pyx_k_missing_end_tags, sizeof(__pyx_k_missing_end_tags), 0, 1, 0, 0},
-  {&__pyx_kp_u_missing_toplevel_element, __pyx_k_missing_toplevel_element, sizeof(__pyx_k_missing_toplevel_element), 0, 1, 0, 0},
+  {&__pyx_kp_s_missing_end_tags, __pyx_k_missing_end_tags, sizeof(__pyx_k_missing_end_tags), 0, 0, 1, 0},
+  {&__pyx_kp_s_missing_toplevel_element, __pyx_k_missing_toplevel_element, sizeof(__pyx_k_missing_toplevel_element), 0, 0, 1, 0},
   {&__pyx_n_s_mixed, __pyx_k_mixed, sizeof(__pyx_k_mixed), 0, 0, 1, 1},
   {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
   {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
@@ -245433,6 +245563,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
   {&__pyx_n_s_occur, __pyx_k_occur, sizeof(__pyx_k_occur), 0, 0, 1, 1},
   {&__pyx_kp_u_of_QName, __pyx_k_of_QName, sizeof(__pyx_k_of_QName), 0, 1, 0, 0},
+  {&__pyx_kp_u_of_name, __pyx_k_of_name, sizeof(__pyx_k_of_name), 0, 1, 0, 0},
   {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
   {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1},
   {&__pyx_n_s_old_element, __pyx_k_old_element, sizeof(__pyx_k_old_element), 0, 0, 1, 1},
@@ -245754,36 +245885,36 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
   __pyx_builtin_SyntaxError = __Pyx_GetBuiltinName(__pyx_n_s_SyntaxError); if (!__pyx_builtin_SyntaxError) __PYX_ERR(0, 215, __pyx_L1_error)
   __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(1, 808, __pyx_L1_error)
   __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(2, 18, __pyx_L1_error)
-  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(3, 437, __pyx_L1_error)
+  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(3, 3, __pyx_L1_error)
+  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(4, 437, __pyx_L1_error)
   __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 97, __pyx_L1_error)
   __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 183, __pyx_L1_error)
   __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 205, __pyx_L1_error)
   __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(0, 298, __pyx_L1_error)
-  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 238, __pyx_L1_error)
-  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(5, 19, __pyx_L1_error)
-  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(5, 41, __pyx_L1_error)
-  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(5, 408, __pyx_L1_error)
+  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(5, 238, __pyx_L1_error)
+  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(6, 19, __pyx_L1_error)
+  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(6, 41, __pyx_L1_error)
+  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(6, 408, __pyx_L1_error)
   #if PY_MAJOR_VERSION >= 3
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(5, 1041, __pyx_L1_error)
+  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) __PYX_ERR(6, 1041, __pyx_L1_error)
   #else
-  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(5, 1041, __pyx_L1_error)
+  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) __PYX_ERR(6, 1041, __pyx_L1_error)
   #endif
-  __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) __PYX_ERR(5, 1598, __pyx_L1_error)
-  __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(5, 1616, __pyx_L1_error)
+  __pyx_builtin_UnicodeEncodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeEncodeError); if (!__pyx_builtin_UnicodeEncodeError) __PYX_ERR(6, 1598, __pyx_L1_error)
+  __pyx_builtin_UnicodeDecodeError = __Pyx_GetBuiltinName(__pyx_n_s_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) __PYX_ERR(6, 1616, __pyx_L1_error)
   __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 315, __pyx_L1_error)
   __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 747, __pyx_L1_error)
   __pyx_builtin_FutureWarning = __Pyx_GetBuiltinName(__pyx_n_s_FutureWarning); if (!__pyx_builtin_FutureWarning) __PYX_ERR(0, 1178, __pyx_L1_error)
   __pyx_builtin_NotImplemented = __Pyx_GetBuiltinName(__pyx_n_s_NotImplemented); if (!__pyx_builtin_NotImplemented) __PYX_ERR(0, 1850, __pyx_L1_error)
   __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) __PYX_ERR(0, 2054, __pyx_L1_error)
   __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 2570, __pyx_L1_error)
-  __pyx_builtin_ReferenceError = __Pyx_GetBuiltinName(__pyx_n_s_ReferenceError); if (!__pyx_builtin_ReferenceError) __PYX_ERR(6, 18, __pyx_L1_error)
-  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(7, 52, __pyx_L1_error)
+  __pyx_builtin_ReferenceError = __Pyx_GetBuiltinName(__pyx_n_s_ReferenceError); if (!__pyx_builtin_ReferenceError) __PYX_ERR(7, 18, __pyx_L1_error)
+  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(8, 52, __pyx_L1_error)
   __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_n_s_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(2, 652, __pyx_L1_error)
   __pyx_builtin_LookupError = __Pyx_GetBuiltinName(__pyx_n_s_LookupError); if (!__pyx_builtin_LookupError) __PYX_ERR(2, 837, __pyx_L1_error)
-  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(8, 531, __pyx_L1_error)
-  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(9, 1151, __pyx_L1_error)
+  __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(3, 540, __pyx_L1_error)
+  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s_sorted); if (!__pyx_builtin_sorted) __PYX_ERR(9, 1156, __pyx_L1_error)
   __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(10, 632, __pyx_L1_error)
-  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 3633, __pyx_L1_error)
   return 0;
   __pyx_L1_error:;
   return -1;
@@ -245869,7 +246000,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     if c_doc.type not in (tree.XML_DOCUMENT_NODE, tree.XML_HTML_DOCUMENT_NODE):
  *         doc_type = c_doc.type
  */
-  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Illegal_document_provided_NULL); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(4, 600, __pyx_L1_error)
+  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_Illegal_document_provided_NULL); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(5, 600, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__10);
   __Pyx_GIVEREF(__pyx_tuple__10);
 
@@ -245880,7 +246011,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     # store possible text node
  *     c_next = c_node.next
  */
-  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_parent_to_itself); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(5, 1341, __pyx_L1_error)
+  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_cannot_append_parent_to_itself); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(6, 1341, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__13);
   __Pyx_GIVEREF(__pyx_tuple__13);
 
@@ -245891,7 +246022,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     # store possible text node
  *     c_next = c_node.next
  */
-  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_cannot_add_ancestor_as_sibling_p); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(5, 1395, __pyx_L1_error)
+  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_cannot_add_ancestor_as_sibling_p); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(6, 1395, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__14);
   __Pyx_GIVEREF(__pyx_tuple__14);
 
@@ -245902,7 +246033,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *             "All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters")
  *     return utf8_string
  */
-  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_All_strings_must_be_XML_compatib); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(5, 1540, __pyx_L1_error)
+  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_All_strings_must_be_XML_compatib); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(6, 1540, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__15);
   __Pyx_GIVEREF(__pyx_tuple__15);
 
@@ -245913,7 +246044,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  * 
  * cdef object _decodeFilename(const_xmlChar* c_path):
  */
-  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_string_or_unico); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(5, 1602, __pyx_L1_error)
+  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Argument_must_be_string_or_unico); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(6, 1602, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__16);
   __Pyx_GIVEREF(__pyx_tuple__16);
 
@@ -246078,7 +246209,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         return 0
  * 
  */
-  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Proxy_invalidated); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(6, 18, __pyx_L1_error)
+  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Proxy_invalidated); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(7, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__53);
   __Pyx_GIVEREF(__pyx_tuple__53);
 
@@ -246089,7 +246220,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         return iter(children)
  * 
  */
-  __pyx_slice__54 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__54)) __PYX_ERR(6, 196, __pyx_L1_error)
+  __pyx_slice__54 = PySlice_New(Py_None, Py_None, __pyx_int_neg_1); if (unlikely(!__pyx_slice__54)) __PYX_ERR(7, 196, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__54);
   __Pyx_GIVEREF(__pyx_slice__54);
 
@@ -246115,14 +246246,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__58);
   __Pyx_GIVEREF(__pyx_tuple__58);
 
-  /* "src/lxml/saxparser.pxi":535
+  /* "src/lxml/saxparser.pxi":544
  *             context._target._handleSaxEndNs(prefix_uri[0])
  *         if build_events:
  *             context.events_iterator._events.append(('end-ns', None))             # <<<<<<<<<<<<<<
  * 
  *     return 0
  */
-  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_kp_s_end_ns, Py_None); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(8, 535, __pyx_L1_error)
+  __pyx_tuple__59 = PyTuple_Pack(2, __pyx_kp_s_end_ns, Py_None); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(3, 544, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__59);
   __Pyx_GIVEREF(__pyx_tuple__59);
 
@@ -246184,47 +246315,47 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__69);
   __Pyx_GIVEREF(__pyx_tuple__69);
 
-  /* "src/lxml/serializer.pxi":1356
+  /* "src/lxml/serializer.pxi":1361
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  *             raise TypeError("Cannot asynchronously write to a plain file")             # <<<<<<<<<<<<<<
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")
  */
-  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Cannot_asynchronously_write_to_a); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(9, 1356, __pyx_L1_error)
+  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_Cannot_asynchronously_write_to_a); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(9, 1361, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__79);
   __Pyx_GIVEREF(__pyx_tuple__79);
 
-  /* "src/lxml/serializer.pxi":1358
+  /* "src/lxml/serializer.pxi":1363
  *             raise TypeError("Cannot asynchronously write to a plain file")
  *         if not hasattr(self.output_file, 'write'):
  *             raise TypeError("Output file needs an async .write() method")             # <<<<<<<<<<<<<<
  *         self.async_writer = _AsyncIncrementalFileWriter(
  *             self.output_file, self.encoding, self.compresslevel,
  */
-  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Output_file_needs_an_async_write); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(9, 1358, __pyx_L1_error)
+  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_Output_file_needs_an_async_write); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(9, 1363, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__80);
   __Pyx_GIVEREF(__pyx_tuple__80);
 
-  /* "src/lxml/serializer.pxi":1559
+  /* "src/lxml/serializer.pxi":1564
  *         if self._status != WRITER_IN_ELEMENT:
  *             raise LxmlSyntaxError("not in an element")
  *         if not self._element_stack or self._element_stack[-1][:2] != element_config[:2]:             # <<<<<<<<<<<<<<
  *             raise LxmlSyntaxError("inconsistent exit action in context manager")
  * 
  */
-  __pyx_slice__82 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__82)) __PYX_ERR(9, 1559, __pyx_L1_error)
+  __pyx_slice__82 = PySlice_New(Py_None, __pyx_int_2, Py_None); if (unlikely(!__pyx_slice__82)) __PYX_ERR(9, 1564, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__82);
   __Pyx_GIVEREF(__pyx_slice__82);
 
-  /* "src/lxml/serializer.pxi":1567
+  /* "src/lxml/serializer.pxi":1572
  *         ok_to_write = self._c_out.error == xmlerror.XML_ERR_OK
  * 
  *         name, prefix = self._element_stack.pop()[1:3]             # <<<<<<<<<<<<<<
  *         if ok_to_write:
  *             tree.xmlOutputBufferWrite(self._c_out, 2, '</')
  */
-  __pyx_slice__83 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__83)) __PYX_ERR(9, 1567, __pyx_L1_error)
+  __pyx_slice__83 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_slice__83)) __PYX_ERR(9, 1572, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_slice__83);
   __Pyx_GIVEREF(__pyx_slice__83);
 
@@ -246301,7 +246432,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         xslt.xsltMaxDepth = max_depth
  * 
  */
-  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_cannot_set_a_maximum_stylesheet); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(3, 468, __pyx_L1_error)
+  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_cannot_set_a_maximum_stylesheet); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(4, 468, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__101);
   __Pyx_GIVEREF(__pyx_tuple__101);
 
@@ -246312,7 +246443,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *             u"//xsl:stylesheet[@xml:id = $id]",
  *             namespaces={u"xsl" : u"http://www.w3.org/1999/XSL/Transform"})
  */
-  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_u_xsl_stylesheet_xml_id_id); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(3, 889, __pyx_L1_error)
+  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_u_xsl_stylesheet_xml_id_id); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(4, 889, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__102);
   __Pyx_GIVEREF(__pyx_tuple__102);
 
@@ -247977,10 +248108,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_tuple__379 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __pyx_tuple__379 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__379)) __PYX_ERR(7, 160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__379);
   __Pyx_GIVEREF(__pyx_tuple__379);
-  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_deepcopy, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __pyx_codeobj__380 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__379, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_deepcopy, 160, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__380)) __PYX_ERR(7, 160, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":164
  *         return self.__copy__()
@@ -247989,10 +248120,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_tuple__381 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_tuple__381 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(7, 164, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__381);
   __Pyx_GIVEREF(__pyx_tuple__381);
-  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_copy_2, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_copy_2, 164, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(7, 164, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":187
  *         return iter(self.getchildren())
@@ -248001,10 +248132,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""iterchildren(self, tag=None, reversed=False)
  * 
  */
-  __pyx_tuple__383 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_children, __pyx_n_s_el); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __pyx_tuple__383 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_reversed, __pyx_n_s_children, __pyx_n_s_el); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(7, 187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__383);
   __Pyx_GIVEREF(__pyx_tuple__383);
-  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_iterchildren, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(2, 1, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_iterchildren, 187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(7, 187, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":199
  *         return iter(children)
@@ -248013,10 +248144,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Returns all subelements. The elements are returned in document
  *         order.
  */
-  __pyx_tuple__385 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_tuple__385 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(7, 199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__385);
   __Pyx_GIVEREF(__pyx_tuple__385);
-  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getchildren, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getchildren, 199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(7, 199, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":214
  *         return result
@@ -248025,10 +248156,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the parent of this element or None for the root element.
  *         """
  */
-  __pyx_tuple__387 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_parent); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __pyx_tuple__387 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_parent); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(7, 214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__387);
   __Pyx_GIVEREF(__pyx_tuple__387);
-  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getparent, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getparent, 214, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(7, 214, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":225
  *             return _newReadOnlyProxy(self._source_proxy, c_parent)
@@ -248037,10 +248168,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the following sibling of this element or None.
  *         """
  */
-  __pyx_tuple__389 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __pyx_tuple__389 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(7, 225, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__389);
   __Pyx_GIVEREF(__pyx_tuple__389);
-  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getnext, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getnext, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(7, 225, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":235
  *         return None
@@ -248049,10 +248180,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Returns the preceding sibling of this element or None.
  *         """
  */
-  __pyx_tuple__391 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __pyx_tuple__391 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_c_node); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(7, 235, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__391);
   __Pyx_GIVEREF(__pyx_tuple__391);
-  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getprevious, 235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_getprevious, 235, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(7, 235, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":304
  *         return _build_nsmap(self._c_node)
@@ -248061,10 +248192,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Gets an element attribute.
  *         """
  */
-  __pyx_tuple__393 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(6, 304, __pyx_L1_error)
+  __pyx_tuple__393 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_default); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(7, 304, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__393);
   __Pyx_GIVEREF(__pyx_tuple__393);
-  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_get, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(6, 304, __pyx_L1_error)
+  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_get, 304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(7, 304, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":310
  *         return _getNodeAttributeValue(self._c_node, key, default)
@@ -248073,10 +248204,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Gets a list of attribute names. The names are returned in an
  *         arbitrary order (just like for an ordinary Python dictionary).
  */
-  __pyx_tuple__395 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(6, 310, __pyx_L1_error)
+  __pyx_tuple__395 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(7, 310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__395);
   __Pyx_GIVEREF(__pyx_tuple__395);
-  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_keys, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(6, 310, __pyx_L1_error)
+  __pyx_codeobj__396 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__395, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_keys, 310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__396)) __PYX_ERR(7, 310, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":317
  *         return _collectAttributes(self._c_node, 1)
@@ -248085,10 +248216,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_tuple__397 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(6, 317, __pyx_L1_error)
+  __pyx_tuple__397 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__397)) __PYX_ERR(7, 317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__397);
   __Pyx_GIVEREF(__pyx_tuple__397);
-  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_values, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(6, 317, __pyx_L1_error)
+  __pyx_codeobj__398 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__397, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_values, 317, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__398)) __PYX_ERR(7, 317, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":324
  *         return _collectAttributes(self._c_node, 2)
@@ -248097,10 +248228,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_tuple__399 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(6, 324, __pyx_L1_error)
+  __pyx_tuple__399 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__399)) __PYX_ERR(7, 324, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__399);
   __Pyx_GIVEREF(__pyx_tuple__399);
-  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_items, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(6, 324, __pyx_L1_error)
+  __pyx_codeobj__400 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__399, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_items, 324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__400)) __PYX_ERR(7, 324, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":390
  *         return 0
@@ -248109,10 +248240,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_tuple__401 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(6, 390, __pyx_L1_error)
+  __pyx_tuple__401 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__401)) __PYX_ERR(7, 390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__401);
   __Pyx_GIVEREF(__pyx_tuple__401);
-  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(6, 390, __pyx_L1_error)
+  __pyx_codeobj__402 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__401, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 390, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__402)) __PYX_ERR(7, 390, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":407
  *         _moveTail(c_next, c_node)
@@ -248121,10 +248252,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_tuple__403 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(6, 407, __pyx_L1_error)
+  __pyx_tuple__403 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(7, 407, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__403);
   __Pyx_GIVEREF(__pyx_tuple__403);
-  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(6, 407, __pyx_L1_error)
+  __pyx_codeobj__404 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__403, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 407, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__404)) __PYX_ERR(7, 407, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":487
  *     text content (i.e. everything that adds to the subtree).
@@ -248133,10 +248264,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_tuple__405 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(6, 487, __pyx_L1_error)
+  __pyx_tuple__405 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other_element); if (unlikely(!__pyx_tuple__405)) __PYX_ERR(7, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__405);
   __Pyx_GIVEREF(__pyx_tuple__405);
-  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(6, 487, __pyx_L1_error)
+  __pyx_codeobj__406 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__405, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_append, 487, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__406)) __PYX_ERR(7, 487, __pyx_L1_error)
 
   /* "src/lxml/readonlytree.pxi":499
  *         _moveTail(c_next, c_node)
@@ -248145,10 +248276,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_tuple__407 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(6, 499, __pyx_L1_error)
+  __pyx_tuple__407 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_elements, __pyx_n_s_element); if (unlikely(!__pyx_tuple__407)) __PYX_ERR(7, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__407);
   __Pyx_GIVEREF(__pyx_tuple__407);
-  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(6, 499, __pyx_L1_error)
+  __pyx_codeobj__408 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__407, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_readonlytree_pxi, __pyx_n_s_extend, 499, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__408)) __PYX_ERR(7, 499, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":248
  *             self._fallback_function = _lookupDefaultElementClass
@@ -248157,10 +248288,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""set_fallback(self, lookup)
  * 
  */
-  __pyx_tuple__409 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(7, 248, __pyx_L1_error)
+  __pyx_tuple__409 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__409)) __PYX_ERR(8, 248, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__409);
   __Pyx_GIVEREF(__pyx_tuple__409);
-  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_fallback, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(7, 248, __pyx_L1_error)
+  __pyx_codeobj__410 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__409, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_fallback, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__410)) __PYX_ERR(8, 248, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":430
  *         self._lookup_function = _custom_class_lookup
@@ -248169,10 +248300,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"lookup(self, type, doc, namespace, name)"
  *         return None
  */
-  __pyx_tuple__411 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_doc_2, __pyx_n_s_namespace, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(7, 430, __pyx_L1_error)
+  __pyx_tuple__411 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_type, __pyx_n_s_doc_2, __pyx_n_s_namespace, __pyx_n_s_name_2); if (unlikely(!__pyx_tuple__411)) __PYX_ERR(8, 430, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__411);
   __Pyx_GIVEREF(__pyx_tuple__411);
-  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(7, 430, __pyx_L1_error)
+  __pyx_codeobj__412 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__411, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 430, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__412)) __PYX_ERR(8, 430, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":512
  *         self._lookup_function = _python_class_lookup
@@ -248181,10 +248312,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""lookup(self, doc, element)
  * 
  */
-  __pyx_tuple__413 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(7, 512, __pyx_L1_error)
+  __pyx_tuple__413 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doc_2, __pyx_n_s_element); if (unlikely(!__pyx_tuple__413)) __PYX_ERR(8, 512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__413);
   __Pyx_GIVEREF(__pyx_tuple__413);
-  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) __PYX_ERR(7, 512, __pyx_L1_error)
+  __pyx_codeobj__414 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__413, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_lookup, 512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__414)) __PYX_ERR(8, 512, __pyx_L1_error)
 
   /* "src/lxml/classlookup.pxi":549
  *     LOOKUP_ELEMENT_CLASS = function
@@ -248193,11 +248324,11 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *     u"""set_element_class_lookup(lookup = None)
  * 
  */
-  __pyx_tuple__415 = PyTuple_Pack(1, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(7, 549, __pyx_L1_error)
+  __pyx_tuple__415 = PyTuple_Pack(1, __pyx_n_s_lookup); if (unlikely(!__pyx_tuple__415)) __PYX_ERR(8, 549, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__415);
   __Pyx_GIVEREF(__pyx_tuple__415);
-  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_element_class_lookup, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(7, 549, __pyx_L1_error)
-  __pyx_tuple__417 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(7, 549, __pyx_L1_error)
+  __pyx_codeobj__416 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__415, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_classlookup_pxi, __pyx_n_s_set_element_class_lookup, 549, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__416)) __PYX_ERR(8, 549, __pyx_L1_error)
+  __pyx_tuple__417 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__417)) __PYX_ERR(8, 549, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__417);
   __Pyx_GIVEREF(__pyx_tuple__417);
 
@@ -248552,77 +248683,77 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_GIVEREF(__pyx_tuple__475);
   __pyx_codeobj__476 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__475, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_parser_pxi, __pyx_n_s_read_events, 1743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__476)) __PYX_ERR(2, 1743, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":804
+  /* "src/lxml/saxparser.pxi":813
  *     # Python level event handlers
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         u"""close(self)
  * 
  */
-  __pyx_tuple__477 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(8, 804, __pyx_L1_error)
+  __pyx_tuple__477 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__477)) __PYX_ERR(3, 813, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__477);
   __Pyx_GIVEREF(__pyx_tuple__477);
-  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_close, 804, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(8, 804, __pyx_L1_error)
+  __pyx_codeobj__478 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__477, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_close, 813, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__478)) __PYX_ERR(3, 813, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":814
+  /* "src/lxml/saxparser.pxi":826
  *         return self._last
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         u"""data(self, data)
  * 
  */
-  __pyx_tuple__479 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(8, 814, __pyx_L1_error)
+  __pyx_tuple__479 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__479)) __PYX_ERR(3, 826, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__479);
   __Pyx_GIVEREF(__pyx_tuple__479);
-  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_data, 814, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) __PYX_ERR(8, 814, __pyx_L1_error)
+  __pyx_codeobj__480 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__479, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_data, 826, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__480)) __PYX_ERR(3, 826, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":822
+  /* "src/lxml/saxparser.pxi":834
  *         self._handleSaxData(data)
  * 
  *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<<
  *         u"""start(self, tag, attrs, nsmap=None)
  * 
  */
-  __pyx_tuple__481 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_nsmap); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(8, 822, __pyx_L1_error)
+  __pyx_tuple__481 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_nsmap); if (unlikely(!__pyx_tuple__481)) __PYX_ERR(3, 834, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__481);
   __Pyx_GIVEREF(__pyx_tuple__481);
-  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_start, 822, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(8, 822, __pyx_L1_error)
+  __pyx_codeobj__482 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__481, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_start, 834, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__482)) __PYX_ERR(3, 834, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":831
+  /* "src/lxml/saxparser.pxi":843
  *         return self._handleSaxStart(tag, attrs, nsmap)
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
  *         u"""end(self, tag)
  * 
  */
-  __pyx_tuple__483 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_element); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(8, 831, __pyx_L1_error)
+  __pyx_tuple__483 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_element); if (unlikely(!__pyx_tuple__483)) __PYX_ERR(3, 843, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__483);
   __Pyx_GIVEREF(__pyx_tuple__483);
-  __pyx_codeobj__484 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_end, 831, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__484)) __PYX_ERR(8, 831, __pyx_L1_error)
+  __pyx_codeobj__484 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__483, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_end, 843, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__484)) __PYX_ERR(3, 843, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":841
+  /* "src/lxml/saxparser.pxi":853
  *         return element
  * 
  *     def pi(self, target, data=None):             # <<<<<<<<<<<<<<
  *         u"""pi(self, target, data=None)
  * 
  */
-  __pyx_tuple__485 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(8, 841, __pyx_L1_error)
+  __pyx_tuple__485 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__485)) __PYX_ERR(3, 853, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__485);
   __Pyx_GIVEREF(__pyx_tuple__485);
-  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_pi, 841, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) __PYX_ERR(8, 841, __pyx_L1_error)
+  __pyx_codeobj__486 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__485, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_pi, 853, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__486)) __PYX_ERR(3, 853, __pyx_L1_error)
 
-  /* "src/lxml/saxparser.pxi":849
+  /* "src/lxml/saxparser.pxi":861
  *         return self._handleSaxPi(target, data)
  * 
  *     def comment(self, comment):             # <<<<<<<<<<<<<<
  *         u"""comment(self, comment)
  * 
  */
-  __pyx_tuple__487 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(8, 849, __pyx_L1_error)
+  __pyx_tuple__487 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_comment); if (unlikely(!__pyx_tuple__487)) __PYX_ERR(3, 861, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__487);
   __Pyx_GIVEREF(__pyx_tuple__487);
-  __pyx_codeobj__488 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_comment, 849, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__488)) __PYX_ERR(8, 849, __pyx_L1_error)
+  __pyx_codeobj__488 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__487, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_saxparser_pxi, __pyx_n_s_comment, 861, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__488)) __PYX_ERR(3, 861, __pyx_L1_error)
 
   /* "src/lxml/parsertarget.pxi":14
  *     # to push the Python level parser result through the parser
@@ -248689,413 +248820,413 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_GIVEREF(__pyx_tuple__497);
   __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__497, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_iter_namespaces, 1039, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__66)) __PYX_ERR(9, 1039, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1083
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')
+  /* "src/lxml/serializer.pxi":1088
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         if not self._ignored_depth:
  *             self._data.append(data)
  */
-  __pyx_tuple__498 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(9, 1083, __pyx_L1_error)
+  __pyx_tuple__498 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__498)) __PYX_ERR(9, 1088, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__498);
   __Pyx_GIVEREF(__pyx_tuple__498);
-  __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_data, 1083, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) __PYX_ERR(9, 1083, __pyx_L1_error)
+  __pyx_codeobj__499 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__498, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_data, 1088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__499)) __PYX_ERR(9, 1088, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1101
+  /* "src/lxml/serializer.pxi":1106
  *             self._write(_escape_cdata_c14n(data))
  * 
  *     def start_ns(self, prefix, uri):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             return
  */
-  __pyx_tuple__500 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(9, 1101, __pyx_L1_error)
+  __pyx_tuple__500 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_prefix, __pyx_n_s_uri); if (unlikely(!__pyx_tuple__500)) __PYX_ERR(9, 1106, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__500);
   __Pyx_GIVEREF(__pyx_tuple__500);
-  __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_start_ns_2, 1101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) __PYX_ERR(9, 1101, __pyx_L1_error)
+  __pyx_codeobj__501 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__500, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_start_ns_2, 1106, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__501)) __PYX_ERR(9, 1106, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1109
+  /* "src/lxml/serializer.pxi":1114
  *         self._ns_stack[-1].append((uri, prefix))
  * 
  *     def start(self, tag, attrs):             # <<<<<<<<<<<<<<
  *         if self._exclude_tags is not None and (
  *                 self._ignored_depth or tag in self._exclude_tags):
  */
-  __pyx_tuple__502 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_new_namespaces); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(9, 1109, __pyx_L1_error)
+  __pyx_tuple__502 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrs, __pyx_n_s_new_namespaces); if (unlikely(!__pyx_tuple__502)) __PYX_ERR(9, 1114, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__502);
   __Pyx_GIVEREF(__pyx_tuple__502);
-  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_start, 1109, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) __PYX_ERR(9, 1109, __pyx_L1_error)
+  __pyx_codeobj__503 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__502, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_start, 1114, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__503)) __PYX_ERR(9, 1114, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1194
+  /* "src/lxml/serializer.pxi":1199
  *         self._ns_stack.append([])
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             self._ignored_depth -= 1
  */
-  __pyx_tuple__504 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tag); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(9, 1194, __pyx_L1_error)
+  __pyx_tuple__504 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_tag); if (unlikely(!__pyx_tuple__504)) __PYX_ERR(9, 1199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__504);
   __Pyx_GIVEREF(__pyx_tuple__504);
-  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_end, 1194, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) __PYX_ERR(9, 1194, __pyx_L1_error)
+  __pyx_codeobj__505 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__504, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_end, 1199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__505)) __PYX_ERR(9, 1199, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1206
+  /* "src/lxml/serializer.pxi":1211
  *         self._ns_stack.pop()
  * 
  *     def comment(self, text):             # <<<<<<<<<<<<<<
  *         if not self._with_comments:
  *             return
  */
-  __pyx_tuple__506 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_text); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(9, 1206, __pyx_L1_error)
+  __pyx_tuple__506 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_text); if (unlikely(!__pyx_tuple__506)) __PYX_ERR(9, 1211, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__506);
   __Pyx_GIVEREF(__pyx_tuple__506);
-  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_comment, 1206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) __PYX_ERR(9, 1206, __pyx_L1_error)
+  __pyx_codeobj__507 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__506, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_comment, 1211, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__507)) __PYX_ERR(9, 1211, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1219
+  /* "src/lxml/serializer.pxi":1224
  *             self._write(u'\n')
  * 
  *     def pi(self, target, data):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             return
  */
-  __pyx_tuple__508 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(9, 1219, __pyx_L1_error)
+  __pyx_tuple__508 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_target, __pyx_n_s_data); if (unlikely(!__pyx_tuple__508)) __PYX_ERR(9, 1224, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__508);
   __Pyx_GIVEREF(__pyx_tuple__508);
-  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_pi, 1219, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) __PYX_ERR(9, 1219, __pyx_L1_error)
+  __pyx_codeobj__509 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__508, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_pi, 1224, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__509)) __PYX_ERR(9, 1224, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1231
+  /* "src/lxml/serializer.pxi":1236
  *             self._write(u'\n')
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         return None
  * 
  */
-  __pyx_tuple__510 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(9, 1231, __pyx_L1_error)
+  __pyx_tuple__510 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__510)) __PYX_ERR(9, 1236, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__510);
   __Pyx_GIVEREF(__pyx_tuple__510);
-  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) __PYX_ERR(9, 1231, __pyx_L1_error)
+  __pyx_codeobj__511 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__510, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__511)) __PYX_ERR(9, 1236, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1338
+  /* "src/lxml/serializer.pxi":1343
  *         self.method = OUTPUT_METHOD_XML
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(
  */
-  __pyx_tuple__512 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(9, 1338, __pyx_L1_error)
+  __pyx_tuple__512 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__512)) __PYX_ERR(9, 1343, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__512);
   __Pyx_GIVEREF(__pyx_tuple__512);
-  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1338, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) __PYX_ERR(9, 1338, __pyx_L1_error)
+  __pyx_codeobj__513 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__512, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__513)) __PYX_ERR(9, 1343, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1345
+  /* "src/lxml/serializer.pxi":1350
  *         return self.writer
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None
  */
-  __pyx_tuple__514 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(9, 1345, __pyx_L1_error)
+  __pyx_tuple__514 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__514)) __PYX_ERR(9, 1350, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__514);
   __Pyx_GIVEREF(__pyx_tuple__514);
-  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1345, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(9, 1345, __pyx_L1_error)
+  __pyx_codeobj__515 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__514, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__515)) __PYX_ERR(9, 1350, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1353
+  /* "src/lxml/serializer.pxi":1358
  *                 self.output_file = None
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  */
-  __pyx_tuple__516 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(9, 1353, __pyx_L1_error)
+  __pyx_tuple__516 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__516)) __PYX_ERR(9, 1358, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__516);
   __Pyx_GIVEREF(__pyx_tuple__516);
-  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(9, 1353, __pyx_L1_error)
+  __pyx_codeobj__78 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__516, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1358, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__78)) __PYX_ERR(9, 1358, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1364
+  /* "src/lxml/serializer.pxi":1369
  *         return self.async_writer
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None
  */
-  __pyx_tuple__517 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(9, 1364, __pyx_L1_error)
+  __pyx_tuple__517 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb, __pyx_n_s_old_writer, __pyx_n_s_raise_on_error); if (unlikely(!__pyx_tuple__517)) __PYX_ERR(9, 1369, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__517);
   __Pyx_GIVEREF(__pyx_tuple__517);
-  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1364, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(9, 1364, __pyx_L1_error)
+  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__517, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1369, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(9, 1369, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1421
+  /* "src/lxml/serializer.pxi":1426
  *             tree.xmlOutputBufferClose(self._c_out)
  * 
  *     def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
  *         """write_declaration(self, version=None, standalone=None, doctype=None)
  * 
  */
-  __pyx_tuple__518 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_c_version, __pyx_n_s_c_standalone); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(9, 1421, __pyx_L1_error)
+  __pyx_tuple__518 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_c_version, __pyx_n_s_c_standalone); if (unlikely(!__pyx_tuple__518)) __PYX_ERR(9, 1426, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__518);
   __Pyx_GIVEREF(__pyx_tuple__518);
-  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) __PYX_ERR(9, 1421, __pyx_L1_error)
+  __pyx_codeobj__519 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__518, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1426, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__519)) __PYX_ERR(9, 1426, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1450
+  /* "src/lxml/serializer.pxi":1455
  *         self._handle_error(self._c_out.error)
  * 
  *     def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
  *         """write_doctype(self, doctype)
  * 
  */
-  __pyx_tuple__520 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(9, 1450, __pyx_L1_error)
+  __pyx_tuple__520 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_doctype); if (unlikely(!__pyx_tuple__520)) __PYX_ERR(9, 1455, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__520);
   __Pyx_GIVEREF(__pyx_tuple__520);
-  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) __PYX_ERR(9, 1450, __pyx_L1_error)
+  __pyx_codeobj__521 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__520, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__521)) __PYX_ERR(9, 1455, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1467
+  /* "src/lxml/serializer.pxi":1472
  *         self._handle_error(self._c_out.error)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
  *         """method(self, method)
  * 
  */
-  __pyx_tuple__522 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(9, 1467, __pyx_L1_error)
+  __pyx_tuple__522 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__522)) __PYX_ERR(9, 1472, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__522);
   __Pyx_GIVEREF(__pyx_tuple__522);
-  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) __PYX_ERR(9, 1467, __pyx_L1_error)
+  __pyx_codeobj__523 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__522, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1472, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__523)) __PYX_ERR(9, 1472, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1477
+  /* "src/lxml/serializer.pxi":1482
  *         return _MethodChanger(self, c_method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
  *         """element(self, tag, attrib=None, nsmap=None, method, **_extra)
  * 
  */
-  __pyx_tuple__524 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_attributes, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_ns, __pyx_n_s_reversed_nsmap, __pyx_n_s_prefix, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(9, 1477, __pyx_L1_error)
+  __pyx_tuple__524 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_attributes, __pyx_n_s_name_2, __pyx_n_s_value, __pyx_n_s_ns, __pyx_n_s_reversed_nsmap, __pyx_n_s_prefix, __pyx_n_s_c_method); if (unlikely(!__pyx_tuple__524)) __PYX_ERR(9, 1482, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__524);
   __Pyx_GIVEREF(__pyx_tuple__524);
-  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) __PYX_ERR(9, 1477, __pyx_L1_error)
+  __pyx_codeobj__525 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__524, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1482, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__525)) __PYX_ERR(9, 1482, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1614
+  /* "src/lxml/serializer.pxi":1619
  *         return flat_namespaces_map, new_namespaces
  * 
  *     def write(self, *args, bint with_tail=True, bint pretty_print=False, method=None):             # <<<<<<<<<<<<<<
  *         """write(self, *args, with_tail=True, pretty_print=False, method=None)
  * 
  */
-  __pyx_tuple__526 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_c_method, __pyx_n_s_content, __pyx_n_s_bstring, __pyx_n_s_ns, __pyx_n_s_name_2, __pyx_n_s__55); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(9, 1614, __pyx_L1_error)
+  __pyx_tuple__526 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_c_method, __pyx_n_s_content, __pyx_n_s_bstring, __pyx_n_s_ns, __pyx_n_s_name_2, __pyx_n_s__55); if (unlikely(!__pyx_tuple__526)) __PYX_ERR(9, 1619, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__526);
   __Pyx_GIVEREF(__pyx_tuple__526);
-  __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(1, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1614, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) __PYX_ERR(9, 1614, __pyx_L1_error)
+  __pyx_codeobj__527 = (PyObject*)__Pyx_PyCode_New(1, 3, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__526, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__527)) __PYX_ERR(9, 1619, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1661
+  /* "src/lxml/serializer.pxi":1666
  *             self._handle_error(self._c_out.error)
  * 
  *     def flush(self):             # <<<<<<<<<<<<<<
  *         """flush(self)
  * 
  */
-  __pyx_tuple__528 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(9, 1661, __pyx_L1_error)
+  __pyx_tuple__528 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__528)) __PYX_ERR(9, 1666, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__528);
   __Pyx_GIVEREF(__pyx_tuple__528);
-  __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1661, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) __PYX_ERR(9, 1661, __pyx_L1_error)
+  __pyx_codeobj__529 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__528, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__529)) __PYX_ERR(9, 1666, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1708
+  /* "src/lxml/serializer.pxi":1713
  *         return data
  * 
  *     def write(self, data):             # <<<<<<<<<<<<<<
  *         self._data.append(data)
  * 
  */
-  __pyx_tuple__530 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(9, 1708, __pyx_L1_error)
+  __pyx_tuple__530 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__530)) __PYX_ERR(9, 1713, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__530);
   __Pyx_GIVEREF(__pyx_tuple__530);
-  __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1708, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) __PYX_ERR(9, 1708, __pyx_L1_error)
+  __pyx_codeobj__531 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__530, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1713, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__531)) __PYX_ERR(9, 1713, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1711
+  /* "src/lxml/serializer.pxi":1716
  *         self._data.append(data)
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         pass
  * 
  */
-  __pyx_tuple__532 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(9, 1711, __pyx_L1_error)
+  __pyx_tuple__532 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__532)) __PYX_ERR(9, 1716, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__532);
   __Pyx_GIVEREF(__pyx_tuple__532);
-  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1711, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) __PYX_ERR(9, 1711, __pyx_L1_error)
+  __pyx_codeobj__533 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__532, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close, 1716, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__533)) __PYX_ERR(9, 1716, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1740
+  /* "src/lxml/serializer.pxi":1745
  *         return None
  * 
  *     async def flush(self):             # <<<<<<<<<<<<<<
  *         self._writer.flush()
  *         data = self._buffer.collect()
  */
-  __pyx_tuple__534 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(9, 1740, __pyx_L1_error)
+  __pyx_tuple__534 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__534)) __PYX_ERR(9, 1745, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__534);
   __Pyx_GIVEREF(__pyx_tuple__534);
-  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1740, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(9, 1740, __pyx_L1_error)
+  __pyx_codeobj__84 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__534, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_flush, 1745, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__84)) __PYX_ERR(9, 1745, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1746
+  /* "src/lxml/serializer.pxi":1751
  *             await self._async_outfile.write(data)
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  */
-  __pyx_tuple__535 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(9, 1746, __pyx_L1_error)
+  __pyx_tuple__535 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_version, __pyx_n_s_standalone, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__535)) __PYX_ERR(9, 1751, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__535);
   __Pyx_GIVEREF(__pyx_tuple__535);
-  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__535, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1746, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(9, 1746, __pyx_L1_error)
+  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__535, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_declaration, 1751, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(9, 1751, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1752
+  /* "src/lxml/serializer.pxi":1757
  *             await self._async_outfile.write(data)
  * 
  *     async def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  */
-  __pyx_tuple__536 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(9, 1752, __pyx_L1_error)
+  __pyx_tuple__536 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_doctype, __pyx_n_s_data); if (unlikely(!__pyx_tuple__536)) __PYX_ERR(9, 1757, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__536);
   __Pyx_GIVEREF(__pyx_tuple__536);
-  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(9, 1752, __pyx_L1_error)
+  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__536, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write_doctype, 1757, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) __PYX_ERR(9, 1757, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1758
+  /* "src/lxml/serializer.pxi":1763
  *             await self._async_outfile.write(data)
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):             # <<<<<<<<<<<<<<
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  */
-  __pyx_tuple__537 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(9, 1758, __pyx_L1_error)
+  __pyx_tuple__537 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_with_tail, __pyx_n_s_pretty_print, __pyx_n_s_method, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__537)) __PYX_ERR(9, 1763, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__537);
   __Pyx_GIVEREF(__pyx_tuple__537);
-  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 3, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__537, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(9, 1758, __pyx_L1_error)
+  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(1, 3, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__537, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_write, 1763, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(9, 1763, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1764
+  /* "src/lxml/serializer.pxi":1769
  *             await self._async_outfile.write(data)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
  *         return self._writer.method(method)
  * 
  */
-  __pyx_tuple__538 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_method); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(9, 1764, __pyx_L1_error)
+  __pyx_tuple__538 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_method); if (unlikely(!__pyx_tuple__538)) __PYX_ERR(9, 1769, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__538);
   __Pyx_GIVEREF(__pyx_tuple__538);
-  __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) __PYX_ERR(9, 1764, __pyx_L1_error)
+  __pyx_codeobj__539 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__538, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_method, 1769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__539)) __PYX_ERR(9, 1769, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1767
+  /* "src/lxml/serializer.pxi":1772
  *         return self._writer.method(method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)
  *         return _AsyncFileWriterElement(element_writer, self)
  */
-  __pyx_tuple__540 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_element_writer); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(9, 1767, __pyx_L1_error)
+  __pyx_tuple__540 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_tag, __pyx_n_s_attrib, __pyx_n_s_nsmap, __pyx_n_s_method, __pyx_n_s_extra, __pyx_n_s_element_writer); if (unlikely(!__pyx_tuple__540)) __PYX_ERR(9, 1772, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__540);
   __Pyx_GIVEREF(__pyx_tuple__540);
-  __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1767, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) __PYX_ERR(9, 1767, __pyx_L1_error)
+  __pyx_codeobj__541 = (PyObject*)__Pyx_PyCode_New(5, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__540, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_element, 1772, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__541)) __PYX_ERR(9, 1772, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1771
+  /* "src/lxml/serializer.pxi":1776
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  *     async def _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  */
-  __pyx_tuple__542 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_raise_on_error, __pyx_n_s_raise_on_error, __pyx_n_s_data); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(9, 1771, __pyx_L1_error)
+  __pyx_tuple__542 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_raise_on_error, __pyx_n_s_raise_on_error, __pyx_n_s_data); if (unlikely(!__pyx_tuple__542)) __PYX_ERR(9, 1776, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__542);
   __Pyx_GIVEREF(__pyx_tuple__542);
-  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close_2, 1771, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(9, 1771, __pyx_L1_error)
+  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__542, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_close_2, 1776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(9, 1776, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1791
+  /* "src/lxml/serializer.pxi":1796
  *         self._writer = writer
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  */
-  __pyx_tuple__543 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(9, 1791, __pyx_L1_error)
+  __pyx_tuple__543 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__543)) __PYX_ERR(9, 1796, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__543);
   __Pyx_GIVEREF(__pyx_tuple__543);
-  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__543, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1791, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(9, 1791, __pyx_L1_error)
+  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__543, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1796, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(9, 1796, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1797
+  /* "src/lxml/serializer.pxi":1802
  *             await self._writer._async_outfile.write(data)
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  */
-  __pyx_tuple__544 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(9, 1797, __pyx_L1_error)
+  __pyx_tuple__544 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_data); if (unlikely(!__pyx_tuple__544)) __PYX_ERR(9, 1802, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__544);
   __Pyx_GIVEREF(__pyx_tuple__544);
-  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1797, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(9, 1797, __pyx_L1_error)
+  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__544, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1802, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(9, 1802, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1819
+  /* "src/lxml/serializer.pxi":1824
  *         self._old_method = writer._method
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         self._writer._method = self._new_method
  *         self._writer._write_start_element(self._element)
  */
-  __pyx_tuple__545 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(9, 1819, __pyx_L1_error)
+  __pyx_tuple__545 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__545)) __PYX_ERR(9, 1824, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__545);
   __Pyx_GIVEREF(__pyx_tuple__545);
-  __pyx_codeobj__546 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1819, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__546)) __PYX_ERR(9, 1819, __pyx_L1_error)
+  __pyx_codeobj__546 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__545, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__546)) __PYX_ERR(9, 1824, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1823
+  /* "src/lxml/serializer.pxi":1828
  *         self._writer._write_start_element(self._element)
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         self._writer._write_end_element(self._element)
  *         self._writer._method = self._old_method
  */
-  __pyx_tuple__547 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(9, 1823, __pyx_L1_error)
+  __pyx_tuple__547 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__547)) __PYX_ERR(9, 1828, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__547);
   __Pyx_GIVEREF(__pyx_tuple__547);
-  __pyx_codeobj__548 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__547, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1823, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__548)) __PYX_ERR(9, 1823, __pyx_L1_error)
+  __pyx_codeobj__548 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__547, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1828, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__548)) __PYX_ERR(9, 1828, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1845
+  /* "src/lxml/serializer.pxi":1850
  *         self._exited = False
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  */
-  __pyx_tuple__549 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(9, 1845, __pyx_L1_error)
+  __pyx_tuple__549 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__549)) __PYX_ERR(9, 1850, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__549);
   __Pyx_GIVEREF(__pyx_tuple__549);
-  __pyx_codeobj__550 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__549, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1845, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__550)) __PYX_ERR(9, 1845, __pyx_L1_error)
+  __pyx_codeobj__550 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__549, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_enter, 1850, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__550)) __PYX_ERR(9, 1850, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1851
+  /* "src/lxml/serializer.pxi":1856
  *         self._entered = True
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  */
-  __pyx_tuple__551 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(9, 1851, __pyx_L1_error)
+  __pyx_tuple__551 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_exc_type, __pyx_n_s_exc_val, __pyx_n_s_exc_tb); if (unlikely(!__pyx_tuple__551)) __PYX_ERR(9, 1856, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__551);
   __Pyx_GIVEREF(__pyx_tuple__551);
-  __pyx_codeobj__552 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__551, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1851, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__552)) __PYX_ERR(9, 1851, __pyx_L1_error)
+  __pyx_codeobj__552 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__551, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_exit, 1856, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__552)) __PYX_ERR(9, 1856, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1859
+  /* "src/lxml/serializer.pxi":1864
  *         self._exited = True
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         # for your async convenience
  *         return self.__enter__()
  */
-  __pyx_tuple__553 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(9, 1859, __pyx_L1_error)
+  __pyx_tuple__553 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__553)) __PYX_ERR(9, 1864, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__553);
   __Pyx_GIVEREF(__pyx_tuple__553);
-  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__553, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1859, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(9, 1859, __pyx_L1_error)
+  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__553, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aenter, 1864, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(9, 1864, __pyx_L1_error)
 
-  /* "src/lxml/serializer.pxi":1863
+  /* "src/lxml/serializer.pxi":1868
  *         return self.__enter__()
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
  *         # for your async convenience
  *         return self.__exit__(*args)
  */
-  __pyx_tuple__554 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(9, 1863, __pyx_L1_error)
+  __pyx_tuple__554 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__554)) __PYX_ERR(9, 1868, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__554);
   __Pyx_GIVEREF(__pyx_tuple__554);
-  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1863, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(9, 1863, __pyx_L1_error)
+  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__554, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_serializer_pxi, __pyx_n_s_aexit, 1868, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(9, 1868, __pyx_L1_error)
 
   /* "src/lxml/iterparse.pxi":148
  *         return self._parser.version
@@ -249512,10 +249643,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""strparam(strval)
  * 
  */
-  __pyx_tuple__625 = PyTuple_Pack(1, __pyx_n_s_strval); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(3, 438, __pyx_L1_error)
+  __pyx_tuple__625 = PyTuple_Pack(1, __pyx_n_s_strval); if (unlikely(!__pyx_tuple__625)) __PYX_ERR(4, 438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__625);
   __Pyx_GIVEREF(__pyx_tuple__625);
-  __pyx_codeobj__626 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__625, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_strparam, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__626)) __PYX_ERR(3, 438, __pyx_L1_error)
+  __pyx_codeobj__626 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__625, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_strparam, 438, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__626)) __PYX_ERR(4, 438, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":452
  * 
@@ -249524,10 +249655,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""set_global_max_depth(max_depth)
  * 
  */
-  __pyx_tuple__627 = PyTuple_Pack(1, __pyx_n_s_max_depth); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(3, 452, __pyx_L1_error)
+  __pyx_tuple__627 = PyTuple_Pack(1, __pyx_n_s_max_depth); if (unlikely(!__pyx_tuple__627)) __PYX_ERR(4, 452, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__627);
   __Pyx_GIVEREF(__pyx_tuple__627);
-  __pyx_codeobj__628 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__627, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set_global_max_depth, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__628)) __PYX_ERR(3, 452, __pyx_L1_error)
+  __pyx_codeobj__628 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__627, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set_global_max_depth, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__628)) __PYX_ERR(4, 452, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":471
  *         xslt.xsltMaxDepth = max_depth
@@ -249536,10 +249667,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""apply(self, _input,  profile_run=False, **kw)
  * 
  */
-  __pyx_tuple__629 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input, __pyx_n_s_profile_run, __pyx_n_s_kw_2); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __pyx_tuple__629 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_input, __pyx_n_s_profile_run, __pyx_n_s_kw_2); if (unlikely(!__pyx_tuple__629)) __PYX_ERR(4, 471, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__629);
   __Pyx_GIVEREF(__pyx_tuple__629);
-  __pyx_codeobj__630 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__629, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_apply, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__630)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __pyx_codeobj__630 = (PyObject*)__Pyx_PyCode_New(2, 1, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__629, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_apply, 471, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__630)) __PYX_ERR(4, 471, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":477
  *         return self(_input, profile_run=profile_run, **kw)
@@ -249548,10 +249679,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""tostring(self, result_tree)
  * 
  */
-  __pyx_tuple__631 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result_tree); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(3, 477, __pyx_L1_error)
+  __pyx_tuple__631 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_result_tree); if (unlikely(!__pyx_tuple__631)) __PYX_ERR(4, 477, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__631);
   __Pyx_GIVEREF(__pyx_tuple__631);
-  __pyx_codeobj__632 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__631, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_tostring, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__632)) __PYX_ERR(3, 477, __pyx_L1_error)
+  __pyx_codeobj__632 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__631, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_tostring, 477, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__632)) __PYX_ERR(4, 477, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":486
  *         return str(result_tree)
@@ -249560,10 +249691,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         return self.__copy__()
  * 
  */
-  __pyx_tuple__633 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(3, 486, __pyx_L1_error)
+  __pyx_tuple__633 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_memo); if (unlikely(!__pyx_tuple__633)) __PYX_ERR(4, 486, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__633);
   __Pyx_GIVEREF(__pyx_tuple__633);
-  __pyx_codeobj__634 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__633, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_deepcopy, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__634)) __PYX_ERR(3, 486, __pyx_L1_error)
+  __pyx_codeobj__634 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__633, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_deepcopy, 486, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__634)) __PYX_ERR(4, 486, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":489
  *         return self.__copy__()
@@ -249572,10 +249703,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         return _copyXSLT(self)
  * 
  */
-  __pyx_tuple__635 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(3, 489, __pyx_L1_error)
+  __pyx_tuple__635 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__635)) __PYX_ERR(4, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__635);
   __Pyx_GIVEREF(__pyx_tuple__635);
-  __pyx_codeobj__636 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__635, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_copy_2, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__636)) __PYX_ERR(3, 489, __pyx_L1_error)
+  __pyx_codeobj__636 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__635, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_copy_2, 489, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__636)) __PYX_ERR(4, 489, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":717
  *     cdef Py_ssize_t _buffer_refcnt
@@ -249584,10 +249715,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         """write_output(self, file, *, compression=0)
  * 
  */
-  __pyx_tuple__637 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_compression, __pyx_n_s_writer, __pyx_n_s_doc_2, __pyx_n_s_r, __pyx_n_s_rclose, __pyx_n_s_c_compression, __pyx_n_s_c_encoding, __pyx_n_s_c_buffer); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(3, 717, __pyx_L1_error)
+  __pyx_tuple__637 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_file, __pyx_n_s_compression, __pyx_n_s_writer, __pyx_n_s_doc_2, __pyx_n_s_r, __pyx_n_s_rclose, __pyx_n_s_c_compression, __pyx_n_s_c_encoding, __pyx_n_s_c_buffer); if (unlikely(!__pyx_tuple__637)) __PYX_ERR(4, 717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__637);
   __Pyx_GIVEREF(__pyx_tuple__637);
-  __pyx_codeobj__638 = (PyObject*)__Pyx_PyCode_New(2, 1, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__637, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_write_output, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__638)) __PYX_ERR(3, 717, __pyx_L1_error)
+  __pyx_codeobj__638 = (PyObject*)__Pyx_PyCode_New(2, 1, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__637, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_write_output, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__638)) __PYX_ERR(4, 717, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":787
  *         return result
@@ -249596,10 +249727,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         cdef xmlChar* encoding
  *         cdef xmlChar* s = NULL
  */
-  __pyx_tuple__639 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_s_4, __pyx_n_s_l, __pyx_n_s_result); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(3, 787, __pyx_L1_error)
+  __pyx_tuple__639 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_encoding, __pyx_n_s_s_4, __pyx_n_s_l, __pyx_n_s_result); if (unlikely(!__pyx_tuple__639)) __PYX_ERR(4, 787, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__639);
   __Pyx_GIVEREF(__pyx_tuple__639);
-  __pyx_codeobj__640 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__639, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_unicode_2, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__640)) __PYX_ERR(3, 787, __pyx_L1_error)
+  __pyx_codeobj__640 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__639, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_unicode_2, 787, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__640)) __PYX_ERR(4, 787, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":881
  * # XSLT PI support
@@ -249608,7 +249739,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  * cdef object _FIND_PI_HREF = _RE_PI_HREF.findall
  * cdef object _REPLACE_PI_HREF = _RE_PI_HREF.sub
  */
-  __pyx_tuple__641 = PyTuple_Pack(1, __pyx_kp_u_s_href_s_s); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(3, 881, __pyx_L1_error)
+  __pyx_tuple__641 = PyTuple_Pack(1, __pyx_kp_u_s_href_s_s); if (unlikely(!__pyx_tuple__641)) __PYX_ERR(4, 881, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__641);
   __Pyx_GIVEREF(__pyx_tuple__641);
 
@@ -249619,10 +249750,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""parseXSL(self, parser=None)
  * 
  */
-  __pyx_tuple__642 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_parser, __pyx_n_s_result_doc, __pyx_n_s_result_node, __pyx_n_s_href_utf, __pyx_n_s_c_href, __pyx_n_s_c_attr, __pyx_n_s_hrefs, __pyx_n_s_root); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(3, 895, __pyx_L1_error)
+  __pyx_tuple__642 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_parser, __pyx_n_s_result_doc, __pyx_n_s_result_node, __pyx_n_s_href_utf, __pyx_n_s_c_href, __pyx_n_s_c_attr, __pyx_n_s_hrefs, __pyx_n_s_root); if (unlikely(!__pyx_tuple__642)) __PYX_ERR(4, 895, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__642);
   __Pyx_GIVEREF(__pyx_tuple__642);
-  __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_parseXSL, 895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) __PYX_ERR(3, 895, __pyx_L1_error)
+  __pyx_codeobj__643 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__642, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_parseXSL, 895, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__643)) __PYX_ERR(4, 895, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":952
  *         return _elementTreeFactory(result_node._doc, result_node)
@@ -249631,10 +249762,10 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_tuple__644 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_attrib, __pyx_n_s_text); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(3, 952, __pyx_L1_error)
+  __pyx_tuple__644 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value, __pyx_n_s_attrib, __pyx_n_s_text); if (unlikely(!__pyx_tuple__644)) __PYX_ERR(4, 952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__644);
   __Pyx_GIVEREF(__pyx_tuple__644);
-  __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) __PYX_ERR(3, 952, __pyx_L1_error)
+  __pyx_codeobj__645 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__644, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_lxml_xslt_pxi, __pyx_n_s_set, 952, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__645)) __PYX_ERR(4, 952, __pyx_L1_error)
 
   /* "src/lxml/xsltext.pxi":6
  *     u"""Base class of an XSLT extension element.
@@ -250630,7 +250761,7 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__ReadOnlyProxy.free_after_use = (void (*)(struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *))__pyx_f_4lxml_5etree_14_ReadOnlyProxy_free_after_use;
   __pyx_vtable_4lxml_5etree__ReadOnlyProxy.__pyx___copy__ = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_14_ReadOnlyProxy___copy__;
   __pyx_vtable_4lxml_5etree__ReadOnlyProxy.getchildren = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__ReadOnlyProxy *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_14_ReadOnlyProxy_getchildren;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyProxy) < 0) __PYX_ERR(6, 4, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyProxy) < 0) __PYX_ERR(7, 4, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ReadOnlyProxy.tp_print = 0;
   #endif
@@ -250639,7 +250770,7 @@ static int __Pyx_modinit_type_init_code(void) {
   }
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree__ReadOnlyProxy, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(6, 4, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree__ReadOnlyProxy, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(7, 4, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_14_ReadOnlyProxy_4__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_14_ReadOnlyProxy_4__getitem__.doc = __pyx_doc_4lxml_5etree_14_ReadOnlyProxy_4__getitem__;
@@ -250649,7 +250780,7 @@ static int __Pyx_modinit_type_init_code(void) {
   #endif
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree__ReadOnlyProxy, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(6, 4, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree__ReadOnlyProxy, "__len__"); if (unlikely(!wrapper)) __PYX_ERR(7, 4, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_14_ReadOnlyProxy_6__len__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_14_ReadOnlyProxy_6__len__.doc = __pyx_doc_4lxml_5etree_14_ReadOnlyProxy_6__len__;
@@ -250657,45 +250788,45 @@ static int __Pyx_modinit_type_init_code(void) {
     }
   }
   #endif
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyProxy) < 0) __PYX_ERR(6, 4, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyProxy) < 0) __PYX_ERR(7, 4, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ReadOnlyProxy = &__pyx_type_4lxml_5etree__ReadOnlyProxy;
   __pyx_vtabptr_4lxml_5etree__ReadOnlyPIProxy = &__pyx_vtable_4lxml_5etree__ReadOnlyPIProxy;
   __pyx_vtable_4lxml_5etree__ReadOnlyPIProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyProxy;
   __pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyPIProxy) < 0) __PYX_ERR(6, 248, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyPIProxy) < 0) __PYX_ERR(7, 248, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyPIProxy) < 0) __PYX_ERR(6, 248, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyPIProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyPIProxy) < 0) __PYX_ERR(7, 248, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ReadOnlyPIProxy = &__pyx_type_4lxml_5etree__ReadOnlyPIProxy;
   __pyx_vtabptr_4lxml_5etree__ReadOnlyEntityProxy = &__pyx_vtable_4lxml_5etree__ReadOnlyEntityProxy;
   __pyx_vtable_4lxml_5etree__ReadOnlyEntityProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyProxy;
   __pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyEntityProxy) < 0) __PYX_ERR(6, 257, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyEntityProxy) < 0) __PYX_ERR(7, 257, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyEntityProxy) < 0) __PYX_ERR(6, 257, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyEntityProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyEntityProxy) < 0) __PYX_ERR(7, 257, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ReadOnlyEntityProxy = &__pyx_type_4lxml_5etree__ReadOnlyEntityProxy;
   __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy = &__pyx_vtable_4lxml_5etree__ReadOnlyElementProxy;
   __pyx_vtable_4lxml_5etree__ReadOnlyElementProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyProxy;
   __pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyElementProxy) < 0) __PYX_ERR(6, 275, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ReadOnlyElementProxy) < 0) __PYX_ERR(7, 275, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy) < 0) __PYX_ERR(6, 275, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ReadOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy) < 0) __PYX_ERR(7, 275, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy = &__pyx_type_4lxml_5etree__ReadOnlyElementProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__OpaqueNodeWrapper) < 0) __PYX_ERR(6, 376, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__OpaqueNodeWrapper) < 0) __PYX_ERR(7, 376, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__OpaqueNodeWrapper.tp_print = 0;
   #endif
@@ -250707,66 +250838,66 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__OpaqueDocumentWrapper._assertNode = (int (*)(struct __pyx_obj_4lxml_5etree__OpaqueDocumentWrapper *))__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper__assertNode;
   __pyx_vtable_4lxml_5etree__OpaqueDocumentWrapper.append = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__OpaqueDocumentWrapper *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_22_OpaqueDocumentWrapper_append;
   __pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_base = __pyx_ptype_4lxml_5etree__OpaqueNodeWrapper;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__OpaqueDocumentWrapper) < 0) __PYX_ERR(6, 383, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__OpaqueDocumentWrapper) < 0) __PYX_ERR(7, 383, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_dictoffset && __pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_dict, __pyx_vtabptr_4lxml_5etree__OpaqueDocumentWrapper) < 0) __PYX_ERR(6, 383, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__OpaqueDocumentWrapper.tp_dict, __pyx_vtabptr_4lxml_5etree__OpaqueDocumentWrapper) < 0) __PYX_ERR(7, 383, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper = &__pyx_type_4lxml_5etree__OpaqueDocumentWrapper;
   __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyProxy = &__pyx_vtable_4lxml_5etree__ModifyContentOnlyProxy;
   __pyx_vtable_4lxml_5etree__ModifyContentOnlyProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyProxy;
   __pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyProxy) < 0) __PYX_ERR(6, 427, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyProxy) < 0) __PYX_ERR(7, 427, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyProxy) < 0) __PYX_ERR(6, 427, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyProxy) < 0) __PYX_ERR(7, 427, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ModifyContentOnlyProxy = &__pyx_type_4lxml_5etree__ModifyContentOnlyProxy;
   __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyPIProxy = &__pyx_vtable_4lxml_5etree__ModifyContentOnlyPIProxy;
   __pyx_vtable_4lxml_5etree__ModifyContentOnlyPIProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ModifyContentOnlyProxy;
   __pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_base = __pyx_ptype_4lxml_5etree__ModifyContentOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy) < 0) __PYX_ERR(6, 450, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy) < 0) __PYX_ERR(7, 450, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyPIProxy) < 0) __PYX_ERR(6, 450, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyPIProxy) < 0) __PYX_ERR(7, 450, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ModifyContentOnlyPIProxy = &__pyx_type_4lxml_5etree__ModifyContentOnlyPIProxy;
   __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyEntityProxy = &__pyx_vtable_4lxml_5etree__ModifyContentOnlyEntityProxy;
   __pyx_vtable_4lxml_5etree__ModifyContentOnlyEntityProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ModifyContentOnlyProxy;
   __pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_base = __pyx_ptype_4lxml_5etree__ModifyContentOnlyProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy) < 0) __PYX_ERR(6, 467, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy) < 0) __PYX_ERR(7, 467, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_dictoffset && __pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyEntityProxy) < 0) __PYX_ERR(6, 467, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__ModifyContentOnlyEntityProxy) < 0) __PYX_ERR(7, 467, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__ModifyContentOnlyEntityProxy = &__pyx_type_4lxml_5etree__ModifyContentOnlyEntityProxy;
   __pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy = &__pyx_vtable_4lxml_5etree__AppendOnlyElementProxy;
   __pyx_vtable_4lxml_5etree__AppendOnlyElementProxy.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ReadOnlyElementProxy;
   __pyx_vtable_4lxml_5etree__AppendOnlyElementProxy.append = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__AppendOnlyElementProxy *, PyObject *, int __pyx_skip_dispatch))__pyx_f_4lxml_5etree_23_AppendOnlyElementProxy_append;
   __pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_base = __pyx_ptype_4lxml_5etree__ReadOnlyElementProxy;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__AppendOnlyElementProxy) < 0) __PYX_ERR(6, 483, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__AppendOnlyElementProxy) < 0) __PYX_ERR(7, 483, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_dictoffset && __pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy) < 0) __PYX_ERR(6, 483, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AppendOnlyElementProxy.tp_dict, __pyx_vtabptr_4lxml_5etree__AppendOnlyElementProxy) < 0) __PYX_ERR(7, 483, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__AppendOnlyElementProxy = &__pyx_type_4lxml_5etree__AppendOnlyElementProxy;
   LxmlElementBaseType.tp_base = __pyx_ptype_4lxml_5etree__Element;
-  if (PyType_Ready(&LxmlElementBaseType) < 0) __PYX_ERR(7, 6, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementBaseType) < 0) __PYX_ERR(8, 6, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   LxmlElementBaseType.tp_print = 0;
   #endif
@@ -250775,7 +250906,7 @@ static int __Pyx_modinit_type_init_code(void) {
   }
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementBaseType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(7, 6, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&LxmlElementBaseType, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(8, 6, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_11ElementBase___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_11ElementBase___init__.doc = __pyx_doc_4lxml_5etree_11ElementBase___init__;
@@ -250783,130 +250914,130 @@ static int __Pyx_modinit_type_init_code(void) {
     }
   }
   #endif
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementBase, (PyObject *)&LxmlElementBaseType) < 0) __PYX_ERR(7, 6, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementBase, (PyObject *)&LxmlElementBaseType) < 0) __PYX_ERR(8, 6, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementBase = &LxmlElementBaseType;
   __pyx_vtabptr_4lxml_5etree_CommentBase = &__pyx_vtable_4lxml_5etree_CommentBase;
   __pyx_vtable_4lxml_5etree_CommentBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Comment;
   __pyx_type_4lxml_5etree_CommentBase.tp_base = __pyx_ptype_4lxml_5etree__Comment;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_CommentBase) < 0) __PYX_ERR(7, 97, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_CommentBase) < 0) __PYX_ERR(8, 97, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_CommentBase.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_CommentBase.tp_dictoffset && __pyx_type_4lxml_5etree_CommentBase.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_CommentBase.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CommentBase.tp_dict, __pyx_vtabptr_4lxml_5etree_CommentBase) < 0) __PYX_ERR(7, 97, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CommentBase, (PyObject *)&__pyx_type_4lxml_5etree_CommentBase) < 0) __PYX_ERR(7, 97, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CommentBase.tp_dict, __pyx_vtabptr_4lxml_5etree_CommentBase) < 0) __PYX_ERR(8, 97, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CommentBase, (PyObject *)&__pyx_type_4lxml_5etree_CommentBase) < 0) __PYX_ERR(8, 97, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_CommentBase = &__pyx_type_4lxml_5etree_CommentBase;
   __pyx_vtabptr_4lxml_5etree_PIBase = &__pyx_vtable_4lxml_5etree_PIBase;
   __pyx_vtable_4lxml_5etree_PIBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
   __pyx_type_4lxml_5etree_PIBase.tp_base = __pyx_ptype_4lxml_5etree__ProcessingInstruction;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_PIBase) < 0) __PYX_ERR(7, 126, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_PIBase) < 0) __PYX_ERR(8, 126, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_PIBase.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_PIBase.tp_dictoffset && __pyx_type_4lxml_5etree_PIBase.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_PIBase.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PIBase.tp_dict, __pyx_vtabptr_4lxml_5etree_PIBase) < 0) __PYX_ERR(7, 126, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PIBase, (PyObject *)&__pyx_type_4lxml_5etree_PIBase) < 0) __PYX_ERR(7, 126, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PIBase.tp_dict, __pyx_vtabptr_4lxml_5etree_PIBase) < 0) __PYX_ERR(8, 126, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PIBase, (PyObject *)&__pyx_type_4lxml_5etree_PIBase) < 0) __PYX_ERR(8, 126, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_PIBase = &__pyx_type_4lxml_5etree_PIBase;
   __pyx_vtabptr_4lxml_5etree_EntityBase = &__pyx_vtable_4lxml_5etree_EntityBase;
   __pyx_vtable_4lxml_5etree_EntityBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Entity;
   __pyx_type_4lxml_5etree_EntityBase.tp_base = __pyx_ptype_4lxml_5etree__Entity;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_EntityBase) < 0) __PYX_ERR(7, 157, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_EntityBase) < 0) __PYX_ERR(8, 157, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_EntityBase.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_EntityBase.tp_dictoffset && __pyx_type_4lxml_5etree_EntityBase.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_EntityBase.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_EntityBase.tp_dict, __pyx_vtabptr_4lxml_5etree_EntityBase) < 0) __PYX_ERR(7, 157, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EntityBase, (PyObject *)&__pyx_type_4lxml_5etree_EntityBase) < 0) __PYX_ERR(7, 157, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_EntityBase.tp_dict, __pyx_vtabptr_4lxml_5etree_EntityBase) < 0) __PYX_ERR(8, 157, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EntityBase, (PyObject *)&__pyx_type_4lxml_5etree_EntityBase) < 0) __PYX_ERR(8, 157, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_EntityBase = &__pyx_type_4lxml_5etree_EntityBase;
-  if (PyType_Ready(&LxmlElementClassLookupType) < 0) __PYX_ERR(7, 213, __pyx_L1_error)
+  if (PyType_Ready(&LxmlElementClassLookupType) < 0) __PYX_ERR(8, 213, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   LxmlElementClassLookupType.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!LxmlElementClassLookupType.tp_dictoffset && LxmlElementClassLookupType.tp_getattro == PyObject_GenericGetAttr)) {
     LxmlElementClassLookupType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementClassLookup, (PyObject *)&LxmlElementClassLookupType) < 0) __PYX_ERR(7, 213, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementClassLookup, (PyObject *)&LxmlElementClassLookupType) < 0) __PYX_ERR(8, 213, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementClassLookup = &LxmlElementClassLookupType;
   __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup = &__pyx_vtable_4lxml_5etree_FallbackElementClassLookup;
   __pyx_vtable_4lxml_5etree_FallbackElementClassLookup._setFallback = (void (*)(struct LxmlFallbackElementClassLookup *, struct LxmlElementClassLookup *))__pyx_f_4lxml_5etree_26FallbackElementClassLookup__setFallback;
   LxmlFallbackElementClassLookupType.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
-  if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(7, 221, __pyx_L1_error)
+  if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 221, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   LxmlFallbackElementClassLookupType.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!LxmlFallbackElementClassLookupType.tp_dictoffset && LxmlFallbackElementClassLookupType.tp_getattro == PyObject_GenericGetAttr)) {
     LxmlFallbackElementClassLookupType.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) __PYX_ERR(7, 221, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FallbackElementClassLookup, (PyObject *)&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(7, 221, __pyx_L1_error)
+  if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) __PYX_ERR(8, 221, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FallbackElementClassLookup, (PyObject *)&LxmlFallbackElementClassLookupType) < 0) __PYX_ERR(8, 221, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_FallbackElementClassLookup = &LxmlFallbackElementClassLookupType;
   __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(7, 263, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 263, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_dictoffset && __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementDefaultClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(7, 263, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ElementDefaultClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) __PYX_ERR(8, 263, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = &__pyx_type_4lxml_5etree_ElementDefaultClassLookup;
   __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;
   __pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(7, 342, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 342, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dictoffset && __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(7, 342, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AttributeBasedElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(7, 342, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 342, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AttributeBasedElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) __PYX_ERR(8, 342, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;
   __pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(7, 394, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 394, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dictoffset && __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(7, 394, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ParserBasedElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(7, 394, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 394, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ParserBasedElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) __PYX_ERR(8, 394, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_type_4lxml_5etree_ParserBasedElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup = &__pyx_vtable_4lxml_5etree_CustomElementClassLookup;
   __pyx_vtable_4lxml_5etree_CustomElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(7, 411, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 411, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dictoffset && __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_CustomElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(7, 411, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CustomElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(7, 411, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 411, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_CustomElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) __PYX_ERR(8, 411, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_CustomElementClassLookup = &__pyx_type_4lxml_5etree_CustomElementClassLookup;
   __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup = &__pyx_vtable_4lxml_5etree_PythonElementClassLookup;
   __pyx_vtable_4lxml_5etree_PythonElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
   __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(7, 466, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 466, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dictoffset && __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_PythonElementClassLookup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(7, 466, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(7, 466, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PythonElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 466, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PythonElementClassLookup, (PyObject *)&__pyx_type_4lxml_5etree_PythonElementClassLookup) < 0) __PYX_ERR(8, 466, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_PythonElementClassLookup = &__pyx_type_4lxml_5etree_PythonElementClassLookup;
   __pyx_type_4lxml_5etree_LxmlRegistryError.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
   if (PyType_Ready(&__pyx_type_4lxml_5etree_LxmlRegistryError) < 0) __PYX_ERR(11, 3, __pyx_L1_error)
@@ -251211,15 +251342,15 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxComment = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment;
   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxStartNs = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStartNs;
   __pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxEndNs = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEndNs;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(8, 43, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(3, 52, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__SaxParserTarget.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__SaxParserTarget.tp_dictoffset && __pyx_type_4lxml_5etree__SaxParserTarget.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__SaxParserTarget.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(8, 43, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SaxParserTarget, (PyObject *)&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(8, 43, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(3, 52, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SaxParserTarget, (PyObject *)&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) __PYX_ERR(3, 52, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__SaxParserTarget = &__pyx_type_4lxml_5etree__SaxParserTarget;
   __pyx_vtabptr_4lxml_5etree__SaxParserContext = &__pyx_vtable_4lxml_5etree__SaxParserContext;
   __pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ParserContext;
@@ -251233,16 +251364,16 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__SaxParserContext.flushEvents = (int (*)(struct __pyx_obj_4lxml_5etree__SaxParserContext *))__pyx_f_4lxml_5etree_17_SaxParserContext_flushEvents;
   __pyx_vtable_4lxml_5etree__SaxParserContext._handleSaxException = (void (*)(struct __pyx_obj_4lxml_5etree__SaxParserContext *, xmlParserCtxt *))__pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException;
   __pyx_type_4lxml_5etree__SaxParserContext.tp_base = __pyx_ptype_4lxml_5etree__ParserContext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserContext) < 0) __PYX_ERR(8, 69, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserContext) < 0) __PYX_ERR(3, 78, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__SaxParserContext.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__SaxParserContext.tp_dictoffset && __pyx_type_4lxml_5etree__SaxParserContext.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__SaxParserContext.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserContext) < 0) __PYX_ERR(8, 69, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserContext) < 0) __PYX_ERR(3, 78, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__SaxParserContext = &__pyx_type_4lxml_5etree__SaxParserContext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__ParseEventsIterator) < 0) __PYX_ERR(8, 245, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__ParseEventsIterator) < 0) __PYX_ERR(3, 254, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__ParseEventsIterator.tp_print = 0;
   #endif
@@ -251259,15 +251390,15 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxComment = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *, PyObject *))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment;
   __pyx_vtable_4lxml_5etree_TreeBuilder._flush = (int (*)(struct __pyx_obj_4lxml_5etree_TreeBuilder *))__pyx_f_4lxml_5etree_11TreeBuilder__flush;
   __pyx_type_4lxml_5etree_TreeBuilder.tp_base = __pyx_ptype_4lxml_5etree__SaxParserTarget;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(8, 691, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(3, 700, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_TreeBuilder.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_TreeBuilder.tp_dictoffset && __pyx_type_4lxml_5etree_TreeBuilder.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_TreeBuilder.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_TreeBuilder.tp_dict, __pyx_vtabptr_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(8, 691, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TreeBuilder, (PyObject *)&__pyx_type_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(8, 691, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_TreeBuilder.tp_dict, __pyx_vtabptr_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(3, 700, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TreeBuilder, (PyObject *)&__pyx_type_4lxml_5etree_TreeBuilder) < 0) __PYX_ERR(3, 700, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_TreeBuilder = &__pyx_type_4lxml_5etree_TreeBuilder;
   __pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget = &__pyx_vtable_4lxml_5etree__PythonSaxParserTarget;
   __pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
@@ -251344,24 +251475,24 @@ static int __Pyx_modinit_type_init_code(void) {
   if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_C14NWriterTarget.tp_dict, __pyx_vtabptr_4lxml_5etree_C14NWriterTarget) < 0) __PYX_ERR(9, 966, __pyx_L1_error)
   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_C14NWriterTarget, (PyObject *)&__pyx_type_4lxml_5etree_C14NWriterTarget) < 0) __PYX_ERR(9, 966, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_C14NWriterTarget = &__pyx_type_4lxml_5etree_C14NWriterTarget;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_xmlfile) < 0) __PYX_ERR(9, 1284, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_xmlfile) < 0) __PYX_ERR(9, 1289, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_xmlfile.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_xmlfile.tp_dictoffset && __pyx_type_4lxml_5etree_xmlfile.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_xmlfile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_xmlfile, (PyObject *)&__pyx_type_4lxml_5etree_xmlfile) < 0) __PYX_ERR(9, 1284, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_xmlfile, (PyObject *)&__pyx_type_4lxml_5etree_xmlfile) < 0) __PYX_ERR(9, 1289, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_xmlfile = &__pyx_type_4lxml_5etree_xmlfile;
   __pyx_type_4lxml_5etree_htmlfile.tp_base = __pyx_ptype_4lxml_5etree_xmlfile;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_htmlfile) < 0) __PYX_ERR(9, 1373, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_htmlfile) < 0) __PYX_ERR(9, 1378, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_htmlfile.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_htmlfile.tp_dictoffset && __pyx_type_4lxml_5etree_htmlfile.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_htmlfile.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_htmlfile, (PyObject *)&__pyx_type_4lxml_5etree_htmlfile) < 0) __PYX_ERR(9, 1373, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_htmlfile, (PyObject *)&__pyx_type_4lxml_5etree_htmlfile) < 0) __PYX_ERR(9, 1378, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_htmlfile = &__pyx_type_4lxml_5etree_htmlfile;
   __pyx_vtabptr_4lxml_5etree__IncrementalFileWriter = &__pyx_vtable_4lxml_5etree__IncrementalFileWriter;
   __pyx_vtable_4lxml_5etree__IncrementalFileWriter._write_qname = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *, PyObject *, PyObject *))__pyx_f_4lxml_5etree_22_IncrementalFileWriter__write_qname;
@@ -251373,38 +251504,38 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__IncrementalFileWriter._collect_namespaces = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *, PyObject *))__pyx_f_4lxml_5etree_22_IncrementalFileWriter__collect_namespaces;
   __pyx_vtable_4lxml_5etree__IncrementalFileWriter._close = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *, int))__pyx_f_4lxml_5etree_22_IncrementalFileWriter__close;
   __pyx_vtable_4lxml_5etree__IncrementalFileWriter._handle_error = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__IncrementalFileWriter *, int))__pyx_f_4lxml_5etree_22_IncrementalFileWriter__handle_error;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__IncrementalFileWriter) < 0) __PYX_ERR(9, 1394, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__IncrementalFileWriter) < 0) __PYX_ERR(9, 1399, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__IncrementalFileWriter.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__IncrementalFileWriter.tp_dictoffset && __pyx_type_4lxml_5etree__IncrementalFileWriter.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__IncrementalFileWriter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IncrementalFileWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__IncrementalFileWriter) < 0) __PYX_ERR(9, 1394, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IncrementalFileWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__IncrementalFileWriter) < 0) __PYX_ERR(9, 1399, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__IncrementalFileWriter = &__pyx_type_4lxml_5etree__IncrementalFileWriter;
   __pyx_vtabptr_4lxml_5etree__AsyncDataWriter = &__pyx_vtable_4lxml_5etree__AsyncDataWriter;
   __pyx_vtable_4lxml_5etree__AsyncDataWriter.collect = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__AsyncDataWriter *))__pyx_f_4lxml_5etree_16_AsyncDataWriter_collect;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncDataWriter) < 0) __PYX_ERR(9, 1698, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncDataWriter) < 0) __PYX_ERR(9, 1703, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__AsyncDataWriter.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__AsyncDataWriter.tp_dictoffset && __pyx_type_4lxml_5etree__AsyncDataWriter.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__AsyncDataWriter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AsyncDataWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__AsyncDataWriter) < 0) __PYX_ERR(9, 1698, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AsyncDataWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__AsyncDataWriter) < 0) __PYX_ERR(9, 1703, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__AsyncDataWriter = &__pyx_type_4lxml_5etree__AsyncDataWriter;
   __pyx_vtabptr_4lxml_5etree__AsyncIncrementalFileWriter = &__pyx_vtable_4lxml_5etree__AsyncIncrementalFileWriter;
   __pyx_vtable_4lxml_5etree__AsyncIncrementalFileWriter._flush = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__AsyncIncrementalFileWriter *))__pyx_f_4lxml_5etree_27_AsyncIncrementalFileWriter__flush;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter) < 0) __PYX_ERR(9, 1717, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter) < 0) __PYX_ERR(9, 1722, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_dictoffset && __pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__AsyncIncrementalFileWriter) < 0) __PYX_ERR(9, 1717, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__AsyncIncrementalFileWriter) < 0) __PYX_ERR(9, 1722, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter = &__pyx_type_4lxml_5etree__AsyncIncrementalFileWriter;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncFileWriterElement) < 0) __PYX_ERR(9, 1782, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__AsyncFileWriterElement) < 0) __PYX_ERR(9, 1787, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__AsyncFileWriterElement.tp_print = 0;
   #endif
@@ -251412,7 +251543,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree__AsyncFileWriterElement.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree__AsyncFileWriterElement = &__pyx_type_4lxml_5etree__AsyncFileWriterElement;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__FileWriterElement) < 0) __PYX_ERR(9, 1807, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__FileWriterElement) < 0) __PYX_ERR(9, 1812, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__FileWriterElement.tp_print = 0;
   #endif
@@ -251420,7 +251551,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree__FileWriterElement.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree__FileWriterElement = &__pyx_type_4lxml_5etree__FileWriterElement;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__MethodChanger) < 0) __PYX_ERR(9, 1831, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__MethodChanger) < 0) __PYX_ERR(9, 1836, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__MethodChanger.tp_print = 0;
   #endif
@@ -251712,71 +251843,71 @@ static int __Pyx_modinit_type_init_code(void) {
   if (PyObject_SetAttr(__pyx_m, __pyx_n_s_ETXPath, (PyObject *)&__pyx_type_4lxml_5etree_ETXPath) < 0) __PYX_ERR(18, 466, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_ETXPath = &__pyx_type_4lxml_5etree_ETXPath;
   __pyx_type_4lxml_5etree_XSLTError.tp_base = __pyx_ptype_4lxml_5etree_LxmlError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTError) < 0) __PYX_ERR(3, 6, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTError) < 0) __PYX_ERR(4, 6, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLTError.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_XSLTError.tp_dictoffset && __pyx_type_4lxml_5etree_XSLTError.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_XSLTError.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTError) < 0) __PYX_ERR(3, 6, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTError) < 0) __PYX_ERR(4, 6, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTError = &__pyx_type_4lxml_5etree_XSLTError;
   __pyx_type_4lxml_5etree_XSLTParseError.tp_base = __pyx_ptype_4lxml_5etree_XSLTError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTParseError) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTParseError) < 0) __PYX_ERR(4, 10, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLTParseError.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_XSLTParseError.tp_dictoffset && __pyx_type_4lxml_5etree_XSLTParseError.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_XSLTParseError.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTParseError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTParseError) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTParseError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTParseError) < 0) __PYX_ERR(4, 10, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTParseError = &__pyx_type_4lxml_5etree_XSLTParseError;
   __pyx_type_4lxml_5etree_XSLTApplyError.tp_base = __pyx_ptype_4lxml_5etree_XSLTError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTApplyError) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTApplyError) < 0) __PYX_ERR(4, 14, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLTApplyError.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_XSLTApplyError.tp_dictoffset && __pyx_type_4lxml_5etree_XSLTApplyError.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_XSLTApplyError.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTApplyError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTApplyError) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTApplyError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTApplyError) < 0) __PYX_ERR(4, 14, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTApplyError = &__pyx_type_4lxml_5etree_XSLTApplyError;
   __pyx_type_4lxml_5etree_XSLTExtensionError.tp_base = __pyx_ptype_4lxml_5etree_XSLTError;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTExtensionError) < 0) __PYX_ERR(3, 22, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTExtensionError) < 0) __PYX_ERR(4, 22, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLTExtensionError.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_XSLTExtensionError.tp_dictoffset && __pyx_type_4lxml_5etree_XSLTExtensionError.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_XSLTExtensionError.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTExtensionError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTExtensionError) < 0) __PYX_ERR(3, 22, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTExtensionError, (PyObject *)&__pyx_type_4lxml_5etree_XSLTExtensionError) < 0) __PYX_ERR(4, 22, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTExtensionError = &__pyx_type_4lxml_5etree_XSLTExtensionError;
   __pyx_vtabptr_4lxml_5etree__XSLTResolverContext = &__pyx_vtable_4lxml_5etree__XSLTResolverContext;
   __pyx_vtable_4lxml_5etree__XSLTResolverContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ResolverContext;
   __pyx_vtable_4lxml_5etree__XSLTResolverContext._copy = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *(*)(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *))__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy;
   __pyx_type_4lxml_5etree__XSLTResolverContext.tp_base = __pyx_ptype_4lxml_5etree__ResolverContext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) __PYX_ERR(3, 49, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__XSLTResolverContext.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__XSLTResolverContext.tp_dictoffset && __pyx_type_4lxml_5etree__XSLTResolverContext.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__XSLTResolverContext.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResolverContext) < 0) __PYX_ERR(3, 49, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResolverContext) < 0) __PYX_ERR(4, 49, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__XSLTResolverContext = &__pyx_type_4lxml_5etree__XSLTResolverContext;
   __pyx_vtabptr_4lxml_5etree_XSLTAccessControl = &__pyx_vtable_4lxml_5etree_XSLTAccessControl;
   __pyx_vtable_4lxml_5etree_XSLTAccessControl._setAccess = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption, int))__pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess;
   __pyx_vtable_4lxml_5etree_XSLTAccessControl._register_in_context = (void (*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltTransformContext *))__pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context;
   __pyx_vtable_4lxml_5etree_XSLTAccessControl._optval = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *, xsltSecurityOption))__pyx_f_4lxml_5etree_17XSLTAccessControl__optval;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(3, 169, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(4, 169, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLTAccessControl.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree_XSLTAccessControl.tp_dictoffset && __pyx_type_4lxml_5etree_XSLTAccessControl.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree_XSLTAccessControl.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLTAccessControl.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(3, 169, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTAccessControl, (PyObject *)&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(3, 169, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLTAccessControl.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(4, 169, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTAccessControl, (PyObject *)&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) __PYX_ERR(4, 169, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLTAccessControl = &__pyx_type_4lxml_5etree_XSLTAccessControl;
   __pyx_vtabptr_4lxml_5etree__XSLTContext = &__pyx_vtable_4lxml_5etree__XSLTContext;
   __pyx_vtable_4lxml_5etree__XSLTContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseContext;
@@ -251784,16 +251915,16 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_vtable_4lxml_5etree__XSLTContext.register_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *, struct LxmlDocument *))__pyx_f_4lxml_5etree_12_XSLTContext_register_context;
   __pyx_vtable_4lxml_5etree__XSLTContext.free_context = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTContext *))__pyx_f_4lxml_5etree_12_XSLTContext_free_context;
   __pyx_type_4lxml_5etree__XSLTContext.tp_base = __pyx_ptype_4lxml_5etree__BaseContext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTContext) < 0) __PYX_ERR(3, 272, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTContext) < 0) __PYX_ERR(4, 272, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__XSLTContext.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__XSLTContext.tp_dictoffset && __pyx_type_4lxml_5etree__XSLTContext.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__XSLTContext.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTContext) < 0) __PYX_ERR(3, 272, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTContext) < 0) __PYX_ERR(4, 272, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__XSLTContext = &__pyx_type_4lxml_5etree__XSLTContext;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTQuotedStringParam) < 0) __PYX_ERR(3, 325, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTQuotedStringParam) < 0) __PYX_ERR(4, 325, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__XSLTQuotedStringParam.tp_print = 0;
   #endif
@@ -251803,7 +251934,7 @@ static int __Pyx_modinit_type_init_code(void) {
   __pyx_ptype_4lxml_5etree__XSLTQuotedStringParam = &__pyx_type_4lxml_5etree__XSLTQuotedStringParam;
   __pyx_vtabptr_4lxml_5etree_XSLT = &__pyx_vtable_4lxml_5etree_XSLT;
   __pyx_vtable_4lxml_5etree_XSLT._run_transform = (xmlDoc *(*)(struct __pyx_obj_4lxml_5etree_XSLT *, xmlDoc *, const char **, struct __pyx_obj_4lxml_5etree__XSLTContext *, xsltTransformContext *))__pyx_f_4lxml_5etree_4XSLT__run_transform;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLT) < 0) __PYX_ERR(3, 335, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLT) < 0) __PYX_ERR(4, 335, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree_XSLT.tp_print = 0;
   #endif
@@ -251812,7 +251943,7 @@ static int __Pyx_modinit_type_init_code(void) {
   }
   #if CYTHON_COMPILING_IN_CPYTHON
   {
-    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree_XSLT, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(3, 335, __pyx_L1_error)
+    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_4lxml_5etree_XSLT, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(4, 335, __pyx_L1_error)
     if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
       __pyx_wrapperbase_4lxml_5etree_4XSLT_18__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
       __pyx_wrapperbase_4lxml_5etree_4XSLT_18__call__.doc = __pyx_doc_4lxml_5etree_4XSLT_18__call__;
@@ -251820,35 +251951,35 @@ static int __Pyx_modinit_type_init_code(void) {
     }
   }
   #endif
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLT.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLT) < 0) __PYX_ERR(3, 335, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLT, (PyObject *)&__pyx_type_4lxml_5etree_XSLT) < 0) __PYX_ERR(3, 335, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLT.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLT) < 0) __PYX_ERR(4, 335, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLT, (PyObject *)&__pyx_type_4lxml_5etree_XSLT) < 0) __PYX_ERR(4, 335, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree_XSLT = &__pyx_type_4lxml_5etree_XSLT;
   __pyx_vtabptr_4lxml_5etree__XSLTResultTree = &__pyx_vtable_4lxml_5etree__XSLTResultTree;
   __pyx_vtable_4lxml_5etree__XSLTResultTree.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTree;
   __pyx_vtable_4lxml_5etree__XSLTResultTree._saveToStringAndSize = (PyObject *(*)(struct __pyx_obj_4lxml_5etree__XSLTResultTree *, xmlChar **, int *))__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize;
   __pyx_type_4lxml_5etree__XSLTResultTree.tp_base = __pyx_ptype_4lxml_5etree__ElementTree;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(3, 705, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(4, 705, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__XSLTResultTree.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__XSLTResultTree.tp_dictoffset && __pyx_type_4lxml_5etree__XSLTResultTree.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__XSLTResultTree.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResultTree.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(3, 705, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTResultTree, (PyObject *)&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(3, 705, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResultTree.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(4, 705, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTResultTree, (PyObject *)&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) __PYX_ERR(4, 705, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__XSLTResultTree = &__pyx_type_4lxml_5etree__XSLTResultTree;
   __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction = &__pyx_vtable_4lxml_5etree__XSLTProcessingInstruction;
   __pyx_vtable_4lxml_5etree__XSLTProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree_PIBase;
   __pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree_PIBase;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(3, 894, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(4, 894, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_print = 0;
   #endif
   if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_dictoffset && __pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_getattro == PyObject_GenericGetAttr)) {
     __pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_getattro = __Pyx_PyObject_GenericGetAttr;
   }
-  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(3, 894, __pyx_L1_error)
-  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTProcessingInstruction, (PyObject *)&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(3, 894, __pyx_L1_error)
+  if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(4, 894, __pyx_L1_error)
+  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_XSLTProcessingInstruction, (PyObject *)&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) __PYX_ERR(4, 894, __pyx_L1_error)
   __pyx_ptype_4lxml_5etree__XSLTProcessingInstruction = &__pyx_type_4lxml_5etree__XSLTProcessingInstruction;
   __pyx_vtabptr_4lxml_5etree_XSLTExtension = &__pyx_vtable_4lxml_5etree_XSLTExtension;
   __pyx_vtable_4lxml_5etree_XSLTExtension._collectXSLTResultContent = (PyObject *(*)(struct __pyx_obj_4lxml_5etree_XSLTExtension *, struct __pyx_obj_4lxml_5etree__XSLTContext *, xmlNode *, int, int))__pyx_f_4lxml_5etree_13XSLTExtension__collectXSLTResultContent;
@@ -252169,7 +252300,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_1__iter_namespaces.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_1__iter_namespaces = &__pyx_type_4lxml_5etree___pyx_scope_struct_1__iter_namespaces;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_2___aenter__) < 0) __PYX_ERR(9, 1353, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_2___aenter__) < 0) __PYX_ERR(9, 1358, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_2___aenter__.tp_print = 0;
   #endif
@@ -252177,7 +252308,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_2___aenter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_2___aenter__ = &__pyx_type_4lxml_5etree___pyx_scope_struct_2___aenter__;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_3___aexit__) < 0) __PYX_ERR(9, 1364, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_3___aexit__) < 0) __PYX_ERR(9, 1369, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_3___aexit__.tp_print = 0;
   #endif
@@ -252185,7 +252316,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_3___aexit__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_3___aexit__ = &__pyx_type_4lxml_5etree___pyx_scope_struct_3___aexit__;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_4_flush) < 0) __PYX_ERR(9, 1740, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_4_flush) < 0) __PYX_ERR(9, 1745, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_4_flush.tp_print = 0;
   #endif
@@ -252193,7 +252324,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_4_flush.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_4_flush = &__pyx_type_4lxml_5etree___pyx_scope_struct_4_flush;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_5_write_declaration) < 0) __PYX_ERR(9, 1746, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_5_write_declaration) < 0) __PYX_ERR(9, 1751, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_5_write_declaration.tp_print = 0;
   #endif
@@ -252201,7 +252332,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_5_write_declaration.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_5_write_declaration = &__pyx_type_4lxml_5etree___pyx_scope_struct_5_write_declaration;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_6_write_doctype) < 0) __PYX_ERR(9, 1752, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_6_write_doctype) < 0) __PYX_ERR(9, 1757, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_6_write_doctype.tp_print = 0;
   #endif
@@ -252209,7 +252340,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_6_write_doctype.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_6_write_doctype = &__pyx_type_4lxml_5etree___pyx_scope_struct_6_write_doctype;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_7_write) < 0) __PYX_ERR(9, 1758, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_7_write) < 0) __PYX_ERR(9, 1763, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_7_write.tp_print = 0;
   #endif
@@ -252217,7 +252348,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_7_write.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_7_write = &__pyx_type_4lxml_5etree___pyx_scope_struct_7_write;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_8__close) < 0) __PYX_ERR(9, 1771, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_8__close) < 0) __PYX_ERR(9, 1776, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_8__close.tp_print = 0;
   #endif
@@ -252225,7 +252356,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_8__close.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_8__close = &__pyx_type_4lxml_5etree___pyx_scope_struct_8__close;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__) < 0) __PYX_ERR(9, 1791, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__) < 0) __PYX_ERR(9, 1796, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__.tp_print = 0;
   #endif
@@ -252233,7 +252364,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_9___aenter__ = &__pyx_type_4lxml_5etree___pyx_scope_struct_9___aenter__;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__) < 0) __PYX_ERR(9, 1797, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__) < 0) __PYX_ERR(9, 1802, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__.tp_print = 0;
   #endif
@@ -252241,7 +252372,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_10___aexit__ = &__pyx_type_4lxml_5etree___pyx_scope_struct_10___aexit__;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_11___aenter__) < 0) __PYX_ERR(9, 1859, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_11___aenter__) < 0) __PYX_ERR(9, 1864, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_11___aenter__.tp_print = 0;
   #endif
@@ -252249,7 +252380,7 @@ static int __Pyx_modinit_type_init_code(void) {
     __pyx_type_4lxml_5etree___pyx_scope_struct_11___aenter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
   }
   __pyx_ptype_4lxml_5etree___pyx_scope_struct_11___aenter__ = &__pyx_type_4lxml_5etree___pyx_scope_struct_11___aenter__;
-  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_12___aexit__) < 0) __PYX_ERR(9, 1863, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_5etree___pyx_scope_struct_12___aexit__) < 0) __PYX_ERR(9, 1868, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_5etree___pyx_scope_struct_12___aexit__.tp_print = 0;
   #endif
@@ -253786,7 +253917,7 @@ if (!__Pyx_RefNanny) {
  *     ur'^(<\?xml[^>]+)\s+encoding\s*=\s*["\'][^"\']*["\'](\s*\?>|)', re.U)
  * 
  */
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 649, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
   /* "src/lxml/apihelpers.pxi":650
@@ -253796,7 +253927,7 @@ if (!__Pyx_RefNanny) {
  * 
  * cdef object __REPLACE_XML_ENCODING = __RE_XML_ENCODING.sub
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_U); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 650, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_U); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 650, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
 
   /* "src/lxml/apihelpers.pxi":649
@@ -253806,7 +253937,7 @@ if (!__Pyx_RefNanny) {
  *     ur'^(<\?xml[^>]+)\s+encoding\s*=\s*["\'][^"\']*["\'](\s*\?>|)', re.U)
  * 
  */
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 649, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_kp_u_xml_s_encoding_s_s_s);
   __Pyx_GIVEREF(__pyx_kp_u_xml_s_encoding_s_s_s);
@@ -253814,7 +253945,7 @@ if (!__Pyx_RefNanny) {
   __Pyx_GIVEREF(__pyx_t_7);
   PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
   __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 649, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 649, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
@@ -253830,7 +253961,7 @@ if (!__Pyx_RefNanny) {
  * cdef object __HAS_XML_ENCODING = __RE_XML_ENCODING.match
  * 
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_sub); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 652, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_sub); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 652, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING, __pyx_t_7);
@@ -253844,7 +253975,7 @@ if (!__Pyx_RefNanny) {
  * 
  * cdef object _stripEncodingDeclaration(object xml_string):
  */
-  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_match); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 653, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_s_match); if (unlikely(!__pyx_t_7)) __PYX_ERR(6, 653, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree___HAS_XML_ENCODING, __pyx_t_7);
@@ -255758,9 +255889,9 @@ if (!__Pyx_RefNanny) {
  *         u"__deepcopy__(self, memo)"
  *         return self.__copy__()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_11__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 160, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_11__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__380)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 160, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_deepcopy, __pyx_t_2) < 0) __PYX_ERR(6, 160, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_deepcopy, __pyx_t_2) < 0) __PYX_ERR(7, 160, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255771,9 +255902,9 @@ if (!__Pyx_RefNanny) {
  *         u"__copy__(self)"
  *         cdef xmlDoc* c_doc
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_13__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 164, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_13__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 164, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_copy_2, __pyx_t_2) < 0) __PYX_ERR(6, 164, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_copy_2, __pyx_t_2) < 0) __PYX_ERR(7, 164, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255784,9 +255915,9 @@ if (!__Pyx_RefNanny) {
  *         u"""iterchildren(self, tag=None, reversed=False)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_17iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 187, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_17iterchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_iterchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 187, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_iterchildren, __pyx_t_2) < 0) __PYX_ERR(6, 187, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_iterchildren, __pyx_t_2) < 0) __PYX_ERR(7, 187, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255797,9 +255928,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Returns all subelements. The elements are returned in document
  *         order.
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_19getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 199, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_19getchildren, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getchildren, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 199, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getchildren, __pyx_t_2) < 0) __PYX_ERR(6, 199, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getchildren, __pyx_t_2) < 0) __PYX_ERR(7, 199, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255810,9 +255941,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Returns the parent of this element or None for the root element.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_21getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 214, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_21getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 214, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getparent, __pyx_t_2) < 0) __PYX_ERR(6, 214, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getparent, __pyx_t_2) < 0) __PYX_ERR(7, 214, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255823,9 +255954,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Returns the following sibling of this element or None.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_23getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 225, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_23getnext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getnext, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 225, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getnext, __pyx_t_2) < 0) __PYX_ERR(6, 225, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getnext, __pyx_t_2) < 0) __PYX_ERR(7, 225, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255836,9 +255967,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Returns the preceding sibling of this element or None.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_25getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 235, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_ReadOnlyProxy_25getprevious, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyProxy_getprevious, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 235, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getprevious, __pyx_t_2) < 0) __PYX_ERR(6, 235, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyProxy->tp_dict, __pyx_n_s_getprevious, __pyx_t_2) < 0) __PYX_ERR(7, 235, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyProxy);
 
@@ -255849,9 +255980,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Gets an element attribute.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_1get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 304, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_1get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 304, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(6, 304, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(7, 304, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy);
 
@@ -255862,9 +255993,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Gets a list of attribute names. The names are returned in an
  *         arbitrary order (just like for an ordinary Python dictionary).
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_3keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 310, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_3keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__396)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 310, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_keys, __pyx_t_2) < 0) __PYX_ERR(6, 310, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_keys, __pyx_t_2) < 0) __PYX_ERR(7, 310, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy);
 
@@ -255875,9 +256006,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_5values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 317, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_5values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__398)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 317, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_values, __pyx_t_2) < 0) __PYX_ERR(6, 317, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_values, __pyx_t_2) < 0) __PYX_ERR(7, 317, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy);
 
@@ -255888,9 +256019,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Gets element attributes, as a sequence. The attributes are returned
  *         in an arbitrary order.
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_7items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 324, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ReadOnlyElementProxy_7items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ReadOnlyElementProxy_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__400)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 324, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_items, __pyx_t_2) < 0) __PYX_ERR(6, 324, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy->tp_dict, __pyx_n_s_items, __pyx_t_2) < 0) __PYX_ERR(7, 324, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ReadOnlyElementProxy);
 
@@ -255901,9 +256032,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 390, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__402)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 390, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_append, __pyx_t_2) < 0) __PYX_ERR(6, 390, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_append, __pyx_t_2) < 0) __PYX_ERR(7, 390, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper);
 
@@ -255914,9 +256045,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__404)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 407, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_OpaqueDocumentWrapper_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_OpaqueDocumentWrapper_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__404)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 407, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_extend, __pyx_t_2) < 0) __PYX_ERR(6, 407, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper->tp_dict, __pyx_n_s_extend, __pyx_t_2) < 0) __PYX_ERR(7, 407, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__OpaqueDocumentWrapper);
 
@@ -255927,9 +256058,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Append a copy of an Element to the list of children.
  *         """
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 487, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_1append, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_append, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__406)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 487, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_append, __pyx_t_2) < 0) __PYX_ERR(6, 487, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_append, __pyx_t_2) < 0) __PYX_ERR(7, 487, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy);
 
@@ -255940,9 +256071,9 @@ if (!__Pyx_RefNanny) {
  *         u"""Append a copy of all Elements from a sequence to the list of
  *         children.
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_2)) __PYX_ERR(6, 499, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AppendOnlyElementProxy_3extend, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AppendOnlyElementProxy_extend, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__408)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_extend, __pyx_t_2) < 0) __PYX_ERR(6, 499, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy->tp_dict, __pyx_n_s_extend, __pyx_t_2) < 0) __PYX_ERR(7, 499, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AppendOnlyElementProxy);
 
@@ -255953,9 +256084,9 @@ if (!__Pyx_RefNanny) {
  *         u"""set_fallback(self, lookup)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26FallbackElementClassLookup_5set_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FallbackElementClassLookup_set_f, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 248, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26FallbackElementClassLookup_5set_fallback, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FallbackElementClassLookup_set_f, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__410)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 248, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dict, __pyx_n_s_set_fallback, __pyx_t_2) < 0) __PYX_ERR(7, 248, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dict, __pyx_n_s_set_fallback, __pyx_t_2) < 0) __PYX_ERR(8, 248, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_FallbackElementClassLookup);
 
@@ -255966,9 +256097,9 @@ if (!__Pyx_RefNanny) {
  *         u"lookup(self, type, doc, namespace, name)"
  *         return None
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_24CustomElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CustomElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__412)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 430, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_24CustomElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_CustomElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__412)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 430, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_CustomElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_2) < 0) __PYX_ERR(7, 430, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_CustomElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_2) < 0) __PYX_ERR(8, 430, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_CustomElementClassLookup);
 
@@ -255979,9 +256110,9 @@ if (!__Pyx_RefNanny) {
  *         u"""lookup(self, doc, element)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_24PythonElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PythonElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__414)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 512, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_24PythonElementClassLookup_3lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_PythonElementClassLookup_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__414)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PythonElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_2) < 0) __PYX_ERR(7, 512, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_PythonElementClassLookup->tp_dict, __pyx_n_s_lookup, __pyx_t_2) < 0) __PYX_ERR(8, 512, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_PythonElementClassLookup);
 
@@ -255992,10 +256123,10 @@ if (!__Pyx_RefNanny) {
  *     u"""set_element_class_lookup(lookup = None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_43set_element_class_lookup, 0, __pyx_n_s_set_element_class_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 549, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_43set_element_class_lookup, 0, __pyx_n_s_set_element_class_lookup, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__416)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 549, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__417);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_element_class_lookup, __pyx_t_2) < 0) __PYX_ERR(7, 549, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_set_element_class_lookup, __pyx_t_2) < 0) __PYX_ERR(8, 549, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/classlookup.pxi":561
@@ -256005,7 +256136,7 @@ if (!__Pyx_RefNanny) {
  * 
  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)
  */
-  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup)); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 561, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup)); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP, ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_t_2));
@@ -256017,9 +256148,9 @@ if (!__Pyx_RefNanny) {
  * 
  * set_element_class_lookup(DEFAULT_ELEMENT_CLASS_LOOKUP)             # <<<<<<<<<<<<<<
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(7, 563, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_set_element_class_lookup); if (unlikely(!__pyx_t_2)) __PYX_ERR(8, 563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 563, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
@@ -256647,82 +256778,111 @@ if (!__Pyx_RefNanny) {
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_HTMLPullParser);
 
-  /* "src/lxml/saxparser.pxi":804
+  /* "src/lxml/saxparser.pxi":3
+ * # SAX-like interfaces
+ * 
+ * class XMLSyntaxAssertionError(XMLSyntaxError, AssertionError):             # <<<<<<<<<<<<<<
+ *     """
+ *     An XMLSyntaxError that additionally inherits from AssertionError for
+ */
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_XMLSyntaxError); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_INCREF(__pyx_builtin_AssertionError);
+  __Pyx_GIVEREF(__pyx_builtin_AssertionError);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_builtin_AssertionError);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XMLSyntaxAssertionError, __pyx_n_s_XMLSyntaxAssertionError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_An_XMLSyntaxError_that_addition); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_7);
+  __pyx_t_9 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XMLSyntaxAssertionError, __pyx_t_2, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_9);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLSyntaxAssertionError, __pyx_t_9) < 0) __PYX_ERR(3, 3, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+  __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;
+
+  /* "src/lxml/saxparser.pxi":813
  *     # Python level event handlers
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         u"""close(self)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 804, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(8, 804, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_3close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__478)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 813, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(3, 813, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
-  /* "src/lxml/saxparser.pxi":814
+  /* "src/lxml/saxparser.pxi":826
  *         return self._last
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         u"""data(self, data)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_5data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__480)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 814, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_data, __pyx_t_1) < 0) __PYX_ERR(8, 814, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_5data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__480)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_data, __pyx_t_2) < 0) __PYX_ERR(3, 826, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
-  /* "src/lxml/saxparser.pxi":822
+  /* "src/lxml/saxparser.pxi":834
  *         self._handleSaxData(data)
  * 
  *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<<
  *         u"""start(self, tag, attrs, nsmap=None)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_7start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__482)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 822, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_start, __pyx_t_1) < 0) __PYX_ERR(8, 822, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_7start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__482)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 834, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(3, 834, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
-  /* "src/lxml/saxparser.pxi":831
+  /* "src/lxml/saxparser.pxi":843
  *         return self._handleSaxStart(tag, attrs, nsmap)
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
  *         u"""end(self, tag)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_9end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__484)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 831, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_end, __pyx_t_1) < 0) __PYX_ERR(8, 831, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_9end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__484)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 843, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_end, __pyx_t_2) < 0) __PYX_ERR(3, 843, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
-  /* "src/lxml/saxparser.pxi":841
+  /* "src/lxml/saxparser.pxi":853
  *         return element
  * 
  *     def pi(self, target, data=None):             # <<<<<<<<<<<<<<
  *         u"""pi(self, target, data=None)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_11pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__486)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 841, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(8, 841, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_11pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__486)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 853, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(3, 853, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
-  /* "src/lxml/saxparser.pxi":849
+  /* "src/lxml/saxparser.pxi":861
  *         return self._handleSaxPi(target, data)
  * 
  *     def comment(self, comment):             # <<<<<<<<<<<<<<
  *         u"""comment(self, comment)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_13comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__488)); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 849, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_comment, __pyx_t_1) < 0) __PYX_ERR(8, 849, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_11TreeBuilder_13comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_TreeBuilder_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__488)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 861, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_TreeBuilder->tp_dict, __pyx_n_s_comment, __pyx_t_2) < 0) __PYX_ERR(3, 861, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_TreeBuilder);
 
   /* "src/lxml/parsertarget.pxi":4
@@ -256748,22 +256908,22 @@ if (!__Pyx_RefNanny) {
  * except ImportError:
  *     from inspect import getargspec as inspect_getargspec
  */
-      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L21_error)
-      __Pyx_GOTREF(__pyx_t_1);
+      __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 5, __pyx_L21_error)
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_INCREF(__pyx_n_s_getfullargspec);
       __Pyx_GIVEREF(__pyx_n_s_getfullargspec);
-      PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_getfullargspec);
-      __pyx_t_2 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 5, __pyx_L21_error)
-      __Pyx_GOTREF(__pyx_t_2);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getfullargspec); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L21_error)
+      PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_getfullargspec);
+      __pyx_t_1 = __Pyx_patch_inspect(__Pyx_Import(__pyx_n_s_inspect, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 5, __pyx_L21_error)
       __Pyx_GOTREF(__pyx_t_1);
-      __Pyx_INCREF(__pyx_t_1);
+      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getfullargspec); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 5, __pyx_L21_error)
+      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_INCREF(__pyx_t_2);
       __Pyx_XGOTREF(__pyx_v_4lxml_5etree_inspect_getargspec);
-      __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_inspect_getargspec, __pyx_t_1);
-      __Pyx_GIVEREF(__pyx_t_1);
-      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_inspect_getargspec, __pyx_t_2);
+      __Pyx_GIVEREF(__pyx_t_2);
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
       /* "src/lxml/parsertarget.pxi":4
  * 
@@ -256796,9 +256956,9 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.etree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_7) < 0) __PYX_ERR(13, 6, __pyx_L23_except_error)
-      __Pyx_GOTREF(__pyx_t_2);
+      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(13, 6, __pyx_L23_except_error)
       __Pyx_GOTREF(__pyx_t_1);
+      __Pyx_GOTREF(__pyx_t_2);
       __Pyx_GOTREF(__pyx_t_7);
 
       /* "src/lxml/parsertarget.pxi":7
@@ -256824,8 +256984,8 @@ if (!__Pyx_RefNanny) {
       __Pyx_GIVEREF(__pyx_t_9);
       __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
       __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       goto __pyx_L22_exception_handled;
     }
@@ -256864,10 +257024,10 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
   __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
   PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
-  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 10, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_7, __pyx_n_s_TargetParserResult, __pyx_n_s_TargetParserResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 10, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(13, 10, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_7, __pyx_n_s_TargetParserResult, __pyx_n_s_TargetParserResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(13, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
 
   /* "src/lxml/parsertarget.pxi":14
  *     # to push the Python level parser result through the parser
@@ -256878,7 +257038,7 @@ if (!__Pyx_RefNanny) {
  */
   __pyx_t_12 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_19_TargetParserResult_1__init__, 0, __pyx_n_s_TargetParserResult___init, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__490)); if (unlikely(!__pyx_t_12)) __PYX_ERR(13, 14, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
-  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(13, 14, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init, __pyx_t_12) < 0) __PYX_ERR(13, 14, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
 
   /* "src/lxml/parsertarget.pxi":10
@@ -256888,12 +257048,12 @@ if (!__Pyx_RefNanny) {
  *     # Admittedly, this is somewhat ugly, but it's the easiest way
  *     # to push the Python level parser result through the parser
  */
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_TargetParserResult, __pyx_t_7, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(13, 10, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_TargetParserResult, __pyx_t_7, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(13, 10, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_TargetParserResult, __pyx_t_12) < 0) __PYX_ERR(13, 10, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/serializer.pxi":4
@@ -256908,17 +257068,17 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(__pyx_n_s_GzipFile);
   __Pyx_GIVEREF(__pyx_n_s_GzipFile);
   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_GzipFile);
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gzip, __pyx_t_7, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 4, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gzip, __pyx_t_7, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 4, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 4, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GzipFile); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 4, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_t_7);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_GzipFile);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_GzipFile, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_7);
   __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;
 
   /* "src/lxml/serializer.pxi":615
  * 
@@ -256927,18 +257087,18 @@ if (!__Pyx_RefNanny) {
  * 
  * cdef object gzip
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 615, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_n_s_open);
   __Pyx_GIVEREF(__pyx_n_s_open);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_open);
-  __pyx_t_7 = __Pyx_Import(__pyx_n_s_io, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 615, __pyx_L1_error)
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_open);
+  __pyx_t_7 = __Pyx_Import(__pyx_n_s_io, __pyx_t_2, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 615, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_open); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 615, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_open, __pyx_t_1) < 0) __PYX_ERR(9, 615, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_open); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 615, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_open, __pyx_t_2) < 0) __PYX_ERR(9, 615, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/serializer.pxi":618
@@ -256967,17 +257127,17 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(__pyx_n_s_getwriter);
   __Pyx_GIVEREF(__pyx_n_s_getwriter);
   PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_getwriter);
-  __pyx_t_1 = __Pyx_Import(__pyx_n_s_codecs, __pyx_t_7, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 621, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_Import(__pyx_n_s_codecs, __pyx_t_7, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 621, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 621, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_getwriter); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 621, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_INCREF(__pyx_t_7);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_getwriter);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_getwriter, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_7);
   __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;
 
   /* "src/lxml/serializer.pxi":622
  * cdef object getwriter
@@ -256986,12 +257146,12 @@ if (!__Pyx_RefNanny) {
  * 
  * cdef object contextmanager
  */
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_4lxml_5etree_getwriter, __pyx_tuple__491, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 622, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_4lxml_5etree_getwriter, __pyx_tuple__491, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 622, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_utf8_writer);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_utf8_writer, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_utf8_writer, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
 
   /* "src/lxml/serializer.pxi":625
  * 
@@ -257000,21 +257160,21 @@ if (!__Pyx_RefNanny) {
  * 
  * cdef object _open_utf8_file
  */
-  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 625, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 625, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(__pyx_n_s_contextmanager);
   __Pyx_GIVEREF(__pyx_n_s_contextmanager);
-  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_contextmanager);
-  __pyx_t_7 = __Pyx_Import(__pyx_n_s_contextlib, __pyx_t_1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 625, __pyx_L1_error)
+  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_contextmanager);
+  __pyx_t_7 = __Pyx_Import(__pyx_n_s_contextlib, __pyx_t_2, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 625, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_contextmanager); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 625, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_INCREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_7, __pyx_n_s_contextmanager); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 625, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_INCREF(__pyx_t_2);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_contextmanager);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_contextmanager, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_contextmanager, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
   /* "src/lxml/serializer.pxi":630
@@ -257035,13 +257195,13 @@ if (!__Pyx_RefNanny) {
  * def _open_utf8_file(file, compression=0):
  *     if _isString(file):
  */
-  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_v_4lxml_5etree_contextmanager, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 629, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_v_4lxml_5etree_contextmanager, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 629, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__open_utf8_file);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__open_utf8_file, __pyx_t_1);
-  __Pyx_GIVEREF(__pyx_t_1);
-  __pyx_t_1 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__open_utf8_file, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_2);
+  __pyx_t_2 = 0;
 
   /* "src/lxml/serializer.pxi":896
  * # C14N 2.0
@@ -257050,15 +257210,15 @@ if (!__Pyx_RefNanny) {
  *     """Convert XML to its C14N 2.0 serialised form.
  * 
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 896, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_out, ((PyObject *)Py_None)) < 0) __PYX_ERR(9, 896, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_from_file, ((PyObject *)Py_None)) < 0) __PYX_ERR(9, 896, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 896, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_out, ((PyObject *)Py_None)) < 0) __PYX_ERR(9, 896, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_from_file, ((PyObject *)Py_None)) < 0) __PYX_ERR(9, 896, __pyx_L1_error)
   __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_54canonicalize, 0, __pyx_n_s_canonicalize, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__495)); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 896, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__496);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_7, __pyx_t_2);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_canonicalize, __pyx_t_7) < 0) __PYX_ERR(9, 896, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
@@ -257071,27 +257231,27 @@ if (!__Pyx_RefNanny) {
  */
   __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_7)) __PYX_ERR(9, 963, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_UNICODE); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 963, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 963, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_UNICODE); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 963, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 963, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(__pyx_kp_s_w_w);
   __Pyx_GIVEREF(__pyx_kp_s_w_w);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_s_w_w);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 963, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_match); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 963, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_w_w);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 963, __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_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_match); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 963, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__looks_like_prefix_name);
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__looks_like_prefix_name, __pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__looks_like_prefix_name, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
 
   /* "src/lxml/serializer.pxi":1039
  *         self._root_done = False
@@ -257100,452 +257260,452 @@ if (!__Pyx_RefNanny) {
  *         for namespaces in reversed(ns_stack):
  *             if namespaces:  # almost no element declares new namespaces
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_3_iter_namespaces, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget__iter_namespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1039, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_iter_namespaces, __pyx_t_2) < 0) __PYX_ERR(9, 1039, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_3_iter_namespaces, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget__iter_namespace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__66)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1039, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_iter_namespaces, __pyx_t_1) < 0) __PYX_ERR(9, 1039, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1083
- *         raise ValueError(f'Namespace "{uri}" is not declared in scope')
+  /* "src/lxml/serializer.pxi":1088
+ *         raise ValueError(f'Namespace "{uri}" of name "{tag}" is not declared in scope')
  * 
  *     def data(self, data):             # <<<<<<<<<<<<<<
  *         if not self._ignored_depth:
  *             self._data.append(data)
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_6data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__499)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1083, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_data, __pyx_t_2) < 0) __PYX_ERR(9, 1083, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_6data, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_data, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__499)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1088, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_data, __pyx_t_1) < 0) __PYX_ERR(9, 1088, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1101
+  /* "src/lxml/serializer.pxi":1106
  *             self._write(_escape_cdata_c14n(data))
  * 
  *     def start_ns(self, prefix, uri):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             return
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_8start_ns, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_start_ns, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__501)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1101, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_start_ns_2, __pyx_t_2) < 0) __PYX_ERR(9, 1101, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_8start_ns, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_start_ns, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__501)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1106, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_start_ns_2, __pyx_t_1) < 0) __PYX_ERR(9, 1106, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1109
+  /* "src/lxml/serializer.pxi":1114
  *         self._ns_stack[-1].append((uri, prefix))
  * 
  *     def start(self, tag, attrs):             # <<<<<<<<<<<<<<
  *         if self._exclude_tags is not None and (
  *                 self._ignored_depth or tag in self._exclude_tags):
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_10start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__503)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1109, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_start, __pyx_t_2) < 0) __PYX_ERR(9, 1109, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_10start, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_start, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__503)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1114, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_start, __pyx_t_1) < 0) __PYX_ERR(9, 1114, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1194
+  /* "src/lxml/serializer.pxi":1199
  *         self._ns_stack.append([])
  * 
  *     def end(self, tag):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             self._ignored_depth -= 1
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_12end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__505)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1194, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_end, __pyx_t_2) < 0) __PYX_ERR(9, 1194, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_12end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_end, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__505)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1199, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_end, __pyx_t_1) < 0) __PYX_ERR(9, 1199, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1206
+  /* "src/lxml/serializer.pxi":1211
  *         self._ns_stack.pop()
  * 
  *     def comment(self, text):             # <<<<<<<<<<<<<<
  *         if not self._with_comments:
  *             return
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_14comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__507)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1206, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_comment, __pyx_t_2) < 0) __PYX_ERR(9, 1206, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_14comment, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_comment, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__507)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1211, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_comment, __pyx_t_1) < 0) __PYX_ERR(9, 1211, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1219
+  /* "src/lxml/serializer.pxi":1224
  *             self._write(u'\n')
  * 
  *     def pi(self, target, data):             # <<<<<<<<<<<<<<
  *         if self._ignored_depth:
  *             return
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_16pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__509)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1219, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(9, 1219, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_16pi, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_pi, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__509)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1224, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_pi, __pyx_t_1) < 0) __PYX_ERR(9, 1224, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1231
+  /* "src/lxml/serializer.pxi":1236
  *             self._write(u'\n')
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         return None
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_18close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__511)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1231, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(9, 1231, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16C14NWriterTarget_18close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_C14NWriterTarget_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__511)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_C14NWriterTarget->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(9, 1236, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_C14NWriterTarget);
 
-  /* "src/lxml/serializer.pxi":1338
+  /* "src/lxml/serializer.pxi":1343
  *         self.method = OUTPUT_METHOD_XML
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         assert self.output_file is not None
  *         self.writer = _IncrementalFileWriter(
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__513)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1338, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(9, 1338, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__513)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1343, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(9, 1343, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_xmlfile);
 
-  /* "src/lxml/serializer.pxi":1345
+  /* "src/lxml/serializer.pxi":1350
  *         return self.writer
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self.writer is not None:
  *             old_writer, self.writer = self.writer, None
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1345, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(9, 1345, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__515)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1350, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(9, 1350, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_xmlfile);
 
-  /* "src/lxml/serializer.pxi":1353
+  /* "src/lxml/serializer.pxi":1358
  *                 self.output_file = None
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         assert self.output_file is not None
  *         if isinstance(self.output_file, basestring):
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1353, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aenter, __pyx_t_2) < 0) __PYX_ERR(9, 1353, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__78)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1358, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aenter, __pyx_t_1) < 0) __PYX_ERR(9, 1358, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_xmlfile);
 
-  /* "src/lxml/serializer.pxi":1364
+  /* "src/lxml/serializer.pxi":1369
  *         return self.async_writer
  * 
  *     async def __aexit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self.async_writer is not None:
  *             old_writer, self.async_writer = self.async_writer, None
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1364, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aexit, __pyx_t_2) < 0) __PYX_ERR(9, 1364, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7xmlfile_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_xmlfile___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1369, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_xmlfile->tp_dict, __pyx_n_s_aexit, __pyx_t_1) < 0) __PYX_ERR(9, 1369, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_xmlfile);
 
-  /* "src/lxml/serializer.pxi":1421
+  /* "src/lxml/serializer.pxi":1426
  *             tree.xmlOutputBufferClose(self._c_out)
  * 
  *     def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
  *         """write_declaration(self, version=None, standalone=None, doctype=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_5write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_dec, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__519)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1421, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_2) < 0) __PYX_ERR(9, 1421, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_5write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_dec, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__519)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_1) < 0) __PYX_ERR(9, 1426, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1450
+  /* "src/lxml/serializer.pxi":1455
  *         self._handle_error(self._c_out.error)
  * 
  *     def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
  *         """write_doctype(self, doctype)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_7write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_doc, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__521)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1450, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_2) < 0) __PYX_ERR(9, 1450, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_7write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write_doc, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__521)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1455, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_1) < 0) __PYX_ERR(9, 1455, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1467
+  /* "src/lxml/serializer.pxi":1472
  *         self._handle_error(self._c_out.error)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
  *         """method(self, method)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_9method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_method, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__523)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1467, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_2) < 0) __PYX_ERR(9, 1467, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_9method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_method, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__523)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1472, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_1) < 0) __PYX_ERR(9, 1472, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1477
+  /* "src/lxml/serializer.pxi":1482
  *         return _MethodChanger(self, c_method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
  *         """element(self, tag, attrib=None, nsmap=None, method, **_extra)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_11element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__525)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1477, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_2) < 0) __PYX_ERR(9, 1477, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_11element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_element, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__525)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1482, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_1) < 0) __PYX_ERR(9, 1482, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1614
+  /* "src/lxml/serializer.pxi":1619
  *         return flat_namespaces_map, new_namespaces
  * 
  *     def write(self, *args, bint with_tail=True, bint pretty_print=False, method=None):             # <<<<<<<<<<<<<<
  *         """write(self, *args, with_tail=True, pretty_print=False, method=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_13write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__527)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1614, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(9, 1614, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_13write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__527)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1619, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(9, 1619, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1661
+  /* "src/lxml/serializer.pxi":1666
  *             self._handle_error(self._c_out.error)
  * 
  *     def flush(self):             # <<<<<<<<<<<<<<
  *         """flush(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_15flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_flush, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__529)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1661, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_2) < 0) __PYX_ERR(9, 1661, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_22_IncrementalFileWriter_15flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IncrementalFileWriter_flush, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__529)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1666, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_1) < 0) __PYX_ERR(9, 1666, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1708
+  /* "src/lxml/serializer.pxi":1713
  *         return data
  * 
  *     def write(self, data):             # <<<<<<<<<<<<<<
  *         self._data.append(data)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_3write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__531)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1708, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(9, 1708, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_3write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_write, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__531)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1713, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(9, 1713, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncDataWriter);
 
-  /* "src/lxml/serializer.pxi":1711
+  /* "src/lxml/serializer.pxi":1716
  *         self._data.append(data)
  * 
  *     def close(self):             # <<<<<<<<<<<<<<
  *         pass
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__533)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1711, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_close, __pyx_t_2) < 0) __PYX_ERR(9, 1711, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_16_AsyncDataWriter_5close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncDataWriter_close, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__533)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1716, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncDataWriter->tp_dict, __pyx_n_s_close, __pyx_t_1) < 0) __PYX_ERR(9, 1716, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncDataWriter);
 
-  /* "src/lxml/serializer.pxi":1740
+  /* "src/lxml/serializer.pxi":1745
  *         return None
  * 
  *     async def flush(self):             # <<<<<<<<<<<<<<
  *         self._writer.flush()
  *         data = self._buffer.collect()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_3flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_flus, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1740, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_2) < 0) __PYX_ERR(9, 1740, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_3flush, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_flus, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__84)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1745, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_flush, __pyx_t_1) < 0) __PYX_ERR(9, 1745, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1746
+  /* "src/lxml/serializer.pxi":1751
  *             await self._async_outfile.write(data)
  * 
  *     async def write_declaration(self, version=None, standalone=None, doctype=None):             # <<<<<<<<<<<<<<
  *         self._writer.write_declaration(version, standalone, doctype)
  *         data = self._flush()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1746, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_2) < 0) __PYX_ERR(9, 1746, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_6write_declaration, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1751, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_declaration, __pyx_t_1) < 0) __PYX_ERR(9, 1751, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1752
+  /* "src/lxml/serializer.pxi":1757
  *             await self._async_outfile.write(data)
  * 
  *     async def write_doctype(self, doctype):             # <<<<<<<<<<<<<<
  *         self._writer.write_doctype(doctype)
  *         data = self._flush()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_9write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1752, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_2) < 0) __PYX_ERR(9, 1752, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_9write_doctype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_2, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__86)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1757, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write_doctype, __pyx_t_1) < 0) __PYX_ERR(9, 1757, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1758
+  /* "src/lxml/serializer.pxi":1763
  *             await self._async_outfile.write(data)
  * 
  *     async def write(self, *args, with_tail=True, pretty_print=False, method=None):             # <<<<<<<<<<<<<<
  *         self._writer.write(*args, with_tail=with_tail, pretty_print=pretty_print, method=method)
  *         data = self._flush()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_12write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1758, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_2) < 0) __PYX_ERR(9, 1758, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_12write, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_writ_3, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1763, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_write, __pyx_t_1) < 0) __PYX_ERR(9, 1763, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1764
+  /* "src/lxml/serializer.pxi":1769
  *             await self._async_outfile.write(data)
  * 
  *     def method(self, method):             # <<<<<<<<<<<<<<
  *         return self._writer.method(method)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_15method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_meth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__539)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1764, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_2) < 0) __PYX_ERR(9, 1764, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_15method, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_meth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__539)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1769, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_method, __pyx_t_1) < 0) __PYX_ERR(9, 1769, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1767
+  /* "src/lxml/serializer.pxi":1772
  *         return self._writer.method(method)
  * 
  *     def element(self, tag, attrib=None, nsmap=None, method=None, **_extra):             # <<<<<<<<<<<<<<
  *         element_writer = self._writer.element(tag, attrib, nsmap, method, **_extra)
  *         return _AsyncFileWriterElement(element_writer, self)
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_17element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_elem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__541)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1767, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_2) < 0) __PYX_ERR(9, 1767, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_17element, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter_elem, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__541)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1772, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_element, __pyx_t_1) < 0) __PYX_ERR(9, 1772, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1771
+  /* "src/lxml/serializer.pxi":1776
  *         return _AsyncFileWriterElement(element_writer, self)
  * 
  *     async def _close(self, bint raise_on_error):             # <<<<<<<<<<<<<<
  *         self._writer._close(raise_on_error)
  *         data = self._buffer.collect()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_19_close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter__clo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1771, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_close_2, __pyx_t_2) < 0) __PYX_ERR(9, 1771, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_27_AsyncIncrementalFileWriter_19_close, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncIncrementalFileWriter__clo, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1776, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter->tp_dict, __pyx_n_s_close_2, __pyx_t_1) < 0) __PYX_ERR(9, 1776, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncIncrementalFileWriter);
 
-  /* "src/lxml/serializer.pxi":1791
+  /* "src/lxml/serializer.pxi":1796
  *         self._writer = writer
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         self._element_writer.__enter__()
  *         data = self._writer._flush()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_3__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1791, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aenter, __pyx_t_2) < 0) __PYX_ERR(9, 1791, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_3__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1796, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aenter, __pyx_t_1) < 0) __PYX_ERR(9, 1796, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncFileWriterElement);
 
-  /* "src/lxml/serializer.pxi":1797
+  /* "src/lxml/serializer.pxi":1802
  *             await self._writer._async_outfile.write(data)
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
  *         self._element_writer.__exit__(*args)
  *         data = self._writer._flush()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_6__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1797, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aexit, __pyx_t_2) < 0) __PYX_ERR(9, 1797, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_23_AsyncFileWriterElement_6__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AsyncFileWriterElement___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1802, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__AsyncFileWriterElement->tp_dict, __pyx_n_s_aexit, __pyx_t_1) < 0) __PYX_ERR(9, 1802, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__AsyncFileWriterElement);
 
-  /* "src/lxml/serializer.pxi":1819
+  /* "src/lxml/serializer.pxi":1824
  *         self._old_method = writer._method
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         self._writer._method = self._new_method
  *         self._writer._write_start_element(self._element)
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__546)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1819, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(9, 1819, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__546)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1824, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(9, 1824, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__FileWriterElement);
 
-  /* "src/lxml/serializer.pxi":1823
+  /* "src/lxml/serializer.pxi":1828
  *         self._writer._write_start_element(self._element)
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         self._writer._write_end_element(self._element)
  *         self._writer._method = self._old_method
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__548)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1823, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(9, 1823, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_18_FileWriterElement_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FileWriterElement___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__548)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1828, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__FileWriterElement->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(9, 1828, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__FileWriterElement);
 
-  /* "src/lxml/serializer.pxi":1845
+  /* "src/lxml/serializer.pxi":1850
  *         self._exited = False
  * 
  *     def __enter__(self):             # <<<<<<<<<<<<<<
  *         if self._entered:
  *             raise LxmlSyntaxError("Inconsistent enter action in context manager")
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__550)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1845, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_enter, __pyx_t_2) < 0) __PYX_ERR(9, 1845, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_3__enter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___enter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__550)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1850, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_enter, __pyx_t_1) < 0) __PYX_ERR(9, 1850, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MethodChanger);
 
-  /* "src/lxml/serializer.pxi":1851
+  /* "src/lxml/serializer.pxi":1856
  *         self._entered = True
  * 
  *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
  *         if self._exited:
  *             raise LxmlSyntaxError("Inconsistent exit action in context manager")
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__552)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1851, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_exit, __pyx_t_2) < 0) __PYX_ERR(9, 1851, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_5__exit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___exit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__552)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1856, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_exit, __pyx_t_1) < 0) __PYX_ERR(9, 1856, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MethodChanger);
 
-  /* "src/lxml/serializer.pxi":1859
+  /* "src/lxml/serializer.pxi":1864
  *         self._exited = True
  * 
  *     async def __aenter__(self):             # <<<<<<<<<<<<<<
  *         # for your async convenience
  *         return self.__enter__()
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1859, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aenter, __pyx_t_2) < 0) __PYX_ERR(9, 1859, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_7__aenter__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aenter, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1864, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aenter, __pyx_t_1) < 0) __PYX_ERR(9, 1864, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MethodChanger);
 
-  /* "src/lxml/serializer.pxi":1863
+  /* "src/lxml/serializer.pxi":1868
  *         return self.__enter__()
  * 
  *     async def __aexit__(self, *args):             # <<<<<<<<<<<<<<
  *         # for your async convenience
  *         return self.__exit__(*args)
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_2)) __PYX_ERR(9, 1863, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aexit, __pyx_t_2) < 0) __PYX_ERR(9, 1863, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_14_MethodChanger_10__aexit__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MethodChanger___aexit, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 1868, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MethodChanger->tp_dict, __pyx_n_s_aexit, __pyx_t_1) < 0) __PYX_ERR(9, 1868, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MethodChanger);
 
   /* "src/lxml/iterparse.pxi":148
@@ -257555,10 +257715,10 @@ if (!__Pyx_RefNanny) {
  *         u"""set_element_class_lookup(self, lookup = None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9iterparse_3set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_set_element_class_look, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__556)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 148, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_set_element_class_lookup, __pyx_t_2) < 0) __PYX_ERR(14, 148, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9iterparse_3set_element_class_lookup, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_set_element_class_look, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__556)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 148, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_set_element_class_lookup, __pyx_t_1) < 0) __PYX_ERR(14, 148, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_iterparse);
 
   /* "src/lxml/iterparse.pxi":157
@@ -257568,10 +257728,10 @@ if (!__Pyx_RefNanny) {
  *         u"""makeelement(self, _tag, attrib=None, nsmap=None, **_extra)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9iterparse_5makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__558)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 157, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_makeelement, __pyx_t_2) < 0) __PYX_ERR(14, 157, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9iterparse_5makeelement, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterparse_makeelement, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__558)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 157, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterparse->tp_dict, __pyx_n_s_makeelement, __pyx_t_1) < 0) __PYX_ERR(14, 157, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_iterparse);
 
   /* "src/lxml/iterparse.pxi":374
@@ -257581,10 +257741,10 @@ if (!__Pyx_RefNanny) {
  *         """Prevent descending into the current subtree.
  *         Instead, the next returned event will be the 'end' event of the current element
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_8iterwalk_7skip_subtree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterwalk_skip_subtree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__560)); if (unlikely(!__pyx_t_2)) __PYX_ERR(14, 374, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterwalk->tp_dict, __pyx_n_s_skip_subtree, __pyx_t_2) < 0) __PYX_ERR(14, 374, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_8iterwalk_7skip_subtree, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_iterwalk_skip_subtree, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__560)); if (unlikely(!__pyx_t_1)) __PYX_ERR(14, 374, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_iterwalk->tp_dict, __pyx_n_s_skip_subtree, __pyx_t_1) < 0) __PYX_ERR(14, 374, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_iterwalk);
 
   /* "src/lxml/xmlid.pxi":3
@@ -257594,16 +257754,16 @@ if (!__Pyx_RefNanny) {
  *     u"""XMLID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_56XMLID, 0, __pyx_n_s_XMLID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__562)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 3, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__563);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLID, __pyx_t_1) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_56XMLID, 0, __pyx_n_s_XMLID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__562)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__563);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLID, __pyx_t_2) < 0) __PYX_ERR(15, 3, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xmlid.pxi":24
  *     return root, dic
@@ -257612,16 +257772,16 @@ if (!__Pyx_RefNanny) {
  *     u"""XMLDTDID(text, parser=None, base_url=None)
  * 
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 24, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 24, __pyx_L1_error)
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_58XMLDTDID, 0, __pyx_n_s_XMLDTDID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__565)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 24, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 24, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__566);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLDTDID, __pyx_t_2) < 0) __PYX_ERR(15, 24, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 24, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_58XMLDTDID, 0, __pyx_n_s_XMLDTDID, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__565)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__566);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XMLDTDID, __pyx_t_1) < 0) __PYX_ERR(15, 24, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/xmlid.pxi":44
  *         return root, _IDDict(root)
@@ -257630,16 +257790,16 @@ if (!__Pyx_RefNanny) {
  *     u"""parseid(source, parser=None)
  * 
  */
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 44, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 44, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_60parseid, 0, __pyx_n_s_parseid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__568)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 44, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__569);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseid, __pyx_t_1) < 0) __PYX_ERR(15, 44, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_base_url, ((PyObject *)Py_None)) < 0) __PYX_ERR(15, 44, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_60parseid, 0, __pyx_n_s_parseid, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__568)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 44, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__569);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_parseid, __pyx_t_2) < 0) __PYX_ERR(15, 44, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xmlid.pxi":78
  *         self._items = None
@@ -257648,10 +257808,10 @@ if (!__Pyx_RefNanny) {
  *         return _IDDict(self._doc)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__571)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 78, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_copy, __pyx_t_1) < 0) __PYX_ERR(15, 78, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__571)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 78, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_copy, __pyx_t_2) < 0) __PYX_ERR(15, 78, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":95
@@ -257661,10 +257821,10 @@ if (!__Pyx_RefNanny) {
  *         return self[id_name]
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__573)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 95, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_get, __pyx_t_1) < 0) __PYX_ERR(15, 95, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_get, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__573)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 95, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(15, 95, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":105
@@ -257674,10 +257834,10 @@ if (!__Pyx_RefNanny) {
  *         return id_name in self
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_11has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__575)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 105, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_has_key, __pyx_t_1) < 0) __PYX_ERR(15, 105, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_11has_key, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_has_key, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__575)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 105, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_has_key, __pyx_t_2) < 0) __PYX_ERR(15, 105, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":111
@@ -257687,10 +257847,10 @@ if (!__Pyx_RefNanny) {
  *         if self._keys is None:
  *             self._keys = self._build_keys()
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__577)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 111, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_keys, __pyx_t_1) < 0) __PYX_ERR(15, 111, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_15keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_keys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__577)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 111, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_keys, __pyx_t_2) < 0) __PYX_ERR(15, 111, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":121
@@ -257700,10 +257860,10 @@ if (!__Pyx_RefNanny) {
  *         return self
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_19iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__579)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 121, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iterkeys, __pyx_t_1) < 0) __PYX_ERR(15, 121, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_19iterkeys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iterkeys, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__579)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 121, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iterkeys, __pyx_t_2) < 0) __PYX_ERR(15, 121, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":129
@@ -257713,10 +257873,10 @@ if (!__Pyx_RefNanny) {
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_23items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__581)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 129, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_items, __pyx_t_1) < 0) __PYX_ERR(15, 129, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_23items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_items, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__581)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 129, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_items, __pyx_t_2) < 0) __PYX_ERR(15, 129, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":134
@@ -257726,10 +257886,10 @@ if (!__Pyx_RefNanny) {
  *         if self._items is None:
  *             self._items = self._build_items()
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_25iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__583)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 134, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iteritems, __pyx_t_1) < 0) __PYX_ERR(15, 134, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_25iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_iteritems, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__583)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 134, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(15, 134, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":139
@@ -257739,10 +257899,10 @@ if (!__Pyx_RefNanny) {
  *         cdef list values = []
  *         if self._items is None:
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_27values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__585)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 139, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_values, __pyx_t_1) < 0) __PYX_ERR(15, 139, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_27values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_values, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__585)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 139, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_values, __pyx_t_2) < 0) __PYX_ERR(15, 139, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/xmlid.pxi":149
@@ -257752,10 +257912,10 @@ if (!__Pyx_RefNanny) {
  *         return iter(self.values())
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_29itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__587)); if (unlikely(!__pyx_t_1)) __PYX_ERR(15, 149, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_itervalues, __pyx_t_1) < 0) __PYX_ERR(15, 149, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7_IDDict_29itervalues, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_IDDict_itervalues, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__587)); if (unlikely(!__pyx_t_2)) __PYX_ERR(15, 149, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__IDDict->tp_dict, __pyx_n_s_itervalues, __pyx_t_2) < 0) __PYX_ERR(15, 149, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__IDDict);
 
   /* "src/lxml/cleanup.pxi":3
@@ -257765,11 +257925,11 @@ if (!__Pyx_RefNanny) {
  *     u"""cleanup_namespaces(tree_or_element, top_nsmap=None, keep_ns_prefixes=None)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_62cleanup_namespaces, 0, __pyx_n_s_cleanup_namespaces, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__589)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__590);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup_namespaces, __pyx_t_1) < 0) __PYX_ERR(17, 3, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_62cleanup_namespaces, 0, __pyx_n_s_cleanup_namespaces, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__589)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__590);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cleanup_namespaces, __pyx_t_2) < 0) __PYX_ERR(17, 3, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/cleanup.pxi":33
  * 
@@ -257778,10 +257938,10 @@ if (!__Pyx_RefNanny) {
  *     u"""strip_attributes(tree_or_element, *attribute_names)
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_64strip_attributes, 0, __pyx_n_s_strip_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__592)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 33, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_attributes, __pyx_t_1) < 0) __PYX_ERR(17, 33, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_64strip_attributes, 0, __pyx_n_s_strip_attributes, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__592)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 33, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_attributes, __pyx_t_2) < 0) __PYX_ERR(17, 33, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/cleanup.pxi":74
  * 
@@ -257790,18 +257950,18 @@ if (!__Pyx_RefNanny) {
  *     u"""strip_elements(tree_or_element, *tag_names, with_tail=True)
  * 
  */
-  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 74, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 74, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_with_tail, __pyx_t_2) < 0) __PYX_ERR(17, 74, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_66strip_elements, 0, __pyx_n_s_strip_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__594)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 74, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
+  __pyx_t_1 = __Pyx_PyBool_FromLong(((int)1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_with_tail, __pyx_t_1) < 0) __PYX_ERR(17, 74, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_elements, __pyx_t_2) < 0) __PYX_ERR(17, 74, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_66strip_elements, 0, __pyx_n_s_strip_elements, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__594)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 74, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_elements, __pyx_t_1) < 0) __PYX_ERR(17, 74, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/cleanup.pxi":145
  * 
@@ -257810,10 +257970,10 @@ if (!__Pyx_RefNanny) {
  *     u"""strip_tags(tree_or_element, *tag_names)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_68strip_tags, 0, __pyx_n_s_strip_tags, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__596)); if (unlikely(!__pyx_t_2)) __PYX_ERR(17, 145, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_tags, __pyx_t_2) < 0) __PYX_ERR(17, 145, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_68strip_tags, 0, __pyx_n_s_strip_tags, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__596)); if (unlikely(!__pyx_t_1)) __PYX_ERR(17, 145, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_strip_tags, __pyx_t_1) < 0) __PYX_ERR(17, 145, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/extensions.pxi":368
  * 
@@ -257834,16 +257994,16 @@ if (!__Pyx_RefNanny) {
  *     u"""Extension(module, function_mapping=None, ns=None)
  * 
  */
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 426, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ns, ((PyObject *)Py_None)) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_70Extension, 0, __pyx_n_s_Extension, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__599)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 426, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 426, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__600);
-  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_1, __pyx_t_2);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Extension, __pyx_t_1) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_ns, ((PyObject *)Py_None)) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_70Extension, 0, __pyx_n_s_Extension, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__599)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 426, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__600);
+  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_1);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Extension, __pyx_t_2) < 0) __PYX_ERR(10, 426, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/extensions.pxi":498
  *         return rexp_compiled
@@ -257852,10 +258012,10 @@ if (!__Pyx_RefNanny) {
  *         flags = self._make_string(flags)
  *         s = self._make_string(s)
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_3test, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_test, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__602)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 498, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(10, 498, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_3test, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_test, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__602)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 498, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(10, 498, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":507
@@ -257865,10 +258025,10 @@ if (!__Pyx_RefNanny) {
  *         cdef list result_list
  *         flags = self._make_string(flags)
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_5match, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_match, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__604)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 507, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_match, __pyx_t_1) < 0) __PYX_ERR(10, 507, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_5match, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_match, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__604)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 507, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_match, __pyx_t_2) < 0) __PYX_ERR(10, 507, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":533
@@ -257878,10 +258038,10 @@ if (!__Pyx_RefNanny) {
  *         replacement = self._make_string(replacement)
  *         flags = self._make_string(flags)
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_7replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__606)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 533, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_replace, __pyx_t_1) < 0) __PYX_ERR(10, 533, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_12_ExsltRegExp_7replace, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ExsltRegExp_replace, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__606)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 533, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ExsltRegExp->tp_dict, __pyx_n_s_replace, __pyx_t_2) < 0) __PYX_ERR(10, 533, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ExsltRegExp);
 
   /* "src/lxml/extensions.pxi":730
@@ -257891,10 +258051,10 @@ if (!__Pyx_RefNanny) {
  *         return self._parent
  * 
  */
-  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ElementUnicodeResult_1getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementUnicodeResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__608)); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 730, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementUnicodeResult->tp_dict, __pyx_n_s_getparent, __pyx_t_1) < 0) __PYX_ERR(10, 730, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_21_ElementUnicodeResult_1getparent, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_ElementUnicodeResult_getparent, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__608)); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 730, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__ElementUnicodeResult->tp_dict, __pyx_n_s_getparent, __pyx_t_2) < 0) __PYX_ERR(10, 730, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__ElementUnicodeResult);
 
   /* "src/lxml/extensions.pxi":734
@@ -257914,14 +258074,14 @@ if (!__Pyx_RefNanny) {
  *         # we need to use a Python class here, or PyPy will crash on creation
  *         # https://bitbucket.org/pypy/pypy/issues/2021/pypy3-pytype_ready-crashes-for-extension
  */
-    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 735, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 735, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_2);
     __Pyx_INCREF(((PyObject *)(&PyUnicode_Type)));
     __Pyx_GIVEREF(((PyObject *)(&PyUnicode_Type)));
-    PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyUnicode_Type)));
-    __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 735, __pyx_L1_error)
-    __Pyx_GOTREF(__pyx_t_2);
-    __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_PyElementUnicodeResult, __pyx_n_s_PyElementUnicodeResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 735, __pyx_L1_error)
+    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyUnicode_Type)));
+    __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 735, __pyx_L1_error)
+    __Pyx_GOTREF(__pyx_t_1);
+    __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_PyElementUnicodeResult, __pyx_n_s_PyElementUnicodeResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_7);
 
     /* "src/lxml/extensions.pxi":738
@@ -257943,15 +258103,15 @@ if (!__Pyx_RefNanny) {
  *         # we need to use a Python class here, or PyPy will crash on creation
  *         # https://bitbucket.org/pypy/pypy/issues/2021/pypy3-pytype_ready-crashes-for-extension
  */
-    __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_PyElementUnicodeResult, __pyx_t_1, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 735, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_PyElementUnicodeResult, __pyx_t_2, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 735, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_12);
     __Pyx_XGOTREF(__pyx_v_4lxml_5etree__PyElementUnicodeResult);
     __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__PyElementUnicodeResult, __pyx_t_12);
     __Pyx_GIVEREF(__pyx_t_12);
     __pyx_t_12 = 0;
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
     /* "src/lxml/extensions.pxi":734
  * 
@@ -257969,14 +258129,14 @@ if (!__Pyx_RefNanny) {
  *     # we need to use a Python class here, bytes cannot be C-subclassed
  *     # in Pyrex/Cython
  */
-  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 741, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 741, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
   __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
   __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
-  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)(&PyBytes_Type)));
-  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(10, 741, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ElementStringResult, __pyx_n_s_ElementStringResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 741, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyBytes_Type)));
+  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 741, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ElementStringResult, __pyx_n_s_ElementStringResult, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(10, 741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
 
   /* "src/lxml/extensions.pxi":744
@@ -257998,13 +258158,13 @@ if (!__Pyx_RefNanny) {
  *     # we need to use a Python class here, bytes cannot be C-subclassed
  *     # in Pyrex/Cython
  */
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ElementStringResult, __pyx_t_1, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 741, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ElementStringResult, __pyx_t_2, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(10, 741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_ElementStringResult, __pyx_t_12) < 0) __PYX_ERR(10, 741, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
   /* "src/lxml/xpath.pxi":3
  * # XPath evaluation
@@ -258013,27 +258173,27 @@ if (!__Pyx_RefNanny) {
  *     pass
  * 
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_LxmlSyntaxError); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
-  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
-  __pyx_t_1 = 0;
-  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 3, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_XPathSyntaxError, __pyx_n_s_XPathSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 3, __pyx_L1_error)
+  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_ptype_4lxml_5etree_XPathError));
+  __pyx_t_2 = 0;
+  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_XPathSyntaxError, __pyx_n_s_XPathSyntaxError, (PyObject *) NULL, __pyx_n_s_lxml_etree, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_XPathSyntaxError, __pyx_t_2, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(18, 3, __pyx_L1_error)
+  __pyx_t_12 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_XPathSyntaxError, __pyx_t_1, __pyx_t_7, NULL, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_12);
   if (PyDict_SetItem(__pyx_d, __pyx_n_s_XPathSyntaxError, __pyx_t_12) < 0) __PYX_ERR(18, 3, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
   __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;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/xpath.pxi":10
  * 
@@ -258042,8 +258202,8 @@ if (!__Pyx_RefNanny) {
  *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
  */
-  __pyx_t_2 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_NUMBER_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 10, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_NUMBER_ERROR); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 10, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
 
   /* "src/lxml/xpath.pxi":11
  * cdef object _XPATH_SYNTAX_ERRORS = (
@@ -258052,8 +258212,8 @@ if (!__Pyx_RefNanny) {
  *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
  *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
  */
-  __pyx_t_1 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 11, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 11, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
 
   /* "src/lxml/xpath.pxi":12
  *     xmlerror.XML_XPATH_NUMBER_ERROR,
@@ -258104,10 +258264,10 @@ if (!__Pyx_RefNanny) {
  */
   __pyx_t_13 = PyTuple_New(6); if (unlikely(!__pyx_t_13)) __PYX_ERR(18, 10, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_13);
-  __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_7);
   PyTuple_SET_ITEM(__pyx_t_13, 2, __pyx_t_7);
   __Pyx_GIVEREF(__pyx_t_12);
@@ -258116,8 +258276,8 @@ if (!__Pyx_RefNanny) {
   PyTuple_SET_ITEM(__pyx_t_13, 4, __pyx_t_9);
   __Pyx_GIVEREF(__pyx_t_8);
   PyTuple_SET_ITEM(__pyx_t_13, 5, __pyx_t_8);
-  __pyx_t_2 = 0;
   __pyx_t_1 = 0;
+  __pyx_t_2 = 0;
   __pyx_t_7 = 0;
   __pyx_t_12 = 0;
   __pyx_t_9 = 0;
@@ -258184,8 +258344,8 @@ if (!__Pyx_RefNanny) {
  *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
  */
-  __pyx_t_1 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 24, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 24, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
 
   /* "src/lxml/xpath.pxi":25
  *     xmlerror.XML_XPATH_INVALID_TYPE,
@@ -258194,8 +258354,8 @@ if (!__Pyx_RefNanny) {
  *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
  * )
  */
-  __pyx_t_2 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_CTXT_SIZE); if (unlikely(!__pyx_t_2)) __PYX_ERR(18, 25, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyInt_From_xmlParserErrors(XML_XPATH_INVALID_CTXT_SIZE); if (unlikely(!__pyx_t_1)) __PYX_ERR(18, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
 
   /* "src/lxml/xpath.pxi":26
  *     xmlerror.XML_XPATH_INVALID_ARITY,
@@ -258226,10 +258386,10 @@ if (!__Pyx_RefNanny) {
   PyTuple_SET_ITEM(__pyx_t_15, 3, __pyx_t_12);
   __Pyx_GIVEREF(__pyx_t_7);
   PyTuple_SET_ITEM(__pyx_t_15, 4, __pyx_t_7);
-  __Pyx_GIVEREF(__pyx_t_1);
-  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_2);
-  PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_2);
+  PyTuple_SET_ITEM(__pyx_t_15, 5, __pyx_t_2);
+  __Pyx_GIVEREF(__pyx_t_1);
+  PyTuple_SET_ITEM(__pyx_t_15, 6, __pyx_t_1);
   __Pyx_GIVEREF(__pyx_t_14);
   PyTuple_SET_ITEM(__pyx_t_15, 7, __pyx_t_14);
   __pyx_t_13 = 0;
@@ -258237,8 +258397,8 @@ if (!__Pyx_RefNanny) {
   __pyx_t_9 = 0;
   __pyx_t_12 = 0;
   __pyx_t_7 = 0;
-  __pyx_t_1 = 0;
   __pyx_t_2 = 0;
+  __pyx_t_1 = 0;
   __pyx_t_14 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS, __pyx_t_15);
@@ -258351,7 +258511,7 @@ if (!__Pyx_RefNanny) {
  *     """Error serialising an XSLT result.
  *     """
  */
-  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 18, __pyx_L1_error)
+  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTError));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTError));
@@ -258359,15 +258519,15 @@ if (!__Pyx_RefNanny) {
   __Pyx_INCREF(((PyObject *)__pyx_ptype_4lxml_5etree_SerialisationError));
   __Pyx_GIVEREF(((PyObject *)__pyx_ptype_4lxml_5etree_SerialisationError));
   PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_ptype_4lxml_5etree_SerialisationError));
-  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 18, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CalculateMetaclass(NULL, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_14, __pyx_n_s_XSLTSaveError, __pyx_n_s_XSLTSaveError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Error_serialising_an_XSLT_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 18, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_XSLTSaveError, __pyx_t_14, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 18, __pyx_L1_error)
+  __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_15, __pyx_t_14, __pyx_n_s_XSLTSaveError, __pyx_n_s_XSLTSaveError, (PyObject *) NULL, __pyx_n_s_lxml_etree, __pyx_kp_s_Error_serialising_an_XSLT_result); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 18, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSLTSaveError, __pyx_t_1) < 0) __PYX_ERR(3, 18, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_15, __pyx_n_s_XSLTSaveError, __pyx_t_14, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 18, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_2);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_XSLTSaveError, __pyx_t_2) < 0) __PYX_ERR(4, 18, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
 
@@ -258378,9 +258538,9 @@ if (!__Pyx_RefNanny) {
  * LIBXSLT_VERSION = __unpackIntVersion(xslt.xsltLibxsltVersion)
  * 
  */
-  __pyx_t_14 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXSLT_VERSION); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 28, __pyx_L1_error)
+  __pyx_t_14 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXSLT_VERSION); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 28, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXSLT_COMPILED_VERSION, __pyx_t_14) < 0) __PYX_ERR(3, 28, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXSLT_COMPILED_VERSION, __pyx_t_14) < 0) __PYX_ERR(4, 28, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
 
   /* "src/lxml/xslt.pxi":29
@@ -258390,9 +258550,9 @@ if (!__Pyx_RefNanny) {
  * 
  * 
  */
-  __pyx_t_14 = __pyx_f_4lxml_5etree___unpackIntVersion(xsltLibxsltVersion); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 29, __pyx_L1_error)
+  __pyx_t_14 = __pyx_f_4lxml_5etree___unpackIntVersion(xsltLibxsltVersion); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 29, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXSLT_VERSION, __pyx_t_14) < 0) __PYX_ERR(3, 29, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBXSLT_VERSION, __pyx_t_14) < 0) __PYX_ERR(4, 29, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
 
   /* "src/lxml/xslt.pxi":163
@@ -258420,11 +258580,11 @@ if (!__Pyx_RefNanny) {
  *         read_network=False, write_network=False)
  * 
  */
-  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 205, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 205, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_read_file, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_create_dir, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_read_file, Py_False) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_create_dir, Py_False) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":206
  *     DENY_ALL = XSLTAccessControl(
@@ -258433,8 +258593,8 @@ if (!__Pyx_RefNanny) {
  * 
  *     DENY_WRITE = XSLTAccessControl(
  */
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_read_network, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_write_network, Py_False) < 0) __PYX_ERR(3, 205, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_read_network, Py_False) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_write_network, Py_False) < 0) __PYX_ERR(4, 205, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":204
  *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
@@ -258443,10 +258603,10 @@ if (!__Pyx_RefNanny) {
  *         read_file=False, write_file=False, create_dir=False,
  *         read_network=False, write_network=False)
  */
-  __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl), __pyx_empty_tuple, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 204, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl), __pyx_empty_tuple, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 204, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_n_s_DENY_ALL, __pyx_t_15) < 0) __PYX_ERR(3, 204, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_n_s_DENY_ALL, __pyx_t_15) < 0) __PYX_ERR(4, 204, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLTAccessControl);
 
@@ -258457,11 +258617,11 @@ if (!__Pyx_RefNanny) {
  *         read_network=True, write_network=False)
  * 
  */
-  __pyx_t_15 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 209, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 209, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_read_file, Py_True) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_create_dir, Py_False) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_read_file, Py_True) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_write_file, Py_False) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_create_dir, Py_False) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":210
  *     DENY_WRITE = XSLTAccessControl(
@@ -258470,8 +258630,8 @@ if (!__Pyx_RefNanny) {
  * 
  *     def __dealloc__(self):
  */
-  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_read_network, Py_True) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_write_network, Py_False) < 0) __PYX_ERR(3, 209, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_read_network, Py_True) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_15, __pyx_n_s_write_network, Py_False) < 0) __PYX_ERR(4, 209, __pyx_L1_error)
 
   /* "src/lxml/xslt.pxi":208
  *         read_network=False, write_network=False)
@@ -258480,10 +258640,10 @@ if (!__Pyx_RefNanny) {
  *         read_file=True, write_file=False, create_dir=False,
  *         read_network=True, write_network=False)
  */
-  __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl), __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 208, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl), __pyx_empty_tuple, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 208, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_n_s_DENY_WRITE, __pyx_t_14) < 0) __PYX_ERR(3, 208, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLTAccessControl->tp_dict, __pyx_n_s_DENY_WRITE, __pyx_t_14) < 0) __PYX_ERR(4, 208, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLTAccessControl);
 
@@ -258494,7 +258654,7 @@ if (!__Pyx_RefNanny) {
  * 
  * @cython.final
  */
-  __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 268, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 268, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree_EMPTY_DICT);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree_EMPTY_DICT, ((PyObject*)__pyx_t_14));
@@ -258508,9 +258668,9 @@ if (!__Pyx_RefNanny) {
  *         u"""strparam(strval)
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_7strparam, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_strparam, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__626)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 438, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_7strparam, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_strparam, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__626)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_strparam, __pyx_t_14) < 0) __PYX_ERR(3, 438, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_strparam, __pyx_t_14) < 0) __PYX_ERR(4, 438, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258521,12 +258681,12 @@ if (!__Pyx_RefNanny) {
  *     def strparam(strval):
  *         u"""strparam(strval)
  */
-  __Pyx_GetNameInClass(__pyx_t_14, (PyObject *)__pyx_ptype_4lxml_5etree_XSLT, __pyx_n_s_strparam); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 438, __pyx_L1_error)
+  __Pyx_GetNameInClass(__pyx_t_14, (PyObject *)__pyx_ptype_4lxml_5etree_XSLT, __pyx_n_s_strparam); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 438, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 437, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 437, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_strparam, __pyx_t_15) < 0) __PYX_ERR(3, 438, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_strparam, __pyx_t_15) < 0) __PYX_ERR(4, 438, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258537,9 +258697,9 @@ if (!__Pyx_RefNanny) {
  *         u"""set_global_max_depth(max_depth)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_9set_global_max_depth, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_set_global_max_depth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__628)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 452, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_9set_global_max_depth, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_set_global_max_depth, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__628)); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 452, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_set_global_max_depth, __pyx_t_15) < 0) __PYX_ERR(3, 452, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_set_global_max_depth, __pyx_t_15) < 0) __PYX_ERR(4, 452, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258550,12 +258710,12 @@ if (!__Pyx_RefNanny) {
  *     def set_global_max_depth(int max_depth):
  *         u"""set_global_max_depth(max_depth)
  */
-  __Pyx_GetNameInClass(__pyx_t_15, (PyObject *)__pyx_ptype_4lxml_5etree_XSLT, __pyx_n_s_set_global_max_depth); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 452, __pyx_L1_error)
+  __Pyx_GetNameInClass(__pyx_t_15, (PyObject *)__pyx_ptype_4lxml_5etree_XSLT, __pyx_n_s_set_global_max_depth); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 452, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 451, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_15); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 451, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_set_global_max_depth, __pyx_t_14) < 0) __PYX_ERR(3, 452, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_set_global_max_depth, __pyx_t_14) < 0) __PYX_ERR(4, 452, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258566,9 +258726,9 @@ if (!__Pyx_RefNanny) {
  *         u"""apply(self, _input,  profile_run=False, **kw)
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_11apply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_apply, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__630)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 471, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_11apply, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_apply, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__630)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 471, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_apply, __pyx_t_14) < 0) __PYX_ERR(3, 471, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_apply, __pyx_t_14) < 0) __PYX_ERR(4, 471, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258579,9 +258739,9 @@ if (!__Pyx_RefNanny) {
  *         u"""tostring(self, result_tree)
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_13tostring, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__632)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 477, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_13tostring, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT_tostring, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__632)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 477, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_tostring, __pyx_t_14) < 0) __PYX_ERR(3, 477, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_tostring, __pyx_t_14) < 0) __PYX_ERR(4, 477, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258592,9 +258752,9 @@ if (!__Pyx_RefNanny) {
  *         return self.__copy__()
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_15__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__634)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 486, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_15__deepcopy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___deepcopy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__634)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 486, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_deepcopy, __pyx_t_14) < 0) __PYX_ERR(3, 486, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_deepcopy, __pyx_t_14) < 0) __PYX_ERR(4, 486, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258605,9 +258765,9 @@ if (!__Pyx_RefNanny) {
  *         return _copyXSLT(self)
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_17__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__636)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 489, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_4XSLT_17__copy__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLT___copy, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__636)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 489, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_copy_2, __pyx_t_14) < 0) __PYX_ERR(3, 489, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_XSLT->tp_dict, __pyx_n_s_copy_2, __pyx_t_14) < 0) __PYX_ERR(4, 489, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_XSLT);
 
@@ -258618,9 +258778,9 @@ if (!__Pyx_RefNanny) {
  *         """write_output(self, file, *, compression=0)
  * 
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_1write_output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree_write_output, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__638)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 717, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_1write_output, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree_write_output, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__638)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 717, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_write_output, __pyx_t_14) < 0) __PYX_ERR(3, 717, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_write_output, __pyx_t_14) < 0) __PYX_ERR(4, 717, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__XSLTResultTree);
 
@@ -258631,9 +258791,9 @@ if (!__Pyx_RefNanny) {
  *         cdef xmlChar* encoding
  *         cdef xmlChar* s = NULL
  */
-  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_5__unicode__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree___unicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__640)); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 787, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_15_XSLTResultTree_5__unicode__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTResultTree___unicode, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__640)); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 787, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_unicode_2, __pyx_t_14) < 0) __PYX_ERR(3, 787, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTResultTree->tp_dict, __pyx_n_s_unicode_2, __pyx_t_14) < 0) __PYX_ERR(4, 787, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__XSLTResultTree);
 
@@ -258662,9 +258822,9 @@ if (!__Pyx_RefNanny) {
  * cdef object _FIND_PI_HREF = _RE_PI_HREF.findall
  * cdef object _REPLACE_PI_HREF = _RE_PI_HREF.sub
  */
-  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_14)) __PYX_ERR(3, 881, __pyx_L1_error)
+  __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree_re, __pyx_n_s_compile); if (unlikely(!__pyx_t_14)) __PYX_ERR(4, 881, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__641, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 881, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_tuple__641, NULL); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 881, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__RE_PI_HREF);
@@ -258679,7 +258839,7 @@ if (!__Pyx_RefNanny) {
  * cdef object _REPLACE_PI_HREF = _RE_PI_HREF.sub
  * cdef XPath __findStylesheetByID = None
  */
-  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_s_findall); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 882, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_s_findall); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 882, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__FIND_PI_HREF);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__FIND_PI_HREF, __pyx_t_15);
@@ -258693,7 +258853,7 @@ if (!__Pyx_RefNanny) {
  * cdef XPath __findStylesheetByID = None
  * 
  */
-  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_s_sub); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 883, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_s_sub); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 883, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
   __Pyx_XGOTREF(__pyx_v_4lxml_5etree__REPLACE_PI_HREF);
   __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__REPLACE_PI_HREF, __pyx_t_15);
@@ -258719,9 +258879,9 @@ if (!__Pyx_RefNanny) {
  *         u"""parseXSL(self, parser=None)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__643)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 895, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_1parseXSL, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_parse, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__643)); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 895, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_parseXSL, __pyx_t_15) < 0) __PYX_ERR(3, 895, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_parseXSL, __pyx_t_15) < 0) __PYX_ERR(4, 895, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction);
 
@@ -258732,9 +258892,9 @@ if (!__Pyx_RefNanny) {
  *         u"""set(self, key, value)
  * 
  */
-  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_3set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__645)); if (unlikely(!__pyx_t_15)) __PYX_ERR(3, 952, __pyx_L1_error)
+  __pyx_t_15 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_26_XSLTProcessingInstruction_3set, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_XSLTProcessingInstruction_set, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__645)); if (unlikely(!__pyx_t_15)) __PYX_ERR(4, 952, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_15);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_set, __pyx_t_15) < 0) __PYX_ERR(3, 952, __pyx_L1_error)
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction->tp_dict, __pyx_n_s_set, __pyx_t_15) < 0) __PYX_ERR(4, 952, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction);
 
@@ -259009,10 +259169,10 @@ if (!__Pyx_RefNanny) {
     __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
     if (__pyx_t_6) {
       __Pyx_AddTraceback("lxml.etree", __pyx_clineno, __pyx_lineno, __pyx_filename);
-      if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_2) < 0) __PYX_ERR(21, 7, __pyx_L32_except_error)
+      if (__Pyx_GetException(&__pyx_t_15, &__pyx_t_14, &__pyx_t_1) < 0) __PYX_ERR(21, 7, __pyx_L32_except_error)
       __Pyx_GOTREF(__pyx_t_15);
       __Pyx_GOTREF(__pyx_t_14);
-      __Pyx_GOTREF(__pyx_t_2);
+      __Pyx_GOTREF(__pyx_t_1);
 
       /* "src/lxml/relaxng.pxi":8
  *     import rnc2rng as _rnc2rng
@@ -259027,7 +259187,7 @@ if (!__Pyx_RefNanny) {
       __Pyx_GIVEREF(Py_None);
       __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
       __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
-      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
       goto __pyx_L31_exception_handled;
     }
     goto __pyx_L32_except_error;
@@ -259060,10 +259220,10 @@ if (!__Pyx_RefNanny) {
  *         """Parse a RelaxNG schema in compact syntax from a text string
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7RelaxNG_9from_rnc_string, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RelaxNG_from_rnc_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__675)); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 153, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG->tp_dict, __pyx_n_s_from_rnc_string, __pyx_t_2) < 0) __PYX_ERR(21, 153, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_7RelaxNG_9from_rnc_string, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_RelaxNG_from_rnc_string, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__675)); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG->tp_dict, __pyx_n_s_from_rnc_string, __pyx_t_1) < 0) __PYX_ERR(21, 153, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_RelaxNG);
 
   /* "src/lxml/relaxng.pxi":152
@@ -259073,11 +259233,11 @@ if (!__Pyx_RefNanny) {
  *     def from_rnc_string(cls, src, base_url=None):
  *         """Parse a RelaxNG schema in compact syntax from a text string
  */
-  __Pyx_GetNameInClass(__pyx_t_2, (PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG, __pyx_n_s_from_rnc_string); if (unlikely(!__pyx_t_2)) __PYX_ERR(21, 153, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  __pyx_t_14 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(21, 152, __pyx_L1_error)
+  __Pyx_GetNameInClass(__pyx_t_1, (PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG, __pyx_n_s_from_rnc_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(21, 153, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_14 = __Pyx_Method_ClassMethod(__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(21, 152, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree_RelaxNG->tp_dict, __pyx_n_s_from_rnc_string, __pyx_t_14) < 0) __PYX_ERR(21, 153, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree_RelaxNG);
@@ -259091,11 +259251,11 @@ if (!__Pyx_RefNanny) {
  */
   __pyx_t_14 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_14)) __PYX_ERR(22, 23, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_14);
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 23, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_n_u_xs, __pyx_kp_u_http_www_w3_org_2001_XMLSchema) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_namespaces, __pyx_t_2) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 23, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_xs, __pyx_kp_u_http_www_w3_org_2001_XMLSchema) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_14, __pyx_n_s_namespaces, __pyx_t_1) < 0) __PYX_ERR(22, 23, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "src/lxml/xmlschema.pxi":21
  * # XMLSchema
@@ -259104,13 +259264,13 @@ if (!__Pyx_RefNanny) {
  *     u"boolean(//xs:attribute[@default or @fixed][1])",
  *     namespaces={u'xs': u'http://www.w3.org/2001/XMLSchema'})
  */
-  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__676, __pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(22, 21, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
+  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4lxml_5etree_XPath), __pyx_tuple__676, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(22, 21, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
   __Pyx_XGOTREF(((PyObject *)__pyx_v_4lxml_5etree__check_for_default_attributes));
-  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__check_for_default_attributes, ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_t_2));
-  __Pyx_GIVEREF(__pyx_t_2);
-  __pyx_t_2 = 0;
+  __Pyx_DECREF_SET(__pyx_v_4lxml_5etree__check_for_default_attributes, ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_t_1));
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
 
   /* "src/lxml/debug.pxi":7
  *     """Debugging support for the memory allocation in libxml2.
@@ -259119,10 +259279,10 @@ if (!__Pyx_RefNanny) {
  *         """bytes_used(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_1bytes_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_bytes_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__678)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 7, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_bytes_used, __pyx_t_2) < 0) __PYX_ERR(25, 7, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_1bytes_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_bytes_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__678)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 7, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_bytes_used, __pyx_t_1) < 0) __PYX_ERR(25, 7, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MemDebug);
 
   /* "src/lxml/debug.pxi":16
@@ -259132,10 +259292,10 @@ if (!__Pyx_RefNanny) {
  *         """blocks_used(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_3blocks_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_blocks_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__680)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 16, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_blocks_used, __pyx_t_2) < 0) __PYX_ERR(25, 16, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_3blocks_used, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_blocks_used, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__680)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 16, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_blocks_used, __pyx_t_1) < 0) __PYX_ERR(25, 16, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MemDebug);
 
   /* "src/lxml/debug.pxi":25
@@ -259145,10 +259305,10 @@ if (!__Pyx_RefNanny) {
  *         """dict_size(self)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_5dict_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dict_size, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__682)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 25, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dict_size, __pyx_t_2) < 0) __PYX_ERR(25, 25, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_5dict_size, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dict_size, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__682)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 25, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dict_size, __pyx_t_1) < 0) __PYX_ERR(25, 25, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MemDebug);
 
   /* "src/lxml/debug.pxi":36
@@ -259158,10 +259318,10 @@ if (!__Pyx_RefNanny) {
  *         """dump(self, output_file=None, byte_count=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_7dump, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__684)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 36, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dump, __pyx_t_2) < 0) __PYX_ERR(25, 36, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_7dump, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_dump, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__684)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 36, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_dump, __pyx_t_1) < 0) __PYX_ERR(25, 36, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MemDebug);
 
   /* "src/lxml/debug.pxi":66
@@ -259171,10 +259331,10 @@ if (!__Pyx_RefNanny) {
  *         """show(self, output_file=None, block_count=None)
  * 
  */
-  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_9show, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_show, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__686)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 66, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_show, __pyx_t_2) < 0) __PYX_ERR(25, 66, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_4lxml_5etree_9_MemDebug_9show, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MemDebug_show, NULL, __pyx_n_s_lxml_etree, __pyx_d, ((PyObject *)__pyx_codeobj__686)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 66, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug->tp_dict, __pyx_n_s_show, __pyx_t_1) < 0) __PYX_ERR(25, 66, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   PyType_Modified(__pyx_ptype_4lxml_5etree__MemDebug);
 
   /* "src/lxml/debug.pxi":91
@@ -259182,22 +259342,22 @@ if (!__Pyx_RefNanny) {
  * 
  * memory_debugger = _MemDebug()             # <<<<<<<<<<<<<<
  */
-  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug)); if (unlikely(!__pyx_t_2)) __PYX_ERR(25, 91, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_debugger, __pyx_t_2) < 0) __PYX_ERR(25, 91, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_4lxml_5etree__MemDebug)); if (unlikely(!__pyx_t_1)) __PYX_ERR(25, 91, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_memory_debugger, __pyx_t_1) < 0) __PYX_ERR(25, 91, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /* "lxml/etree.pyx":1
  * # cython: binding=True             # <<<<<<<<<<<<<<
  * # cython: auto_pickle=False
  * # cython: language_level=2
  */
-  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_GOTREF(__pyx_t_2);
-  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_XML_line_3191, __pyx_kp_u_XML_text_parser_None_base_url_No) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_t_2, __pyx_kp_u_FunctionNamespace_line_207, __pyx_kp_u_FunctionNamespace_ns_uri_Retriev) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
-  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_GOTREF(__pyx_t_1);
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_XML_line_3191, __pyx_kp_u_XML_text_parser_None_base_url_No) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_FunctionNamespace_line_207, __pyx_kp_u_FunctionNamespace_ns_uri_Retriev) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test_2, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
   /*--- Wrapped vars code ---*/
 
@@ -259971,6 +260131,7 @@ static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
   Py_CLEAR(__pyx_builtin_SyntaxError);
   Py_CLEAR(__pyx_builtin_object);
   Py_CLEAR(__pyx_builtin_property);
+  Py_CLEAR(__pyx_builtin_AssertionError);
   Py_CLEAR(__pyx_builtin_staticmethod);
   Py_CLEAR(__pyx_builtin_KeyError);
   Py_CLEAR(__pyx_builtin_ValueError);
@@ -259996,7 +260157,6 @@ static void __pyx_module_cleanup(CYTHON_UNUSED PyObject *self) {
   Py_CLEAR(__pyx_builtin_reversed);
   Py_CLEAR(__pyx_builtin_sorted);
   Py_CLEAR(__pyx_builtin_NotImplementedError);
-  Py_CLEAR(__pyx_builtin_AssertionError);
   /*--- Intern cleanup code ---*/
   Py_CLEAR(__pyx_empty_tuple);
   while (__pyx_freecount_4lxml_5etree__LogEntry > 0) {
index e34b36a..c638921 100644 (file)
@@ -860,7 +860,7 @@ struct __pyx_defaults1 {
   PyObject *__pyx_arg_break_character;
 };
 
-/* "lxml/html/clean.py":492
+/* "lxml/html/clean.py":491
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -1680,6 +1680,7 @@ static const char __pyx_k_finditer[] = "finditer";
 static const char __pyx_k_fragment[] = "fragment";
 static const char __pyx_k_last_pos[] = "last_pos";
 static const char __pyx_k_nofollow[] = "nofollow";
+static const char __pyx_k_noscript[] = "</noscript";
 static const char __pyx_k_one_attr[] = "one_attr";
 static const char __pyx_k_qualname[] = "__qualname__";
 static const char __pyx_k_s_import[] = "@\\s*import";
@@ -1732,7 +1733,6 @@ static const char __pyx_k_result_type[] = "result_type";
 static const char __pyx_k_add_nofollow[] = "add_nofollow";
 static const char __pyx_k_allow_follow[] = "allow_follow";
 static const char __pyx_k_expression_s[] = "expression\\s*\\(.*?\\)";
-static const char __pyx_k_found_parent[] = "found_parent";
 static const char __pyx_k_inline_style[] = "inline_style";
 static const char __pyx_k_insert_break[] = "_insert_break";
 static const char __pyx_k_javascript_2[] = "javascript:";
@@ -1933,7 +1933,6 @@ static PyObject *__pyx_n_s_find_styled_elements;
 static PyObject *__pyx_n_s_finditer;
 static PyObject *__pyx_n_s_form;
 static PyObject *__pyx_n_s_forms;
-static PyObject *__pyx_n_s_found_parent;
 static PyObject *__pyx_n_s_fragment;
 static PyObject *__pyx_n_s_frame_tags;
 static PyObject *__pyx_n_s_frames;
@@ -2010,6 +2009,7 @@ static PyObject *__pyx_n_s_nobreak;
 static PyObject *__pyx_n_s_nofollow;
 static PyObject *__pyx_kp_s_nofollow_2;
 static PyObject *__pyx_n_s_nolink;
+static PyObject *__pyx_kp_s_noscript;
 static PyObject *__pyx_n_s_not_an_attribute;
 static PyObject *__pyx_n_s_object;
 static PyObject *__pyx_n_s_old;
@@ -2822,7 +2822,6 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   PyObject *__pyx_v_aname = NULL;
   PyObject *__pyx_v_old = NULL;
   PyObject *__pyx_v_new = NULL;
-  CYTHON_UNUSED int __pyx_v_found_parent;
   PyObject *__pyx_v_parent = NULL;
   PyObject *__pyx_v__remove = NULL;
   PyObject *__pyx_v__kill = NULL;
@@ -4969,8 +4968,8 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             # We should get rid of any <param> tags not inside <applet>;
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):             # <<<<<<<<<<<<<<
- *                 found_parent = False
  *                 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);
@@ -5008,20 +5007,11 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       /* "lxml/html/clean.py":355
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):
- *                 found_parent = False             # <<<<<<<<<<<<<<
- *                 parent = el.getparent()
- *                 while parent is not None and parent.tag not in ('applet', 'object'):
- */
-      __pyx_v_found_parent = 0;
-
-      /* "lxml/html/clean.py":356
- *             for el in list(doc.iter('param')):
- *                 found_parent = False
  *                 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, 356, __pyx_L1_error)
+      __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_4 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -5035,14 +5025,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       }
       __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 356, __pyx_L1_error)
+      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;
 
-      /* "lxml/html/clean.py":357
- *                 found_parent = False
+      /* "lxml/html/clean.py":356
+ *             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()
@@ -5056,15 +5046,15 @@ 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, 357, __pyx_L1_error)
+        __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, 357, __pyx_L1_error)
+        __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)
         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, 357, __pyx_L1_error)
+        __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_18 = __pyx_t_10;
         __pyx_L65_bool_binop_done:;
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
@@ -5073,14 +5063,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         __pyx_L63_bool_binop_done:;
         if (!__pyx_t_11) break;
 
-        /* "lxml/html/clean.py":358
+        /* "lxml/html/clean.py":357
  *                 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, 358, __pyx_L1_error)
+        __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_4 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -5094,14 +5084,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 358, __pyx_L1_error)
+        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;
       }
 
-      /* "lxml/html/clean.py":359
+      /* "lxml/html/clean.py":358
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()
  *                 if parent is None:             # <<<<<<<<<<<<<<
@@ -5112,14 +5102,14 @@ 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":360
+        /* "lxml/html/clean.py":359
  *                     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, 360, __pyx_L1_error)
+        __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_4 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -5133,12 +5123,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 360, __pyx_L1_error)
+        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;
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":359
+        /* "lxml/html/clean.py":358
  *                 while parent is not None and parent.tag not in ('applet', 'object'):
  *                     parent = parent.getparent()
  *                 if parent is None:             # <<<<<<<<<<<<<<
@@ -5151,31 +5141,31 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  *             # We should get rid of any <param> tags not inside <applet>;
  *             # These are not really valid anyway.
  *             for el in list(doc.iter('param')):             # <<<<<<<<<<<<<<
- *                 found_parent = False
  *                 parent = el.getparent()
+ *                 while parent is not None and parent.tag not in ('applet', 'object'):
  */
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":361
+    /* "lxml/html/clean.py":360
  *                 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, 361, __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, 360, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":363
+    /* "lxml/html/clean.py":362
  *             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, 363, __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, 362, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
@@ -5188,37 +5178,37 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":364
+  /* "lxml/html/clean.py":363
  *             # 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, 364, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 364, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 363, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":368
+    /* "lxml/html/clean.py":367
  *             # 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, 368, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_defs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 367, __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, 368, __pyx_L1_error)
+    __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_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, 368, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":364
+    /* "lxml/html/clean.py":363
  *             # The alternate contents that are in an iframe are a good fallback:
  *             remove_tags.update(('iframe', 'embed', 'layer', 'object', 'param'))
  *         if self.frames:             # <<<<<<<<<<<<<<
@@ -5227,40 +5217,40 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":369
+  /* "lxml/html/clean.py":368
  *             # 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, 369, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_5);
-  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 369, __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":370
+    /* "lxml/html/clean.py":369
  *             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, 370, __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, 369, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":371
+    /* "lxml/html/clean.py":370
  *         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, 371, __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, 370, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":369
+    /* "lxml/html/clean.py":368
  *             # fragment anyway.
  *             kill_tags.update(defs.frame_tags)
  *         if self.forms:             # <<<<<<<<<<<<<<
@@ -5269,31 +5259,31 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":372
+  /* "lxml/html/clean.py":371
  *             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, 372, __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, 371, __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, 372, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":373
+    /* "lxml/html/clean.py":372
  *             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, 373, __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, 372, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":372
+    /* "lxml/html/clean.py":371
  *             remove_tags.add('form')
  *             kill_tags.update(('button', 'input', 'select', 'textarea'))
  *         if self.annoying_tags:             # <<<<<<<<<<<<<<
@@ -5302,38 +5292,38 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":375
+  /* "lxml/html/clean.py":374
  *             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, 375, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 374, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v__remove = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":376
+  /* "lxml/html/clean.py":375
  * 
  *         _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, 376, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 375, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_v__kill = ((PyObject*)__pyx_t_5);
   __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":377
+  /* "lxml/html/clean.py":376
  *         _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, 377, __pyx_L1_error)
+  __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))) {
@@ -5347,16 +5337,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __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, 377, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 376, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_9 = NULL;
   } else {
-    __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 377, __pyx_L1_error)
+    __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, 377, __pyx_L1_error)
+    __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 376, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   for (;;) {
@@ -5364,17 +5354,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       if (likely(PyList_CheckExact(__pyx_t_6))) {
         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_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __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, 376, __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, 377, __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, 376, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       } else {
         if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) 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, 377, __pyx_L1_error)
+        __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)
         #else
-        __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 377, __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, 376, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         #endif
       }
@@ -5384,7 +5374,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, 377, __pyx_L1_error)
+          else __PYX_ERR(0, 376, __pyx_L1_error)
         }
         break;
       }
@@ -5393,28 +5383,28 @@ 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":378
+    /* "lxml/html/clean.py":377
  *         _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, 378, __pyx_L1_error)
+    __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_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, 378, __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, 377, __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":379
+      /* "lxml/html/clean.py":378
  *         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, 379, __pyx_L1_error)
+      __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_4 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -5428,14 +5418,14 @@ 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_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 379, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __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, 379, __pyx_L1_error)
+      __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_5); __pyx_t_5 = 0;
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":380
+        /* "lxml/html/clean.py":379
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):
  *                     continue             # <<<<<<<<<<<<<<
@@ -5444,7 +5434,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         goto __pyx_L71_continue;
 
-        /* "lxml/html/clean.py":379
+        /* "lxml/html/clean.py":378
  *         for el in doc.iter():
  *             if el.tag in kill_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
@@ -5453,16 +5443,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":381
+      /* "lxml/html/clean.py":380
  *                 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, 381, __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, 380, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":378
+      /* "lxml/html/clean.py":377
  *         _kill = []
  *         for el in doc.iter():
  *             if el.tag in kill_tags:             # <<<<<<<<<<<<<<
@@ -5472,28 +5462,28 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       goto __pyx_L73;
     }
 
-    /* "lxml/html/clean.py":382
+    /* "lxml/html/clean.py":381
  *                     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, 382, __pyx_L1_error)
+    __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_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, 382, __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, 381, __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":383
+      /* "lxml/html/clean.py":382
  *                 _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, 383, __pyx_L1_error)
+      __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_4 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -5507,14 +5497,14 @@ 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_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
       __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 383, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 382, __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, 383, __pyx_L1_error)
+      __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_5); __pyx_t_5 = 0;
       if (__pyx_t_10) {
 
-        /* "lxml/html/clean.py":384
+        /* "lxml/html/clean.py":383
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):
  *                     continue             # <<<<<<<<<<<<<<
@@ -5523,7 +5513,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
         goto __pyx_L71_continue;
 
-        /* "lxml/html/clean.py":383
+        /* "lxml/html/clean.py":382
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:
  *                 if self.allow_element(el):             # <<<<<<<<<<<<<<
@@ -5532,16 +5522,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":385
+      /* "lxml/html/clean.py":384
  *                 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, 385, __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, 384, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":382
+      /* "lxml/html/clean.py":381
  *                     continue
  *                 _kill.append(el)
  *             elif el.tag in remove_tags:             # <<<<<<<<<<<<<<
@@ -5551,7 +5541,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __pyx_L73:;
 
-    /* "lxml/html/clean.py":377
+    /* "lxml/html/clean.py":376
  *         _remove = []
  *         _kill = []
  *         for el in doc.iter():             # <<<<<<<<<<<<<<
@@ -5562,7 +5552,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-  /* "lxml/html/clean.py":387
+  /* "lxml/html/clean.py":386
  *                 _remove.append(el)
  * 
  *         if _remove and _remove[0] == doc:             # <<<<<<<<<<<<<<
@@ -5575,47 +5565,47 @@ 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, 387, __pyx_L1_error)
+  __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, 387, __pyx_L1_error)
+  __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, 387, __pyx_L1_error)
+  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); 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;
   __pyx_L77_bool_binop_done:;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":390
+    /* "lxml/html/clean.py":389
  *             # 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, 390, __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, 389, __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":391
+    /* "lxml/html/clean.py":390
  *             # 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, 391, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 390, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":392
+    /* "lxml/html/clean.py":391
  *             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, 392, __pyx_L1_error)
+    __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_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, 392, __pyx_L1_error)
+    __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;
@@ -5630,12 +5620,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __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, 392, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":387
+    /* "lxml/html/clean.py":386
  *                 _remove.append(el)
  * 
  *         if _remove and _remove[0] == doc:             # <<<<<<<<<<<<<<
@@ -5645,7 +5635,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     goto __pyx_L76;
   }
 
-  /* "lxml/html/clean.py":393
+  /* "lxml/html/clean.py":392
  *             el.tag = 'div'
  *             el.attrib.clear()
  *         elif _kill and _kill[0] == doc:             # <<<<<<<<<<<<<<
@@ -5658,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, 393, __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, 392, __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, 393, __pyx_L1_error)
+  __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_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, 393, __pyx_L1_error)
+  __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_10 = __pyx_t_11;
   __pyx_L79_bool_binop_done:;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":396
+    /* "lxml/html/clean.py":395
  *             # 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, 396, __pyx_L1_error)
+    __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;
 
-    /* "lxml/html/clean.py":397
+    /* "lxml/html/clean.py":396
  *             # 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, 397, __pyx_L1_error)
+    __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, 397, __pyx_L1_error)
+    __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;
     if (__pyx_t_10) {
 
-      /* "lxml/html/clean.py":398
+      /* "lxml/html/clean.py":397
  *             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, 398, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 397, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":397
+      /* "lxml/html/clean.py":396
  *             # do.  Instead we'll clear it:
  *             el = _kill.pop(0)
  *             if el.tag != 'html':             # <<<<<<<<<<<<<<
@@ -5711,14 +5701,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":399
+    /* "lxml/html/clean.py":398
  *             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, 399, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -5732,12 +5722,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __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, 399, __pyx_L1_error)
+    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 398, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
 
-    /* "lxml/html/clean.py":393
+    /* "lxml/html/clean.py":392
  *             el.tag = 'div'
  *             el.attrib.clear()
  *         elif _kill and _kill[0] == doc:             # <<<<<<<<<<<<<<
@@ -5747,16 +5737,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   }
   __pyx_L76:;
 
-  /* "lxml/html/clean.py":401
+  /* "lxml/html/clean.py":400
  *             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, 401, __pyx_L1_error)
+  __pyx_t_12 = PyList_Reverse(__pyx_v__kill); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 400, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":402
+  /* "lxml/html/clean.py":401
  * 
  *         _kill.reverse() # start with innermost tags
  *         for el in _kill:             # <<<<<<<<<<<<<<
@@ -5767,22 +5757,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   for (;;) {
     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, 402, __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, 401, __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, 402, __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, 401, __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":403
+    /* "lxml/html/clean.py":402
  *         _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, 403, __pyx_L1_error)
+    __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_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -5796,12 +5786,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __pyx_t_5 = (__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_5)) __PYX_ERR(0, 403, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":402
+    /* "lxml/html/clean.py":401
  * 
  *         _kill.reverse() # start with innermost tags
  *         for el in _kill:             # <<<<<<<<<<<<<<
@@ -5811,7 +5801,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":404
+  /* "lxml/html/clean.py":403
  *         for el in _kill:
  *             el.drop_tree()
  *         for el in _remove:             # <<<<<<<<<<<<<<
@@ -5822,22 +5812,22 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   for (;;) {
     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, 404, __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, 403, __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, 404, __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, 403, __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":405
+    /* "lxml/html/clean.py":404
  *             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, 405, __pyx_L1_error)
+    __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_4 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -5851,12 +5841,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __pyx_t_5 = (__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_5)) __PYX_ERR(0, 405, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 404, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-    /* "lxml/html/clean.py":404
+    /* "lxml/html/clean.py":403
  *         for el in _kill:
  *             el.drop_tree()
  *         for el in _remove:             # <<<<<<<<<<<<<<
@@ -5866,20 +5856,20 @@ 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":407
+  /* "lxml/html/clean.py":406
  *             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, 407, __pyx_L1_error)
+  __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, 407, __pyx_L1_error)
+  __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;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":408
+    /* "lxml/html/clean.py":407
  * 
  *         if self.remove_unknown_tags:
  *             if allow_tags:             # <<<<<<<<<<<<<<
@@ -5889,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":409
+      /* "lxml/html/clean.py":408
  *         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, 409, __pyx_L1_error)
+      __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, 409, __pyx_L1_error)
+      __PYX_ERR(0, 408, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":408
+      /* "lxml/html/clean.py":407
  * 
  *         if self.remove_unknown_tags:
  *             if allow_tags:             # <<<<<<<<<<<<<<
@@ -5911,25 +5901,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":411
+    /* "lxml/html/clean.py":410
  *                 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, 411, __pyx_L1_error)
+    __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, 411, __pyx_L1_error)
+    __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_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, 411, __pyx_L1_error)
+    __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_5); __pyx_t_5 = 0;
     __Pyx_DECREF_SET(__pyx_v_allow_tags, ((PyObject*)__pyx_t_13));
     __pyx_t_13 = 0;
 
-    /* "lxml/html/clean.py":407
+    /* "lxml/html/clean.py":406
  *             el.drop_tag()
  * 
  *         if self.remove_unknown_tags:             # <<<<<<<<<<<<<<
@@ -5938,7 +5928,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":412
+  /* "lxml/html/clean.py":411
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)
  *         if allow_tags:             # <<<<<<<<<<<<<<
@@ -5948,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":414
+    /* "lxml/html/clean.py":413
  *         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, 414, __pyx_L1_error)
+    __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, 414, __pyx_L1_error)
+    __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_11 = ((!__pyx_t_10) != 0);
     if (__pyx_t_11) {
 
-      /* "lxml/html/clean.py":415
+      /* "lxml/html/clean.py":414
  *             # 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, 415, __pyx_L1_error)
+      __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, 415, __pyx_L1_error)
+      __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_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, 415, __pyx_L1_error)
+      __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_5); __pyx_t_5 = 0;
 
-      /* "lxml/html/clean.py":414
+      /* "lxml/html/clean.py":413
  *         if allow_tags:
  *             # make sure we do not remove comments/PIs if users want them (which is rare enough)
  *             if not self.comments:             # <<<<<<<<<<<<<<
@@ -5986,36 +5976,36 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":416
+    /* "lxml/html/clean.py":415
  *             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, 416, __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, 415, __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, 416, __pyx_L1_error)
+    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 415, __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":417
+      /* "lxml/html/clean.py":416
  *                 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, 417, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_etree); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 416, __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, 417, __pyx_L1_error)
+      __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_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, 417, __pyx_L1_error)
+      __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;
 
-      /* "lxml/html/clean.py":416
+      /* "lxml/html/clean.py":415
  *             if not self.comments:
  *                 allow_tags.add(etree.Comment)
  *             if not self.processing_instructions:             # <<<<<<<<<<<<<<
@@ -6024,26 +6014,26 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":419
+    /* "lxml/html/clean.py":418
  *                 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, 419, __pyx_L1_error)
+    __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;
 
-    /* "lxml/html/clean.py":420
+    /* "lxml/html/clean.py":419
  * 
  *             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, 420, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -6057,16 +6047,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __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, 420, __pyx_L1_error)
+    if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 419, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_13);
     __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;
       __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, 420, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_5);
-      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 420, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 419, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
     for (;;) {
@@ -6074,17 +6064,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_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, 420, __pyx_L1_error)
+          __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)
           #else
-          __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error)
+          __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);
           #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, 420, __pyx_L1_error)
+          __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)
           #else
-          __pyx_t_13 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 420, __pyx_L1_error)
+          __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);
           #endif
         }
@@ -6094,7 +6084,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, 420, __pyx_L1_error)
+            else __PYX_ERR(0, 419, __pyx_L1_error)
           }
           break;
         }
@@ -6103,30 +6093,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
       __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_13);
       __pyx_t_13 = 0;
 
-      /* "lxml/html/clean.py":421
+      /* "lxml/html/clean.py":420
  *             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, 421, __pyx_L1_error)
+      __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, 421, __pyx_L1_error)
+      __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_11 = (__pyx_t_10 != 0);
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":422
+        /* "lxml/html/clean.py":421
  *             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, 422, __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, 421, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":421
+        /* "lxml/html/clean.py":420
  *             bad = []
  *             for el in doc.iter():
  *                 if el.tag not in allow_tags:             # <<<<<<<<<<<<<<
@@ -6135,7 +6125,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":420
+      /* "lxml/html/clean.py":419
  * 
  *             bad = []
  *             for el in doc.iter():             # <<<<<<<<<<<<<<
@@ -6145,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":423
+    /* "lxml/html/clean.py":422
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)
  *             if bad:             # <<<<<<<<<<<<<<
@@ -6155,51 +6145,51 @@ 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":424
+      /* "lxml/html/clean.py":423
  *                     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, 424, __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, 423, __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":425
+        /* "lxml/html/clean.py":424
  *             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, 425, __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, 424, __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":426
+        /* "lxml/html/clean.py":425
  *                 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, 426, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_tag, __pyx_n_s_div) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":427
+        /* "lxml/html/clean.py":426
  *                     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, 427, __pyx_L1_error)
+        __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, 427, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_6);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         __pyx_t_13 = NULL;
@@ -6214,12 +6204,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __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, 427, __pyx_L1_error)
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 426, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":424
+        /* "lxml/html/clean.py":423
  *                     bad.append(el)
  *             if bad:
  *                 if bad[0] is doc:             # <<<<<<<<<<<<<<
@@ -6228,7 +6218,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":428
+      /* "lxml/html/clean.py":427
  *                     el.tag = 'div'
  *                     el.attrib.clear()
  *                 for el in bad:             # <<<<<<<<<<<<<<
@@ -6239,22 +6229,22 @@ 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, 428, __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, 427, __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, 428, __pyx_L1_error)
+        __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);
         #endif
         __Pyx_XDECREF_SET(__pyx_v_el, __pyx_t_6);
         __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":429
+        /* "lxml/html/clean.py":428
  *                     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, 429, __pyx_L1_error)
+        __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_4 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -6268,12 +6258,12 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_13);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L1_error)
+        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;
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":428
+        /* "lxml/html/clean.py":427
  *                     el.tag = 'div'
  *                     el.attrib.clear()
  *                 for el in bad:             # <<<<<<<<<<<<<<
@@ -6283,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":423
+      /* "lxml/html/clean.py":422
  *                 if el.tag not in allow_tags:
  *                     bad.append(el)
  *             if bad:             # <<<<<<<<<<<<<<
@@ -6292,7 +6282,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
     }
 
-    /* "lxml/html/clean.py":412
+    /* "lxml/html/clean.py":411
  *                     "It does not make sense to pass in both allow_tags and remove_unknown_tags")
  *             allow_tags = set(defs.tags)
  *         if allow_tags:             # <<<<<<<<<<<<<<
@@ -6301,27 +6291,27 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
   }
 
-  /* "lxml/html/clean.py":430
+  /* "lxml/html/clean.py":429
  *                 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, 430, __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, 429, __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, 430, __pyx_L1_error)
+  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   if (__pyx_t_10) {
 
-    /* "lxml/html/clean.py":431
+    /* "lxml/html/clean.py":430
  *                     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, 431, __pyx_L1_error)
+    __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))) {
@@ -6335,16 +6325,16 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __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, 431, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 430, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 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_9 = NULL;
     } else {
-      __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 431, __pyx_L1_error)
+      __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, 431, __pyx_L1_error)
+      __pyx_t_9 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L1_error)
     }
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     for (;;) {
@@ -6352,17 +6342,17 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         if (likely(PyList_CheckExact(__pyx_t_6))) {
           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_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 431, __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, 430, __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, 431, __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, 430, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         } else {
           if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) 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, 431, __pyx_L1_error)
+          __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)
           #else
-          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 431, __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, 430, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           #endif
         }
@@ -6372,7 +6362,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, 431, __pyx_L1_error)
+            else __PYX_ERR(0, 430, __pyx_L1_error)
           }
           break;
         }
@@ -6381,14 +6371,14 @@ 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":432
+      /* "lxml/html/clean.py":431
  *         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, 432, __pyx_L1_error)
+      __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_4 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -6402,22 +6392,22 @@ 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_v_el) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_v_el);
       __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, 431, __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, 432, __pyx_L1_error)
+      __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_5); __pyx_t_5 = 0;
       __pyx_t_11 = ((!__pyx_t_10) != 0);
       if (__pyx_t_11) {
 
-        /* "lxml/html/clean.py":433
+        /* "lxml/html/clean.py":432
  *             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, 433, __pyx_L1_error)
+        __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_4 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_13))) {
@@ -6431,30 +6421,30 @@ 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_n_s_rel) : __Pyx_PyObject_CallOneArg(__pyx_t_13, __pyx_n_s_rel);
         __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
-        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 433, __pyx_L1_error)
+        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_5);
         __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
         __Pyx_XDECREF_SET(__pyx_v_rel, __pyx_t_5);
         __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":434
+        /* "lxml/html/clean.py":433
  *                 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, 434, __pyx_L1_error)
+        __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_rel); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 433, __pyx_L1_error)
         if (__pyx_t_11) {
 
-          /* "lxml/html/clean.py":435
+          /* "lxml/html/clean.py":434
  *                     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, 435, __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, 434, __pyx_L1_error)
           __pyx_t_18 = (__pyx_t_10 != 0);
           if (__pyx_t_18) {
           } else {
@@ -6462,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":436
+          /* "lxml/html/clean.py":435
  *                     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, 436, __pyx_L1_error)
+          __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_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, 436, __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, 435, __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":435
+          /* "lxml/html/clean.py":434
  *                     rel = el.get('rel')
  *                     if rel:
  *                         if ('nofollow' in rel             # <<<<<<<<<<<<<<
@@ -6486,7 +6476,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
           if (__pyx_t_11) {
 
-            /* "lxml/html/clean.py":437
+            /* "lxml/html/clean.py":436
  *                         if ('nofollow' in rel
  *                                 and ' nofollow ' in (' %s ' % rel)):
  *                             continue             # <<<<<<<<<<<<<<
@@ -6495,7 +6485,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
             goto __pyx_L99_continue;
 
-            /* "lxml/html/clean.py":435
+            /* "lxml/html/clean.py":434
  *                     rel = el.get('rel')
  *                     if rel:
  *                         if ('nofollow' in rel             # <<<<<<<<<<<<<<
@@ -6504,19 +6494,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
           }
 
-          /* "lxml/html/clean.py":438
+          /* "lxml/html/clean.py":437
  *                                 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, 438, __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, 437, __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":434
+          /* "lxml/html/clean.py":433
  *                 if not self.allow_follow(el):
  *                     rel = el.get('rel')
  *                     if rel:             # <<<<<<<<<<<<<<
@@ -6526,7 +6516,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           goto __pyx_L102;
         }
 
-        /* "lxml/html/clean.py":440
+        /* "lxml/html/clean.py":439
  *                         rel = '%s nofollow' % rel
  *                     else:
  *                         rel = 'nofollow'             # <<<<<<<<<<<<<<
@@ -6539,14 +6529,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         }
         __pyx_L102:;
 
-        /* "lxml/html/clean.py":441
+        /* "lxml/html/clean.py":440
  *                     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, 441, __pyx_L1_error)
+        __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_4 = NULL;
         __pyx_t_7 = 0;
@@ -6563,7 +6553,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         #if CYTHON_FAST_PYCALL
         if (PyFunction_Check(__pyx_t_13)) {
           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, 441, __pyx_L1_error)
+          __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_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
           __Pyx_GOTREF(__pyx_t_5);
         } else
@@ -6571,13 +6561,13 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
         #if CYTHON_FAST_PYCCALL
         if (__Pyx_PyFastCFunction_Check(__pyx_t_13)) {
           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, 441, __pyx_L1_error)
+          __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_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, 441, __pyx_L1_error)
+          __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);
           if (__pyx_t_4) {
             __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_4); __pyx_t_4 = NULL;
@@ -6588,14 +6578,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
           __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, 441, __pyx_L1_error)
+          __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)
           __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_5); __pyx_t_5 = 0;
 
-        /* "lxml/html/clean.py":432
+        /* "lxml/html/clean.py":431
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):
  *                 if not self.allow_follow(el):             # <<<<<<<<<<<<<<
@@ -6604,7 +6594,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
  */
       }
 
-      /* "lxml/html/clean.py":431
+      /* "lxml/html/clean.py":430
  *                     el.drop_tag()
  *         if self.add_nofollow:
  *             for el in _find_external_links(doc):             # <<<<<<<<<<<<<<
@@ -6615,7 +6605,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
     }
     __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-    /* "lxml/html/clean.py":430
+    /* "lxml/html/clean.py":429
  *                 for el in bad:
  *                     el.drop_tag()
  *         if self.add_nofollow:             # <<<<<<<<<<<<<<
@@ -6665,7 +6655,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_2__call__(CYTHON_UNUSED Py
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":443
+/* "lxml/html/clean.py":442
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
@@ -6709,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, 443, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, 1); __PYX_ERR(0, 442, __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, 443, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_follow") < 0)) __PYX_ERR(0, 442, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -6726,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, 443, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_follow", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 442, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_follow", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -6744,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":447
+  /* "lxml/html/clean.py":446
  *         Override to suppress rel="nofollow" on some anchors.
  *         """
  *         return False             # <<<<<<<<<<<<<<
@@ -6756,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":443
+  /* "lxml/html/clean.py":442
  *                     el.set('rel', rel)
  * 
  *     def allow_follow(self, anchor):             # <<<<<<<<<<<<<<
@@ -6771,7 +6761,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_4allow_follow(CYTHON_UNUSE
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":449
+/* "lxml/html/clean.py":448
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
@@ -6815,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, 449, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, 1); __PYX_ERR(0, 448, __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, 449, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_element") < 0)) __PYX_ERR(0, 448, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -6832,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, 449, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_element", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 448, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -6867,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":456
+  /* "lxml/html/clean.py":455
  *         :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, 456, __pyx_L1_error)
+  __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_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, 456, __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, 455, __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, 456, __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, 455, __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":457
+    /* "lxml/html/clean.py":456
  *         """
  *         if el.tag not in self._tag_link_attrs:
  *             return False             # <<<<<<<<<<<<<<
@@ -6896,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":456
+    /* "lxml/html/clean.py":455
  *         :return: true to accept the element or false to reject/discard it.
  *         """
  *         if el.tag not in self._tag_link_attrs:             # <<<<<<<<<<<<<<
@@ -6905,25 +6895,25 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
   }
 
-  /* "lxml/html/clean.py":458
+  /* "lxml/html/clean.py":457
  *         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, 458, __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, 457, __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, 458, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_1);
-  __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 458, __pyx_L1_error)
+  __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_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":459
+  /* "lxml/html/clean.py":458
  *             return False
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):             # <<<<<<<<<<<<<<
@@ -6944,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":460
+    /* "lxml/html/clean.py":459
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:             # <<<<<<<<<<<<<<
@@ -6955,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, 460, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_5);
-      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 460, __pyx_L1_error)
+      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 459, __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, 460, __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, 459, __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, 460, __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, 459, __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, 460, __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, 459, __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, 460, __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, 459, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -6984,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, 460, __pyx_L1_error)
+            else __PYX_ERR(0, 459, __pyx_L1_error)
           }
           break;
         }
@@ -6993,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":461
+      /* "lxml/html/clean.py":460
  *         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, 461, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_2);
       __pyx_t_9 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -7014,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, 461, __pyx_L1_error)
+      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __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":462
+      /* "lxml/html/clean.py":461
  *             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, 462, __pyx_L1_error)
+      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
       __pyx_t_4 = ((!__pyx_t_3) != 0);
       if (__pyx_t_4) {
 
-        /* "lxml/html/clean.py":463
+        /* "lxml/html/clean.py":462
  *                 url = el.get(one_attr)
  *                 if not url:
  *                     return False             # <<<<<<<<<<<<<<
@@ -7044,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":462
+        /* "lxml/html/clean.py":461
  *             for one_attr in attr:
  *                 url = el.get(one_attr)
  *                 if not url:             # <<<<<<<<<<<<<<
@@ -7053,14 +7043,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
       }
 
-      /* "lxml/html/clean.py":464
+      /* "lxml/html/clean.py":463
  *                 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, 464, __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, 463, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_9 = NULL;
       __pyx_t_10 = 0;
@@ -7077,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, 464, __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, 463, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
         __Pyx_GOTREF(__pyx_t_1);
       } else
@@ -7085,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, 464, __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, 463, __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, 464, __pyx_L1_error)
+        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 463, __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;
@@ -7102,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, 464, __pyx_L1_error)
+        __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_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, 464, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 463, __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":465
+        /* "lxml/html/clean.py":464
  *                     return False
  *                 if not self.allow_embedded_url(el, url):
  *                     return False             # <<<<<<<<<<<<<<
@@ -7125,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":464
+        /* "lxml/html/clean.py":463
  *                 if not url:
  *                     return False
  *                 if not self.allow_embedded_url(el, url):             # <<<<<<<<<<<<<<
@@ -7134,7 +7124,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
       }
 
-      /* "lxml/html/clean.py":460
+      /* "lxml/html/clean.py":459
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):
  *             for one_attr in attr:             # <<<<<<<<<<<<<<
@@ -7144,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":466
+    /* "lxml/html/clean.py":465
  *                 if not self.allow_embedded_url(el, url):
  *                     return False
  *             return True             # <<<<<<<<<<<<<<
@@ -7156,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":459
+    /* "lxml/html/clean.py":458
  *             return False
  *         attr = self._tag_link_attrs[el.tag]
  *         if isinstance(attr, (list, tuple)):             # <<<<<<<<<<<<<<
@@ -7165,7 +7155,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
   }
 
-  /* "lxml/html/clean.py":468
+  /* "lxml/html/clean.py":467
  *             return True
  *         else:
  *             url = el.get(attr)             # <<<<<<<<<<<<<<
@@ -7173,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, 468, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_1);
     __pyx_t_2 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -7187,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, 468, __pyx_L1_error)
+    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 467, __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":469
+    /* "lxml/html/clean.py":468
  *         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, 469, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_url); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 468, __pyx_L1_error)
     __pyx_t_4 = ((!__pyx_t_3) != 0);
     if (__pyx_t_4) {
 
-      /* "lxml/html/clean.py":470
+      /* "lxml/html/clean.py":469
  *             url = el.get(attr)
  *             if not url:
  *                 return False             # <<<<<<<<<<<<<<
@@ -7216,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":469
+      /* "lxml/html/clean.py":468
  *         else:
  *             url = el.get(attr)
  *             if not url:             # <<<<<<<<<<<<<<
@@ -7225,7 +7215,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
  */
     }
 
-    /* "lxml/html/clean.py":471
+    /* "lxml/html/clean.py":470
  *             if not url:
  *                 return False
  *             return self.allow_embedded_url(el, url)             # <<<<<<<<<<<<<<
@@ -7233,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, 471, __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, 470, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_2 = NULL;
     __pyx_t_10 = 0;
@@ -7250,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, 471, __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, 470, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
       __Pyx_GOTREF(__pyx_t_5);
     } else
@@ -7258,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, 471, __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, 470, __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, 471, __pyx_L1_error)
+      __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 470, __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;
@@ -7275,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, 471, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_5);
       __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
     }
@@ -7285,7 +7275,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
     goto __pyx_L0;
   }
 
-  /* "lxml/html/clean.py":449
+  /* "lxml/html/clean.py":448
  *         return False
  * 
  *     def allow_element(self, el):             # <<<<<<<<<<<<<<
@@ -7311,7 +7301,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_6allow_element(CYTHON_UNUS
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":473
+/* "lxml/html/clean.py":472
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
@@ -7358,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, 473, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 1); __PYX_ERR(0, 472, __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, 473, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, 2); __PYX_ERR(0, 472, __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, 473, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "allow_embedded_url") < 0)) __PYX_ERR(0, 472, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -7383,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, 473, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("allow_embedded_url", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 472, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.allow_embedded_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -7420,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":482
+  /* "lxml/html/clean.py":481
  *         :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, 482, __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, 481, __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;
@@ -7437,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, 482, __pyx_L1_error)
+  __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_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, 482, __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, 481, __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, 482, __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, 481, __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);
@@ -7449,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":483
+    /* "lxml/html/clean.py":482
  *         """
  *         if self.whitelist_tags is not None and el.tag not in self.whitelist_tags:
  *             return False             # <<<<<<<<<<<<<<
@@ -7461,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":482
+    /* "lxml/html/clean.py":481
  *         :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:             # <<<<<<<<<<<<<<
@@ -7470,14 +7460,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":484
+  /* "lxml/html/clean.py":483
  *         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, 484, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_urlsplit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_6 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -7491,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, 484, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 483, __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))) {
@@ -7500,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, 484, __pyx_L1_error)
+      __PYX_ERR(0, 483, __pyx_L1_error)
     }
     #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
     if (likely(PyTuple_CheckExact(sequence))) {
@@ -7526,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, 484, __pyx_L1_error)
+        PyObject* item = PySequence_ITEM(sequence, i); if (unlikely(!item)) __PYX_ERR(0, 483, __pyx_L1_error)
         __Pyx_GOTREF(item);
         *(temps[i]) = item;
       }
@@ -7536,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, 484, __pyx_L1_error)
+    __pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 483, __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;
@@ -7545,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, 484, __pyx_L1_error)
+    if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 5) < 0) __PYX_ERR(0, 483, __pyx_L1_error)
     __pyx_t_11 = NULL;
     __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
     goto __pyx_L7_unpacking_done;
@@ -7553,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, 484, __pyx_L1_error)
+    __PYX_ERR(0, 483, __pyx_L1_error)
     __pyx_L7_unpacking_done:;
   }
   __pyx_v_scheme = __pyx_t_2;
@@ -7567,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":485
+  /* "lxml/html/clean.py":484
  *             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, 485, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_9);
   __pyx_t_8 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
@@ -7588,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, 485, __pyx_L1_error)
+  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 484, __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, 485, __pyx_L1_error)
+  __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_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, 485, __pyx_L1_error)
+  __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_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, 485, __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, 484, __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":486
+  /* "lxml/html/clean.py":485
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):             # <<<<<<<<<<<<<<
@@ -7612,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, 486, __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, 485, __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, 486, __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, 485, __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":487
+    /* "lxml/html/clean.py":486
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):
  *             return False             # <<<<<<<<<<<<<<
@@ -7637,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":486
+    /* "lxml/html/clean.py":485
  *         scheme, netloc, path, query, fragment = urlsplit(url)
  *         netloc = netloc.lower().split(':', 1)[0]
  *         if scheme not in ('http', 'https'):             # <<<<<<<<<<<<<<
@@ -7646,21 +7636,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":488
+  /* "lxml/html/clean.py":487
  *         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, 488, __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, 487, __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, 488, __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, 487, __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":489
+    /* "lxml/html/clean.py":488
  *             return False
  *         if netloc in self.host_whitelist:
  *             return True             # <<<<<<<<<<<<<<
@@ -7672,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":488
+    /* "lxml/html/clean.py":487
  *         if scheme not in ('http', 'https'):
  *             return False
  *         if netloc in self.host_whitelist:             # <<<<<<<<<<<<<<
@@ -7681,7 +7671,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
  */
   }
 
-  /* "lxml/html/clean.py":490
+  /* "lxml/html/clean.py":489
  *         if netloc in self.host_whitelist:
  *             return True
  *         return False             # <<<<<<<<<<<<<<
@@ -7693,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":473
+  /* "lxml/html/clean.py":472
  *             return self.allow_embedded_url(el, url)
  * 
  *     def allow_embedded_url(self, el, url):             # <<<<<<<<<<<<<<
@@ -7723,7 +7713,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_8allow_embedded_url(CYTHON
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":492
+/* "lxml/html/clean.py":491
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -7767,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, 492, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, 1); __PYX_ERR(0, 491, __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, 492, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "kill_conditional_comments") < 0)) __PYX_ERR(0, 491, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -7784,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, 492, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("kill_conditional_comments", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 491, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.kill_conditional_comments", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -7797,7 +7787,7 @@ static PyObject *__pyx_pw_4lxml_4html_5clean_7Cleaner_11kill_conditional_comment
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":500
+/* "lxml/html/clean.py":499
  *         has_conditional_comment = _conditional_comment_re.search
  *         self._kill_elements(
  *             doc, lambda el: has_conditional_comment(el.text),             # <<<<<<<<<<<<<<
@@ -7835,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, 500, __pyx_L1_error) }
-  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_el, __pyx_n_s_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
+  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)
   __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;
@@ -7852,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, 500, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   __pyx_r = __pyx_t_1;
@@ -7873,7 +7863,7 @@ static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, PyObject *__p
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":492
+/* "lxml/html/clean.py":491
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -7900,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, 492, __pyx_L1_error)
+    __PYX_ERR(0, 491, __pyx_L1_error)
   } else {
     __Pyx_GOTREF(__pyx_cur_scope);
   }
 
-  /* "lxml/html/clean.py":498
+  /* "lxml/html/clean.py":497
  *         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, 498, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_conditional_comment_re); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __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, 498, __pyx_L1_error)
+  __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_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":499
+  /* "lxml/html/clean.py":498
  *         """
  *         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, 499, __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, 498, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
 
-  /* "lxml/html/clean.py":500
+  /* "lxml/html/clean.py":499
  *         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, 500, __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, 499, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
 
-  /* "lxml/html/clean.py":501
+  /* "lxml/html/clean.py":500
  *         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, 501, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_etree); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __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, 501, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_5);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -7968,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, 499, __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, 498, __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;
@@ -7978,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, 499, __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, 498, __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;
@@ -7986,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, 499, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 498, __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;
@@ -8000,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, 499, __pyx_L1_error)
+    __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_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":492
+  /* "lxml/html/clean.py":491
  *         return False
  * 
  *     def kill_conditional_comments(self, doc):             # <<<<<<<<<<<<<<
@@ -8034,7 +8024,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_10kill_conditional_comment
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":503
+/* "lxml/html/clean.py":502
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
@@ -8084,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, 503, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 1); __PYX_ERR(0, 502, __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, 503, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, 2); __PYX_ERR(0, 502, __pyx_L3_error)
         }
         CYTHON_FALLTHROUGH;
         case  3:
@@ -8100,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, 503, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_kill_elements") < 0)) __PYX_ERR(0, 502, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -8120,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, 503, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_kill_elements", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._kill_elements", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8151,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":504
+  /* "lxml/html/clean.py":503
  * 
  *     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, 504, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_bad = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":505
+  /* "lxml/html/clean.py":504
  *     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, 505, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -8184,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, 505, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __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, 505, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
-    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
   }
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   for (;;) {
@@ -8201,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, 505, __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, 504, __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, 505, __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, 504, __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, 505, __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, 504, __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, 505, __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, 504, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_1);
         #endif
       }
@@ -8221,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, 505, __pyx_L1_error)
+          else __PYX_ERR(0, 504, __pyx_L1_error)
         }
         break;
       }
@@ -8230,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":506
+    /* "lxml/html/clean.py":505
  *         bad = []
  *         for el in doc.iter(iterate):
  *             if condition(el):             # <<<<<<<<<<<<<<
@@ -8250,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, 506, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __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, 506, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
     if (__pyx_t_7) {
 
-      /* "lxml/html/clean.py":507
+      /* "lxml/html/clean.py":506
  *         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, 507, __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, 506, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":506
+      /* "lxml/html/clean.py":505
  *         bad = []
  *         for el in doc.iter(iterate):
  *             if condition(el):             # <<<<<<<<<<<<<<
@@ -8275,7 +8265,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
  */
     }
 
-    /* "lxml/html/clean.py":505
+    /* "lxml/html/clean.py":504
  *     def _kill_elements(self, doc, condition, iterate=None):
  *         bad = []
  *         for el in doc.iter(iterate):             # <<<<<<<<<<<<<<
@@ -8285,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":508
+  /* "lxml/html/clean.py":507
  *             if condition(el):
  *                 bad.append(el)
  *         for el in bad:             # <<<<<<<<<<<<<<
@@ -8296,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, 508, __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, 507, __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, 508, __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, 507, __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":509
+    /* "lxml/html/clean.py":508
  *                 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, 509, __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, 508, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_3);
     __pyx_t_6 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -8325,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, 509, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 508, __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":508
+    /* "lxml/html/clean.py":507
  *             if condition(el):
  *                 bad.append(el)
  *         for el in bad:             # <<<<<<<<<<<<<<
@@ -8340,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":503
+  /* "lxml/html/clean.py":502
  *             etree.Comment)
  * 
  *     def _kill_elements(self, doc, condition, iterate=None):             # <<<<<<<<<<<<<<
@@ -8366,7 +8356,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_12_kill_elements(CYTHON_UN
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":511
+/* "lxml/html/clean.py":510
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
@@ -8409,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, 511, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, 1); __PYX_ERR(0, 510, __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, 511, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_remove_javascript_link") < 0)) __PYX_ERR(0, 510, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -8426,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, 511, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_remove_javascript_link", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 510, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._remove_javascript_link", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8455,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":513
+  /* "lxml/html/clean.py":512
  *     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, 513, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __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, 513, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_unquote_plus); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -8478,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, 513, __pyx_L1_error)
+  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   __pyx_t_4 = NULL;
@@ -8496,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, 513, __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, 512, __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;
@@ -8505,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, 513, __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, 512, __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, 513, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 512, __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;
@@ -8523,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, 513, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -8531,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":514
+  /* "lxml/html/clean.py":513
  *         # 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, 514, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_is_javascript_scheme); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -8552,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, 514, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __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, 514, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 513, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   if (__pyx_t_7) {
 
-    /* "lxml/html/clean.py":516
+    /* "lxml/html/clean.py":515
  *         if _is_javascript_scheme(new):
  *             # FIXME: should this be None to delete?
  *             return ''             # <<<<<<<<<<<<<<
@@ -8571,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":514
+    /* "lxml/html/clean.py":513
  *         # 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):             # <<<<<<<<<<<<<<
@@ -8580,7 +8570,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
  */
   }
 
-  /* "lxml/html/clean.py":517
+  /* "lxml/html/clean.py":516
  *             # FIXME: should this be None to delete?
  *             return ''
  *         return link             # <<<<<<<<<<<<<<
@@ -8592,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":511
+  /* "lxml/html/clean.py":510
  *             el.drop_tree()
  * 
  *     def _remove_javascript_link(self, link):             # <<<<<<<<<<<<<<
@@ -8616,7 +8606,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_14_remove_javascript_link(
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":521
+/* "lxml/html/clean.py":520
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
  * 
  *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
@@ -8660,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, 521, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, 1); __PYX_ERR(0, 520, __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, 521, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_has_sneaky_javascript") < 0)) __PYX_ERR(0, 520, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -8677,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, 521, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_has_sneaky_javascript", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 520, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner._has_sneaky_javascript", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -8706,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":532
+  /* "lxml/html/clean.py":531
  *         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, 532, __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, 531, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   __pyx_t_4 = 0;
@@ -8730,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, 532, __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, 531, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -8738,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, 532, __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, 531, __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, 532, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 531, __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;
@@ -8755,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, 532, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -8763,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":533
+  /* "lxml/html/clean.py":532
  *         """
  *         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, 533, __pyx_L1_error)
+  __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_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, 533, __pyx_L1_error)
+  __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_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":534
+  /* "lxml/html/clean.py":533
  *         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, 534, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_substitute_whitespace); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 533, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_t_5 = NULL;
   __pyx_t_4 = 0;
@@ -8802,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, 534, __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, 533, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -8810,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, 534, __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, 533, __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, 534, __pyx_L1_error)
+    __pyx_t_3 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 533, __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;
@@ -8827,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, 534, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
   }
@@ -8835,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":535
+  /* "lxml/html/clean.py":534
  *         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, 535, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_1);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -8856,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, 535, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __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":536
+  /* "lxml/html/clean.py":535
  *         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, 536, __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, 535, __pyx_L1_error)
   __pyx_t_7 = (__pyx_t_6 != 0);
   if (__pyx_t_7) {
 
-    /* "lxml/html/clean.py":537
+    /* "lxml/html/clean.py":536
  *         style = style.lower()
  *         if 'javascript:' in style:
  *             return True             # <<<<<<<<<<<<<<
@@ -8885,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":536
+    /* "lxml/html/clean.py":535
  *         style = _substitute_whitespace('', style)
  *         style = style.lower()
  *         if 'javascript:' in style:             # <<<<<<<<<<<<<<
@@ -8894,41 +8884,73 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
  */
   }
 
-  /* "lxml/html/clean.py":538
+  /* "lxml/html/clean.py":537
  *         if 'javascript:' in style:
  *             return True
  *         if 'expression(' in style:             # <<<<<<<<<<<<<<
  *             return True
- *         return False
+ *         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, 538, __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, 537, __pyx_L1_error)
   __pyx_t_6 = (__pyx_t_7 != 0);
   if (__pyx_t_6) {
 
-    /* "lxml/html/clean.py":539
+    /* "lxml/html/clean.py":538
  *             return True
  *         if 'expression(' in style:
  *             return True             # <<<<<<<<<<<<<<
- *         return False
- * 
+ *         if '</noscript' in style:
+ *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
  */
     __Pyx_XDECREF(__pyx_r);
     __Pyx_INCREF(Py_True);
     __pyx_r = Py_True;
     goto __pyx_L0;
 
-    /* "lxml/html/clean.py":538
+    /* "lxml/html/clean.py":537
  *         if 'javascript:' in style:
  *             return True
  *         if 'expression(' in style:             # <<<<<<<<<<<<<<
  *             return True
- *         return False
+ *         if '</noscript' in style:
  */
   }
 
-  /* "lxml/html/clean.py":540
+  /* "lxml/html/clean.py":539
  *         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_7 = (__pyx_t_6 != 0);
+  if (__pyx_t_7) {
+
+    /* "lxml/html/clean.py":541
+ *         if '</noscript' in style:
+ *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
+ *             return True             # <<<<<<<<<<<<<<
+ *         return False
+ * 
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(Py_True);
+    __pyx_r = Py_True;
+    goto __pyx_L0;
+
+    /* "lxml/html/clean.py":539
+ *         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
+ */
+  }
+
+  /* "lxml/html/clean.py":542
+ *             # e.g. '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
+ *             return True
  *         return False             # <<<<<<<<<<<<<<
  * 
  *     def clean_html(self, html):
@@ -8938,7 +8960,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   __pyx_r = Py_False;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":521
+  /* "lxml/html/clean.py":520
  *     _substitute_comments = re.compile(r'/\*.*?\*[inserted by cython to avoid comment closer]/', re.S).sub
  * 
  *     def _has_sneaky_javascript(self, style):             # <<<<<<<<<<<<<<
@@ -8961,7 +8983,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_16_has_sneaky_javascript(C
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":542
+/* "lxml/html/clean.py":544
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
@@ -9004,11 +9026,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, 542, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, 1); __PYX_ERR(0, 544, __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, 542, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "clean_html") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
       goto __pyx_L5_argtuple_error;
@@ -9021,7 +9043,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, 542, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("clean_html", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.Cleaner.clean_html", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9051,7 +9073,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":543
+  /* "lxml/html/clean.py":545
  * 
  *     def clean_html(self, html):
  *         result_type = type(html)             # <<<<<<<<<<<<<<
@@ -9061,28 +9083,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":544
+  /* "lxml/html/clean.py":546
  *     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, 544, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __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, 544, __pyx_L1_error)
+  __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":545
+    /* "lxml/html/clean.py":547
  *         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, 545, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -9096,13 +9118,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, 545, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __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":544
+    /* "lxml/html/clean.py":546
  *     def clean_html(self, html):
  *         result_type = type(html)
  *         if isinstance(html, basestring):             # <<<<<<<<<<<<<<
@@ -9112,7 +9134,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
     goto __pyx_L3;
   }
 
-  /* "lxml/html/clean.py":547
+  /* "lxml/html/clean.py":549
  *             doc = fromstring(html)
  *         else:
  *             doc = copy.deepcopy(html)             # <<<<<<<<<<<<<<
@@ -9120,9 +9142,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, 547, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __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, 547, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = NULL;
@@ -9137,7 +9159,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, 547, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_doc = __pyx_t_1;
@@ -9145,7 +9167,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   }
   __pyx_L3:;
 
-  /* "lxml/html/clean.py":548
+  /* "lxml/html/clean.py":550
  *         else:
  *             doc = copy.deepcopy(html)
  *         self(doc)             # <<<<<<<<<<<<<<
@@ -9165,12 +9187,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, 548, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 550, __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":549
+  /* "lxml/html/clean.py":551
  *             doc = copy.deepcopy(html)
  *         self(doc)
  *         return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -9178,7 +9200,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, 549, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __pyx_t_4 = NULL;
   __pyx_t_6 = 0;
@@ -9195,7 +9217,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, 549, __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, 551, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
     __Pyx_GOTREF(__pyx_t_1);
   } else
@@ -9203,13 +9225,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, 549, __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, 551, __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, 549, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 551, __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;
@@ -9220,7 +9242,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, 549, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -9229,7 +9251,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   __pyx_t_1 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":542
+  /* "lxml/html/clean.py":544
  *         return False
  * 
  *     def clean_html(self, html):             # <<<<<<<<<<<<<<
@@ -9253,7 +9275,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_7Cleaner_18clean_html(CYTHON_UNUSED
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":574
+/* "lxml/html/clean.py":576
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
@@ -9271,7 +9293,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, 574, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __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);
@@ -9285,7 +9307,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, 574, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
@@ -9381,7 +9403,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, 574, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "autolink") < 0)) __PYX_ERR(0, 576, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -9406,7 +9428,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, 574, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("autolink", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.autolink", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -9444,21 +9466,21 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   int __pyx_clineno = 0;
   __Pyx_RefNannySetupContext("autolink", 0);
 
-  /* "lxml/html/clean.py":592
+  /* "lxml/html/clean.py":594
  *     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, 592, __pyx_L1_error)
+  __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_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, 592, __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, 594, __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":593
+    /* "lxml/html/clean.py":595
  *     """
  *     if el.tag in avoid_elements:
  *         return             # <<<<<<<<<<<<<<
@@ -9469,7 +9491,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":592
+    /* "lxml/html/clean.py":594
  *     substituted, only the contents of the element.
  *     """
  *     if el.tag in avoid_elements:             # <<<<<<<<<<<<<<
@@ -9478,14 +9500,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":594
+  /* "lxml/html/clean.py":596
  *     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, 594, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_4);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -9499,30 +9521,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, 594, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 596, __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":595
+  /* "lxml/html/clean.py":597
  *         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, 595, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 597, __pyx_L1_error)
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":596
+    /* "lxml/html/clean.py":598
  *     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, 596, __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, 598, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
@@ -9536,13 +9558,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, 596, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 598, __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":597
+    /* "lxml/html/clean.py":599
  *     if class_name:
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:             # <<<<<<<<<<<<<<
@@ -9553,26 +9575,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, 597, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_1);
-      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error)
+      __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __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, 597, __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, 599, __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, 597, __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, 599, __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, 597, __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, 599, __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, 597, __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, 599, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_4);
           #endif
         }
@@ -9582,7 +9604,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, 597, __pyx_L1_error)
+            else __PYX_ERR(0, 599, __pyx_L1_error)
           }
           break;
         }
@@ -9591,18 +9613,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":598
+      /* "lxml/html/clean.py":600
  *         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, 598, __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, 600, __pyx_L1_error)
       __pyx_t_2 = (__pyx_t_3 != 0);
       if (__pyx_t_2) {
 
-        /* "lxml/html/clean.py":599
+        /* "lxml/html/clean.py":601
  *         for match_class in avoid_classes:
  *             if match_class in class_name:
  *                 return             # <<<<<<<<<<<<<<
@@ -9614,7 +9636,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":598
+        /* "lxml/html/clean.py":600
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:
  *             if match_class in class_name:             # <<<<<<<<<<<<<<
@@ -9623,7 +9645,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
       }
 
-      /* "lxml/html/clean.py":597
+      /* "lxml/html/clean.py":599
  *     if class_name:
  *         class_name = class_name.split()
  *         for match_class in avoid_classes:             # <<<<<<<<<<<<<<
@@ -9633,7 +9655,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":595
+    /* "lxml/html/clean.py":597
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
@@ -9642,128 +9664,128 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":600
+  /* "lxml/html/clean.py":602
  *             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, 600, __pyx_L1_error)
+  __pyx_t_1 = PySequence_List(__pyx_v_el); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __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, 600, __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, 602, __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, 600, __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, 602, __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":601
+    /* "lxml/html/clean.py":603
  *                 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, 601, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 603, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 603, __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, 601, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 603, __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, 601, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_link_regexes, __pyx_v_link_regexes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":602
+    /* "lxml/html/clean.py":604
  *     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, 601, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":603
+    /* "lxml/html/clean.py":605
  *         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, 601, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_hosts, __pyx_v_avoid_hosts) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":604
+    /* "lxml/html/clean.py":606
  *                  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, 601, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 603, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":601
+    /* "lxml/html/clean.py":603
  *                 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, 601, __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, 603, __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":605
+    /* "lxml/html/clean.py":607
  *                  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, 605, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_9);
-    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 605, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 607, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
     if (__pyx_t_2) {
 
-      /* "lxml/html/clean.py":606
+      /* "lxml/html/clean.py":608
  *                  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, 606, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_link_text); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_9);
 
-      /* "lxml/html/clean.py":607
+      /* "lxml/html/clean.py":609
  *         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, 607, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_8);
 
-      /* "lxml/html/clean.py":606
+      /* "lxml/html/clean.py":608
  *                  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, 606, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
       __Pyx_GIVEREF(__pyx_t_8);
       PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
@@ -9775,28 +9797,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":607
+      /* "lxml/html/clean.py":609
  *         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, 607, __pyx_L1_error)
+      __pyx_t_8 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 609, __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, 607, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_1);
-      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 607, __pyx_L1_error)
+      if (PyDict_SetItem(__pyx_t_8, __pyx_n_s_factory, __pyx_t_1) < 0) __PYX_ERR(0, 609, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
 
-      /* "lxml/html/clean.py":606
+      /* "lxml/html/clean.py":608
  *                  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, 606, __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, 608, __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;
@@ -9807,7 +9829,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, 606, __pyx_L1_error)
+          __PYX_ERR(0, 608, __pyx_L1_error)
         }
         #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
         if (likely(PyTuple_CheckExact(sequence))) {
@@ -9820,15 +9842,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, 606, __pyx_L1_error)
+        __pyx_t_8 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 608, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_8);
-        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
+        __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 608, __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, 606, __pyx_L1_error)
+        __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 608, __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;
@@ -9836,7 +9858,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, 606, __pyx_L1_error)
+        if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_9), 2) < 0) __PYX_ERR(0, 608, __pyx_L1_error)
         __pyx_t_10 = NULL;
         __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
         goto __pyx_L12_unpacking_done;
@@ -9844,7 +9866,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, 606, __pyx_L1_error)
+        __PYX_ERR(0, 608, __pyx_L1_error)
         __pyx_L12_unpacking_done:;
       }
       __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_8);
@@ -9852,33 +9874,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":608
+      /* "lxml/html/clean.py":610
  *             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, 608, __pyx_L1_error)
+      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_tail_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 610, __pyx_L1_error)
       if (__pyx_t_2) {
 
-        /* "lxml/html/clean.py":609
+        /* "lxml/html/clean.py":611
  *                 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, 609, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
 
-        /* "lxml/html/clean.py":610
+        /* "lxml/html/clean.py":612
  *             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, 610, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_5);
         __pyx_t_8 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -9892,28 +9914,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, 610, __pyx_L1_error)
+        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 612, __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":611
+        /* "lxml/html/clean.py":613
  *                 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, 611, __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, 613, __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, 611, __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, 613, __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, 611, __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, 613, __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":608
+        /* "lxml/html/clean.py":610
  *             text, tail_children = _link_text(
  *                 child.tail, link_regexes, avoid_hosts, factory=el.makeelement)
  *             if tail_children:             # <<<<<<<<<<<<<<
@@ -9922,7 +9944,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
       }
 
-      /* "lxml/html/clean.py":605
+      /* "lxml/html/clean.py":607
  *                  avoid_hosts=avoid_hosts,
  *                  avoid_classes=avoid_classes)
  *         if child.tail:             # <<<<<<<<<<<<<<
@@ -9931,7 +9953,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
     }
 
-    /* "lxml/html/clean.py":600
+    /* "lxml/html/clean.py":602
  *             if match_class in class_name:
  *                 return
  *     for child in list(el):             # <<<<<<<<<<<<<<
@@ -9941,47 +9963,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":612
+  /* "lxml/html/clean.py":614
  *                 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, 612, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_4);
-  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 612, __pyx_L1_error)
+  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 614, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
   if (__pyx_t_2) {
 
-    /* "lxml/html/clean.py":613
+    /* "lxml/html/clean.py":615
  *                 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, 613, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_link_text); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
 
-    /* "lxml/html/clean.py":614
+    /* "lxml/html/clean.py":616
  *     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, 614, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
 
-    /* "lxml/html/clean.py":613
+    /* "lxml/html/clean.py":615
  *                 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, 613, __pyx_L1_error)
+    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_GIVEREF(__pyx_t_5);
     PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
@@ -9993,28 +10015,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":614
+    /* "lxml/html/clean.py":616
  *     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, 614, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 616, __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, 614, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_8);
-    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 614, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_factory, __pyx_t_8) < 0) __PYX_ERR(0, 616, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-    /* "lxml/html/clean.py":613
+    /* "lxml/html/clean.py":615
  *                 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, 613, __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, 615, __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;
@@ -10025,7 +10047,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, 613, __pyx_L1_error)
+        __PYX_ERR(0, 615, __pyx_L1_error)
       }
       #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
       if (likely(PyTuple_CheckExact(sequence))) {
@@ -10038,15 +10060,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, 613, __pyx_L1_error)
+      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 615, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_5);
-      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 613, __pyx_L1_error)
+      __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 615, __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, 613, __pyx_L1_error)
+      __pyx_t_4 = PyObject_GetIter(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 615, __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;
@@ -10054,7 +10076,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, 613, __pyx_L1_error)
+      if (__Pyx_IternextUnpackEndCheck(__pyx_t_10(__pyx_t_4), 2) < 0) __PYX_ERR(0, 615, __pyx_L1_error)
       __pyx_t_10 = NULL;
       __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
       goto __pyx_L16_unpacking_done;
@@ -10062,7 +10084,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, 613, __pyx_L1_error)
+      __PYX_ERR(0, 615, __pyx_L1_error)
       __pyx_L16_unpacking_done:;
     }
     __Pyx_XDECREF_SET(__pyx_v_text, __pyx_t_5);
@@ -10070,35 +10092,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":615
+    /* "lxml/html/clean.py":617
  *         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, 615, __pyx_L1_error)
+    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_pre_children); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 617, __pyx_L1_error)
     if (__pyx_t_2) {
 
-      /* "lxml/html/clean.py":616
+      /* "lxml/html/clean.py":618
  *             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, 616, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_v_text) < 0) __PYX_ERR(0, 618, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":617
+      /* "lxml/html/clean.py":619
  *         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, 617, __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, 619, __pyx_L1_error)
 
-      /* "lxml/html/clean.py":615
+      /* "lxml/html/clean.py":617
  *         text, pre_children = _link_text(
  *             el.text, link_regexes, avoid_hosts, factory=el.makeelement)
  *         if pre_children:             # <<<<<<<<<<<<<<
@@ -10107,7 +10129,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
     }
 
-    /* "lxml/html/clean.py":612
+    /* "lxml/html/clean.py":614
  *                 index = el.index(child)
  *                 el[index+1:index+1] = tail_children
  *     if el.text:             # <<<<<<<<<<<<<<
@@ -10116,7 +10138,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
  */
   }
 
-  /* "lxml/html/clean.py":574
+  /* "lxml/html/clean.py":576
  * _avoid_classes = ['nolink']
  * 
  * def autolink(el, link_regexes=_link_regexes,             # <<<<<<<<<<<<<<
@@ -10148,7 +10170,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_2autolink(CYTHON_UNUSED PyObject *_
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":619
+/* "lxml/html/clean.py":621
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
@@ -10197,23 +10219,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, 619, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 1); __PYX_ERR(0, 621, __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, 619, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 2); __PYX_ERR(0, 621, __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, 619, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, 3); __PYX_ERR(0, 621, __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, 619, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_link_text") < 0)) __PYX_ERR(0, 621, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
       goto __pyx_L5_argtuple_error;
@@ -10230,7 +10252,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, 619, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_link_text", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 621, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._link_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -10281,7 +10303,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":620
+  /* "lxml/html/clean.py":622
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):
  *     leading_text = ''             # <<<<<<<<<<<<<<
@@ -10291,19 +10313,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":621
+  /* "lxml/html/clean.py":623
  * 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, 621, __pyx_L1_error)
+  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __pyx_v_links = ((PyObject*)__pyx_t_1);
   __pyx_t_1 = 0;
 
-  /* "lxml/html/clean.py":622
+  /* "lxml/html/clean.py":624
  *     leading_text = ''
  *     links = []
  *     last_pos = 0             # <<<<<<<<<<<<<<
@@ -10312,7 +10334,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
   __pyx_v_last_pos = 0;
 
-  /* "lxml/html/clean.py":623
+  /* "lxml/html/clean.py":625
  *     links = []
  *     last_pos = 0
  *     while 1:             # <<<<<<<<<<<<<<
@@ -10321,7 +10343,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
   while (1) {
 
-    /* "lxml/html/clean.py":624
+    /* "lxml/html/clean.py":626
  *     last_pos = 0
  *     while 1:
  *         best_match, best_pos = None, None             # <<<<<<<<<<<<<<
@@ -10337,7 +10359,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":625
+    /* "lxml/html/clean.py":627
  *     while 1:
  *         best_match, best_pos = None, None
  *         for regex in link_regexes:             # <<<<<<<<<<<<<<
@@ -10348,26 +10370,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, 625, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_2);
-      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 625, __pyx_L1_error)
+      __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 627, __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, 625, __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, 627, __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, 625, __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, 627, __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, 625, __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, 627, __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, 625, __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, 627, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -10377,7 +10399,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, 625, __pyx_L1_error)
+            else __PYX_ERR(0, 627, __pyx_L1_error)
           }
           break;
         }
@@ -10386,19 +10408,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":626
+      /* "lxml/html/clean.py":628
  *         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, 626, __pyx_L1_error)
+      __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_last_pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 628, __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":627
+      /* "lxml/html/clean.py":629
  *         for regex in link_regexes:
  *             regex_pos = last_pos
  *             while 1:             # <<<<<<<<<<<<<<
@@ -10407,24 +10429,24 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       while (1) {
 
-        /* "lxml/html/clean.py":628
+        /* "lxml/html/clean.py":630
  *             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, 628, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_1);
-        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 628, __pyx_L1_error)
+        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 630, __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, 628, __pyx_L1_error)
+        __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 630, __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, 628, __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, 628, __pyx_L1_error)
+        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)
         __Pyx_GOTREF(__pyx_t_7);
         __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
         __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
@@ -10432,7 +10454,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":629
+        /* "lxml/html/clean.py":631
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:             # <<<<<<<<<<<<<<
@@ -10443,7 +10465,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":630
+          /* "lxml/html/clean.py":632
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:
  *                     break             # <<<<<<<<<<<<<<
@@ -10452,7 +10474,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
           goto __pyx_L8_break;
 
-          /* "lxml/html/clean.py":629
+          /* "lxml/html/clean.py":631
  *             while 1:
  *                 match = regex.search(text, pos=regex_pos)
  *                 if match is None:             # <<<<<<<<<<<<<<
@@ -10461,14 +10483,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
         }
 
-        /* "lxml/html/clean.py":631
+        /* "lxml/html/clean.py":633
  *                 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, 631, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_6);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -10482,13 +10504,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, 631, __pyx_L1_error)
+        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 633, __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":632
+        /* "lxml/html/clean.py":634
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10499,26 +10521,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, 632, __pyx_L1_error)
+          __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_GOTREF(__pyx_t_7);
-          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 632, __pyx_L1_error)
+          __pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 634, __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, 632, __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, 634, __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, 632, __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, 634, __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, 632, __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, 634, __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, 632, __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, 634, __pyx_L1_error)
               __Pyx_GOTREF(__pyx_t_6);
               #endif
             }
@@ -10528,7 +10550,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, 632, __pyx_L1_error)
+                else __PYX_ERR(0, 634, __pyx_L1_error)
               }
               break;
             }
@@ -10537,14 +10559,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":633
+          /* "lxml/html/clean.py":635
  *                 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, 633, __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, 635, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_5);
           __pyx_t_1 = NULL;
           if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -10558,21 +10580,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, 633, __pyx_L1_error)
+          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 635, __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, 633, __pyx_L1_error)
+          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 635, __pyx_L1_error)
           __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
           if (__pyx_t_9) {
 
-            /* "lxml/html/clean.py":634
+            /* "lxml/html/clean.py":636
  *                 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, 634, __pyx_L1_error)
+            __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_GOTREF(__pyx_t_5);
             __pyx_t_1 = NULL;
             if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
@@ -10586,13 +10608,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, 634, __pyx_L1_error)
+            if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 636, __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":635
+            /* "lxml/html/clean.py":637
  *                     if host_regex.search(host):
  *                         regex_pos = match.end()
  *                         break             # <<<<<<<<<<<<<<
@@ -10601,7 +10623,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
             goto __pyx_L11_break;
 
-            /* "lxml/html/clean.py":633
+            /* "lxml/html/clean.py":635
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:
  *                     if host_regex.search(host):             # <<<<<<<<<<<<<<
@@ -10610,7 +10632,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
           }
 
-          /* "lxml/html/clean.py":632
+          /* "lxml/html/clean.py":634
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10620,7 +10642,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         }
         /*else*/ {
 
-          /* "lxml/html/clean.py":637
+          /* "lxml/html/clean.py":639
  *                         break
  *                 else:
  *                     break             # <<<<<<<<<<<<<<
@@ -10630,7 +10652,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
           goto __pyx_L8_break;
         }
 
-        /* "lxml/html/clean.py":632
+        /* "lxml/html/clean.py":634
  *                     break
  *                 host = match.group('host')
  *                 for host_regex in avoid_hosts:             # <<<<<<<<<<<<<<
@@ -10642,19 +10664,19 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       }
       __pyx_L8_break:;
 
-      /* "lxml/html/clean.py":638
+      /* "lxml/html/clean.py":640
  *                 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, 638, __pyx_L1_error) }
+      if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 640, __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":639
+        /* "lxml/html/clean.py":641
  *                     break
  *             if match is None:
  *                 continue             # <<<<<<<<<<<<<<
@@ -10663,7 +10685,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
         goto __pyx_L5_continue;
 
-        /* "lxml/html/clean.py":638
+        /* "lxml/html/clean.py":640
  *                 else:
  *                     break
  *             if match is None:             # <<<<<<<<<<<<<<
@@ -10672,7 +10694,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":640
+      /* "lxml/html/clean.py":642
  *             if match is None:
  *                 continue
  *             if best_pos is None or match.start() < best_pos:             # <<<<<<<<<<<<<<
@@ -10686,8 +10708,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, 640, __pyx_L1_error) }
-      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 640, __pyx_L1_error)
+      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)
       __Pyx_GOTREF(__pyx_t_6);
       __pyx_t_5 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
@@ -10701,37 +10723,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, 640, __pyx_L1_error)
+      if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __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, 640, __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, 642, __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, 640, __pyx_L1_error)
+      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 642, __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":641
+        /* "lxml/html/clean.py":643
  *                 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, 641, __pyx_L1_error) }
+        if (unlikely(!__pyx_v_match)) { __Pyx_RaiseUnboundLocalError("match"); __PYX_ERR(0, 643, __pyx_L1_error) }
         __Pyx_INCREF(__pyx_v_match);
         __Pyx_DECREF_SET(__pyx_v_best_match, __pyx_v_match);
 
-        /* "lxml/html/clean.py":642
+        /* "lxml/html/clean.py":644
  *             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, 642, __pyx_L1_error) }
-        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_match, __pyx_n_s_start); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 642, __pyx_L1_error)
+        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)
         __Pyx_GOTREF(__pyx_t_7);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
@@ -10745,13 +10767,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, 642, __pyx_L1_error)
+        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 644, __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":640
+        /* "lxml/html/clean.py":642
  *             if match is None:
  *                 continue
  *             if best_pos is None or match.start() < best_pos:             # <<<<<<<<<<<<<<
@@ -10760,7 +10782,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":625
+      /* "lxml/html/clean.py":627
  *     while 1:
  *         best_match, best_pos = None, None
  *         for regex in link_regexes:             # <<<<<<<<<<<<<<
@@ -10771,7 +10793,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":643
+    /* "lxml/html/clean.py":645
  *                 best_match = match
  *                 best_pos = match.start()
  *         if best_match is None:             # <<<<<<<<<<<<<<
@@ -10782,7 +10804,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":645
+      /* "lxml/html/clean.py":647
  *         if best_match is None:
  *             # No more matches
  *             if links:             # <<<<<<<<<<<<<<
@@ -10792,7 +10814,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":646
+        /* "lxml/html/clean.py":648
  *             # No more matches
  *             if links:
  *                 assert not links[-1].tail             # <<<<<<<<<<<<<<
@@ -10801,33 +10823,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, 646, __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, 648, __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, 646, __pyx_L1_error)
+          __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_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, 646, __pyx_L1_error)
+          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 648, __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, 646, __pyx_L1_error)
+            __PYX_ERR(0, 648, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "lxml/html/clean.py":647
+        /* "lxml/html/clean.py":649
  *             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, 647, __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, 649, __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, 647, __pyx_L1_error)
+        if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_text) < 0) __PYX_ERR(0, 649, __pyx_L1_error)
         __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-        /* "lxml/html/clean.py":645
+        /* "lxml/html/clean.py":647
  *         if best_match is None:
  *             # No more matches
  *             if links:             # <<<<<<<<<<<<<<
@@ -10837,7 +10859,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
         goto __pyx_L19;
       }
 
-      /* "lxml/html/clean.py":649
+      /* "lxml/html/clean.py":651
  *                 links[-1].tail = text
  *             else:
  *                 assert not leading_text             # <<<<<<<<<<<<<<
@@ -10847,15 +10869,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, 649, __pyx_L1_error)
+          __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 651, __pyx_L1_error)
           if (unlikely(!((!__pyx_t_12) != 0))) {
             PyErr_SetNone(PyExc_AssertionError);
-            __PYX_ERR(0, 649, __pyx_L1_error)
+            __PYX_ERR(0, 651, __pyx_L1_error)
           }
         }
         #endif
 
-        /* "lxml/html/clean.py":650
+        /* "lxml/html/clean.py":652
  *             else:
  *                 assert not leading_text
  *                 leading_text = text             # <<<<<<<<<<<<<<
@@ -10867,7 +10889,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       }
       __pyx_L19:;
 
-      /* "lxml/html/clean.py":651
+      /* "lxml/html/clean.py":653
  *                 assert not leading_text
  *                 leading_text = text
  *             break             # <<<<<<<<<<<<<<
@@ -10876,7 +10898,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
       goto __pyx_L4_break;
 
-      /* "lxml/html/clean.py":643
+      /* "lxml/html/clean.py":645
  *                 best_match = match
  *                 best_pos = match.start()
  *         if best_match is None:             # <<<<<<<<<<<<<<
@@ -10885,14 +10907,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":652
+    /* "lxml/html/clean.py":654
  *                 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, 652, __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, 654, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10906,20 +10928,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, 652, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 654, __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":653
+    /* "lxml/html/clean.py":655
  *             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, 653, __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, 655, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10933,20 +10955,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, 653, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 655, __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":654
+    /* "lxml/html/clean.py":656
  *         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, 654, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10960,17 +10982,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, 654, __pyx_L1_error)
+    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_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 654, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __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, 654, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -10984,40 +11006,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, 654, __pyx_L1_error)
+    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_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 654, __pyx_L1_error)
+    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 656, __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":656
+      /* "lxml/html/clean.py":658
  *         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, 656, __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, 658, __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":657
+      /* "lxml/html/clean.py":659
  *             # 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, 657, __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, 659, __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":654
+      /* "lxml/html/clean.py":656
  *         link = best_match.group(0)
  *         end = best_match.end()
  *         if link.endswith('.') or link.endswith(','):             # <<<<<<<<<<<<<<
@@ -11026,14 +11048,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":658
+    /* "lxml/html/clean.py":660
  *             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, 658, __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, 660, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11047,16 +11069,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, 658, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __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, 658, __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, 660, __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":659
+    /* "lxml/html/clean.py":661
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]
  *         if links:             # <<<<<<<<<<<<<<
@@ -11066,7 +11088,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":660
+      /* "lxml/html/clean.py":662
  *         prev_text = text[:best_match.start()]
  *         if links:
  *             assert not links[-1].tail             # <<<<<<<<<<<<<<
@@ -11075,33 +11097,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, 660, __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, 662, __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, 660, __pyx_L1_error)
+        __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_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, 660, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 662, __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, 660, __pyx_L1_error)
+          __PYX_ERR(0, 662, __pyx_L1_error)
         }
       }
       #endif
 
-      /* "lxml/html/clean.py":661
+      /* "lxml/html/clean.py":663
  *         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, 661, __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, 663, __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, 661, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_t_6, __pyx_n_s_tail, __pyx_v_prev_text) < 0) __PYX_ERR(0, 663, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
-      /* "lxml/html/clean.py":659
+      /* "lxml/html/clean.py":661
  *             link = link[:-1]
  *         prev_text = text[:best_match.start()]
  *         if links:             # <<<<<<<<<<<<<<
@@ -11111,7 +11133,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
       goto __pyx_L23;
     }
 
-    /* "lxml/html/clean.py":663
+    /* "lxml/html/clean.py":665
  *             links[-1].tail = prev_text
  *         else:
  *             assert not leading_text             # <<<<<<<<<<<<<<
@@ -11121,15 +11143,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, 663, __pyx_L1_error)
+        __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_leading_text); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 665, __pyx_L1_error)
         if (unlikely(!((!__pyx_t_12) != 0))) {
           PyErr_SetNone(PyExc_AssertionError);
-          __PYX_ERR(0, 663, __pyx_L1_error)
+          __PYX_ERR(0, 665, __pyx_L1_error)
         }
       }
       #endif
 
-      /* "lxml/html/clean.py":664
+      /* "lxml/html/clean.py":666
  *         else:
  *             assert not leading_text
  *             leading_text = prev_text             # <<<<<<<<<<<<<<
@@ -11141,7 +11163,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
     }
     __pyx_L23:;
 
-    /* "lxml/html/clean.py":665
+    /* "lxml/html/clean.py":667
  *             assert not leading_text
  *             leading_text = prev_text
  *         anchor = factory('a')             # <<<<<<<<<<<<<<
@@ -11161,20 +11183,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, 665, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 667, __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":666
+    /* "lxml/html/clean.py":668
  *             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, 666, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __pyx_t_7 = NULL;
     __pyx_t_13 = 0;
@@ -11191,7 +11213,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, 666, __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, 668, __pyx_L1_error)
       __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
       __Pyx_GOTREF(__pyx_t_6);
     } else
@@ -11199,13 +11221,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, 666, __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, 668, __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, 666, __pyx_L1_error)
+      __pyx_t_5 = PyTuple_New(2+__pyx_t_13); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 668, __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;
@@ -11216,21 +11238,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, 666, __pyx_L1_error)
+      __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_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":667
+    /* "lxml/html/clean.py":669
  *         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, 667, __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, 669, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11244,24 +11266,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, 667, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 669, __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":668
+    /* "lxml/html/clean.py":670
  *         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, 668, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_body); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 670, __pyx_L1_error)
     __pyx_t_8 = ((!__pyx_t_12) != 0);
     if (__pyx_t_8) {
 
-      /* "lxml/html/clean.py":669
+      /* "lxml/html/clean.py":671
  *         body = best_match.group('body')
  *         if not body:
  *             body = link             # <<<<<<<<<<<<<<
@@ -11271,7 +11293,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":668
+      /* "lxml/html/clean.py":670
  *         anchor.set('href', link)
  *         body = best_match.group('body')
  *         if not body:             # <<<<<<<<<<<<<<
@@ -11280,14 +11302,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":670
+    /* "lxml/html/clean.py":672
  *         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, 670, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11301,17 +11323,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, 670, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __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, 670, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __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, 670, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -11325,28 +11347,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, 670, __pyx_L1_error)
+    if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 672, __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, 670, __pyx_L1_error)
+    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 672, __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":671
+      /* "lxml/html/clean.py":673
  *             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, 671, __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, 673, __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":670
+      /* "lxml/html/clean.py":672
  *         if not body:
  *             body = link
  *         if body.endswith('.') or body.endswith(','):             # <<<<<<<<<<<<<<
@@ -11355,39 +11377,39 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":672
+    /* "lxml/html/clean.py":674
  *         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, 672, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_anchor, __pyx_n_s_text, __pyx_v_body) < 0) __PYX_ERR(0, 674, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":673
+    /* "lxml/html/clean.py":675
  *             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, 673, __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, 675, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":674
+    /* "lxml/html/clean.py":676
  *         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, 674, __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, 676, __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":675
+  /* "lxml/html/clean.py":677
  *         links.append(anchor)
  *         text = text[end:]
  *     return leading_text, links             # <<<<<<<<<<<<<<
@@ -11395,7 +11417,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, 675, __pyx_L1_error)
+  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 677, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_6);
   __Pyx_INCREF(__pyx_v_leading_text);
   __Pyx_GIVEREF(__pyx_v_leading_text);
@@ -11407,7 +11429,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":619
+  /* "lxml/html/clean.py":621
  *             el[:0] = pre_children
  * 
  * def _link_text(text, link_regexes, avoid_hosts, factory):             # <<<<<<<<<<<<<<
@@ -11445,7 +11467,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_4_link_text(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":677
+/* "lxml/html/clean.py":679
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -11499,7 +11521,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, 677, __pyx_L3_error)
+        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)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -11510,7 +11532,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, 677, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("autolink_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 679, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
@@ -11544,7 +11566,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":678
+  /* "lxml/html/clean.py":680
  * 
  * def autolink_html(html, *args, **kw):
  *     result_type = type(html)             # <<<<<<<<<<<<<<
@@ -11554,28 +11576,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":679
+  /* "lxml/html/clean.py":681
  * 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, 679, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_basestring); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __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, 679, __pyx_L1_error)
+  __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __pyx_t_3 = (__pyx_t_2 != 0);
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":680
+    /* "lxml/html/clean.py":682
  *     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, 680, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 682, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_4);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
@@ -11589,13 +11611,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, 680, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 682, __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":679
+    /* "lxml/html/clean.py":681
  * def autolink_html(html, *args, **kw):
  *     result_type = type(html)
  *     if isinstance(html, basestring):             # <<<<<<<<<<<<<<
@@ -11605,7 +11627,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
     goto __pyx_L3;
   }
 
-  /* "lxml/html/clean.py":682
+  /* "lxml/html/clean.py":684
  *         doc = fromstring(html)
  *     else:
  *         doc = copy.deepcopy(html)             # <<<<<<<<<<<<<<
@@ -11613,9 +11635,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, 682, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_copy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 684, __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, 682, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
     __pyx_t_4 = NULL;
@@ -11630,7 +11652,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, 682, __pyx_L1_error)
+    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
     __pyx_v_doc = __pyx_t_1;
@@ -11638,30 +11660,30 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   }
   __pyx_L3:;
 
-  /* "lxml/html/clean.py":683
+  /* "lxml/html/clean.py":685
  *     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, 683, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_autolink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 685, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 683, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 685, __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, 683, __pyx_L1_error)
+  __pyx_t_4 = PyNumber_Add(__pyx_t_5, __pyx_v_args); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 685, __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, 683, __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, 685, __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":684
+  /* "lxml/html/clean.py":686
  *         doc = copy.deepcopy(html)
  *     autolink(doc, *args, **kw)
  *     return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -11669,7 +11691,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, 684, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 686, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_4);
   __pyx_t_1 = NULL;
   __pyx_t_6 = 0;
@@ -11686,7 +11708,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, 684, __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, 686, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_5);
   } else
@@ -11694,13 +11716,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, 684, __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, 686, __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, 684, __pyx_L1_error)
+    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 686, __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;
@@ -11711,7 +11733,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, 684, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
   }
@@ -11720,7 +11742,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   __pyx_t_5 = 0;
   goto __pyx_L0;
 
-  /* "lxml/html/clean.py":677
+  /* "lxml/html/clean.py":679
  *     return leading_text, links
  * 
  * def autolink_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -11744,7 +11766,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_6autolink_html(CYTHON_UNUSED PyObje
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":695
+/* "lxml/html/clean.py":697
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
@@ -11762,7 +11784,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, 695, __pyx_L1_error)
+  __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
   __Pyx_INCREF(((PyObject *)__pyx_int_40));
   __Pyx_GIVEREF(((PyObject *)__pyx_int_40));
@@ -11776,7 +11798,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, 695, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 697, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __Pyx_GIVEREF(__pyx_t_1);
   PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
@@ -11872,7 +11894,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, 695, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "word_break") < 0)) __PYX_ERR(0, 697, __pyx_L3_error)
       }
     } else {
       switch (PyTuple_GET_SIZE(__pyx_args)) {
@@ -11897,7 +11919,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, 695, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("word_break", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 697, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean.word_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -11933,24 +11955,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":714
+  /* "lxml/html/clean.py":716
  *     # 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, 714, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_1);
-  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_avoid_word_break_elements); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 714, __pyx_L1_error)
+  __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_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, 714, __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, 716, __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":715
+    /* "lxml/html/clean.py":717
  *     #   http://www.cs.tut.fi/~jkorpela/html/nobr.html
  *     if el.tag in _avoid_word_break_elements:
  *         return             # <<<<<<<<<<<<<<
@@ -11961,7 +11983,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":714
+    /* "lxml/html/clean.py":716
  *     # Character suggestion of &#8203 comes from:
  *     #   http://www.cs.tut.fi/~jkorpela/html/nobr.html
  *     if el.tag in _avoid_word_break_elements:             # <<<<<<<<<<<<<<
@@ -11970,14 +11992,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":716
+  /* "lxml/html/clean.py":718
  *     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, 716, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_1);
   __pyx_t_5 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -11991,23 +12013,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, 716, __pyx_L1_error)
+  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __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":717
+  /* "lxml/html/clean.py":719
  *         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, 717, __pyx_L1_error)
+  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_class_name); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 719, __pyx_L1_error)
   if (__pyx_t_4) {
 
-    /* "lxml/html/clean.py":718
+    /* "lxml/html/clean.py":720
  *     class_name = el.get('class')
  *     if class_name:
  *         dont_break = False             # <<<<<<<<<<<<<<
@@ -12016,14 +12038,14 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     __pyx_v_dont_break = 0;
 
-    /* "lxml/html/clean.py":719
+    /* "lxml/html/clean.py":721
  *     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, 719, __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, 721, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
     __pyx_t_5 = NULL;
     if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
@@ -12037,13 +12059,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, 719, __pyx_L1_error)
+    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 721, __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":720
+    /* "lxml/html/clean.py":722
  *         dont_break = False
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:             # <<<<<<<<<<<<<<
@@ -12054,26 +12076,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, 720, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_2);
-      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 720, __pyx_L1_error)
+      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 722, __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, 720, __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, 722, __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, 720, __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, 722, __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, 720, __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, 722, __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, 720, __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, 722, __pyx_L1_error)
           __Pyx_GOTREF(__pyx_t_1);
           #endif
         }
@@ -12083,7 +12105,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, 720, __pyx_L1_error)
+            else __PYX_ERR(0, 722, __pyx_L1_error)
           }
           break;
         }
@@ -12092,18 +12114,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":721
+      /* "lxml/html/clean.py":723
  *         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, 721, __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, 723, __pyx_L1_error)
       __pyx_t_3 = (__pyx_t_4 != 0);
       if (__pyx_t_3) {
 
-        /* "lxml/html/clean.py":722
+        /* "lxml/html/clean.py":724
  *         for avoid in avoid_classes:
  *             if avoid in class_name:
  *                 dont_break = True             # <<<<<<<<<<<<<<
@@ -12112,7 +12134,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
         __pyx_v_dont_break = 1;
 
-        /* "lxml/html/clean.py":723
+        /* "lxml/html/clean.py":725
  *             if avoid in class_name:
  *                 dont_break = True
  *                 break             # <<<<<<<<<<<<<<
@@ -12121,7 +12143,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
         goto __pyx_L6_break;
 
-        /* "lxml/html/clean.py":721
+        /* "lxml/html/clean.py":723
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:
  *             if avoid in class_name:             # <<<<<<<<<<<<<<
@@ -12130,7 +12152,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
       }
 
-      /* "lxml/html/clean.py":720
+      /* "lxml/html/clean.py":722
  *         dont_break = False
  *         class_name = class_name.split()
  *         for avoid in avoid_classes:             # <<<<<<<<<<<<<<
@@ -12141,7 +12163,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":724
+    /* "lxml/html/clean.py":726
  *                 dont_break = True
  *                 break
  *         if dont_break:             # <<<<<<<<<<<<<<
@@ -12151,7 +12173,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":725
+      /* "lxml/html/clean.py":727
  *                 break
  *         if dont_break:
  *             return             # <<<<<<<<<<<<<<
@@ -12162,7 +12184,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":724
+      /* "lxml/html/clean.py":726
  *                 dont_break = True
  *                 break
  *         if dont_break:             # <<<<<<<<<<<<<<
@@ -12171,7 +12193,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":717
+    /* "lxml/html/clean.py":719
  *         return
  *     class_name = el.get('class')
  *     if class_name:             # <<<<<<<<<<<<<<
@@ -12180,29 +12202,29 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":726
+  /* "lxml/html/clean.py":728
  *         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, 726, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_2);
-  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 726, __pyx_L1_error)
+  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 728, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
   if (__pyx_t_3) {
 
-    /* "lxml/html/clean.py":727
+    /* "lxml/html/clean.py":729
  *             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, 727, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_break_text); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __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, 727, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __pyx_t_8 = NULL;
     __pyx_t_9 = 0;
@@ -12219,7 +12241,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, 727, __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, 729, __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;
@@ -12228,14 +12250,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, 727, __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, 729, __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, 727, __pyx_L1_error)
+      __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 729, __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;
@@ -12249,15 +12271,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, 727, __pyx_L1_error)
+      __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_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, 727, __pyx_L1_error)
+    if (__Pyx_PyObject_SetAttrStr(__pyx_v_el, __pyx_n_s_text, __pyx_t_2) < 0) __PYX_ERR(0, 729, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
 
-    /* "lxml/html/clean.py":726
+    /* "lxml/html/clean.py":728
  *         if dont_break:
  *             return
  *     if el.text:             # <<<<<<<<<<<<<<
@@ -12266,7 +12288,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
   }
 
-  /* "lxml/html/clean.py":728
+  /* "lxml/html/clean.py":730
  *     if el.text:
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:             # <<<<<<<<<<<<<<
@@ -12277,26 +12299,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, 728, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
-    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 728, __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, 728, __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, 728, __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, 728, __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, 728, __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
       }
@@ -12306,7 +12328,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, 728, __pyx_L1_error)
+          else __PYX_ERR(0, 730, __pyx_L1_error)
         }
         break;
       }
@@ -12315,88 +12337,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":729
+    /* "lxml/html/clean.py":731
  *         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, 729, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 731, __pyx_L1_error)
     __Pyx_GOTREF(__pyx_t_1);
-    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 729, __pyx_L1_error)
+    __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 731, __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, 729, __pyx_L1_error)
+    __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 731, __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, 729, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_max_width, __pyx_v_max_width) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":730
+    /* "lxml/html/clean.py":732
  *     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, 729, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_elements, __pyx_v_avoid_elements) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":731
+    /* "lxml/html/clean.py":733
  *         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, 729, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_avoid_classes, __pyx_v_avoid_classes) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":732
+    /* "lxml/html/clean.py":734
  *                    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, 729, __pyx_L1_error)
+    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_break_character, __pyx_v_break_character) < 0) __PYX_ERR(0, 731, __pyx_L1_error)
 
-    /* "lxml/html/clean.py":729
+    /* "lxml/html/clean.py":731
  *         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, 729, __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, 731, __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":733
+    /* "lxml/html/clean.py":735
  *                    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, 733, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_8);
-    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 733, __pyx_L1_error)
+    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 735, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
     if (__pyx_t_3) {
 
-      /* "lxml/html/clean.py":734
+      /* "lxml/html/clean.py":736
  *                    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, 734, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_break_text); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 736, __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, 734, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_10);
       __pyx_t_1 = NULL;
       __pyx_t_9 = 0;
@@ -12413,7 +12435,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, 734, __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, 736, __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;
@@ -12422,14 +12444,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, 734, __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, 736, __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, 734, __pyx_L1_error)
+        __pyx_t_11 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 736, __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;
@@ -12443,15 +12465,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, 734, __pyx_L1_error)
+        __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_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, 734, __pyx_L1_error)
+      if (__Pyx_PyObject_SetAttrStr(__pyx_v_child, __pyx_n_s_tail, __pyx_t_8) < 0) __PYX_ERR(0, 736, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-      /* "lxml/html/clean.py":733
+      /* "lxml/html/clean.py":735
  *                    avoid_classes=avoid_classes,
  *                    break_character=break_character)
  *         if child.tail:             # <<<<<<<<<<<<<<
@@ -12460,7 +12482,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
  */
     }
 
-    /* "lxml/html/clean.py":728
+    /* "lxml/html/clean.py":730
  *     if el.text:
  *         el.text = _break_text(el.text, max_width, break_character)
  *     for child in el:             # <<<<<<<<<<<<<<
@@ -12470,7 +12492,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":695
+  /* "lxml/html/clean.py":697
  * _avoid_word_break_classes = ['nobreak']
  * 
  * def word_break(el, max_width=40,             # <<<<<<<<<<<<<<
@@ -12499,7 +12521,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_8word_break(CYTHON_UNUSED PyObject
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":736
+/* "lxml/html/clean.py":738
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -12553,7 +12575,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, 736, __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, 738, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
       goto __pyx_L5_argtuple_error;
@@ -12564,7 +12586,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, 736, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("word_break_html", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 738, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
   __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
@@ -12596,7 +12618,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":737
+  /* "lxml/html/clean.py":739
  * 
  * def word_break_html(html, *args, **kw):
  *     result_type = type(html)             # <<<<<<<<<<<<<<
@@ -12606,14 +12628,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":738
+  /* "lxml/html/clean.py":740
  * 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, 738, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_fromstring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 740, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
@@ -12627,36 +12649,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, 738, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __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":739
+  /* "lxml/html/clean.py":741
  *     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, 739, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_word_break); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_1);
-  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 739, __pyx_L1_error)
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 741, __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, 739, __pyx_L1_error)
+  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __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, 739, __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, 741, __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":740
+  /* "lxml/html/clean.py":742
  *     doc = fromstring(html)
  *     word_break(doc, *args, **kw)
  *     return _transform_result(result_type, doc)             # <<<<<<<<<<<<<<
@@ -12664,7 +12686,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, 740, __pyx_L1_error)
+  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_transform_result); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 742, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_3);
   __pyx_t_1 = NULL;
   __pyx_t_4 = 0;
@@ -12681,7 +12703,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, 740, __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, 742, __pyx_L1_error)
     __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
     __Pyx_GOTREF(__pyx_t_2);
   } else
@@ -12689,13 +12711,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, 740, __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, 742, __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, 740, __pyx_L1_error)
+    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 742, __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;
@@ -12706,7 +12728,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, 740, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
   }
@@ -12715,7 +12737,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":736
+  /* "lxml/html/clean.py":738
  *             child.tail = _break_text(child.tail, max_width, break_character)
  * 
  * def word_break_html(html, *args, **kw):             # <<<<<<<<<<<<<<
@@ -12739,7 +12761,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_10word_break_html(CYTHON_UNUSED PyO
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":742
+/* "lxml/html/clean.py":744
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
@@ -12785,17 +12807,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, 742, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 1); __PYX_ERR(0, 744, __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, 742, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, 2); __PYX_ERR(0, 744, __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, 742, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_break_text") < 0)) __PYX_ERR(0, 744, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -12810,7 +12832,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, 742, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_break_text", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 744, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._break_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -12845,14 +12867,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":743
+  /* "lxml/html/clean.py":745
  * 
  * 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, 743, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_2);
   __pyx_t_3 = NULL;
   if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
@@ -12866,13 +12888,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, 743, __pyx_L1_error)
+  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 745, __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":744
+  /* "lxml/html/clean.py":746
  * def _break_text(text, max_width, break_character):
  *     words = text.split()
  *     for word in words:             # <<<<<<<<<<<<<<
@@ -12883,26 +12905,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, 744, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_1);
-    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 744, __pyx_L1_error)
+    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 746, __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, 744, __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, 746, __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, 744, __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, 746, __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, 744, __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, 746, __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, 744, __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, 746, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_2);
         #endif
       }
@@ -12912,7 +12934,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, 744, __pyx_L1_error)
+          else __PYX_ERR(0, 746, __pyx_L1_error)
         }
         break;
       }
@@ -12921,30 +12943,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":745
+    /* "lxml/html/clean.py":747
  *     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, 745, __pyx_L1_error)
-    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 745, __pyx_L1_error)
+    __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_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, 745, __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, 747, __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, 745, __pyx_L1_error)
+    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (__pyx_t_7) {
 
-      /* "lxml/html/clean.py":746
+      /* "lxml/html/clean.py":748
  *     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, 746, __pyx_L1_error)
+      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_insert_break); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 748, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_2);
       __pyx_t_8 = NULL;
       __pyx_t_9 = 0;
@@ -12961,7 +12983,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, 746, __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, 748, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -12969,13 +12991,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, 746, __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, 748, __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, 746, __pyx_L1_error)
+        __pyx_t_10 = PyTuple_New(3+__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 748, __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;
@@ -12989,7 +13011,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, 746, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
       }
@@ -12997,14 +13019,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":747
+      /* "lxml/html/clean.py":749
  *         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, 747, __pyx_L1_error)
+      __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_GOTREF(__pyx_t_2);
       __pyx_t_10 = NULL;
       __pyx_t_9 = 0;
@@ -13021,7 +13043,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, 747, __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, 749, __pyx_L1_error)
         __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
         __Pyx_GOTREF(__pyx_t_3);
       } else
@@ -13029,13 +13051,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, 747, __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, 749, __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, 747, __pyx_L1_error)
+        __pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 749, __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;
@@ -13046,7 +13068,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, 747, __pyx_L1_error)
+        __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_GOTREF(__pyx_t_3);
         __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
       }
@@ -13054,7 +13076,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":745
+      /* "lxml/html/clean.py":747
  *     words = text.split()
  *     for word in words:
  *         if len(word) > max_width:             # <<<<<<<<<<<<<<
@@ -13063,7 +13085,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
  */
     }
 
-    /* "lxml/html/clean.py":744
+    /* "lxml/html/clean.py":746
  * def _break_text(text, max_width, break_character):
  *     words = text.split()
  *     for word in words:             # <<<<<<<<<<<<<<
@@ -13073,7 +13095,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":748
+  /* "lxml/html/clean.py":750
  *             replacement = _insert_break(word, max_width, break_character)
  *             text = text.replace(word, replacement)
  *     return text             # <<<<<<<<<<<<<<
@@ -13085,7 +13107,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":742
+  /* "lxml/html/clean.py":744
  *     return _transform_result(result_type, doc)
  * 
  * def _break_text(text, max_width, break_character):             # <<<<<<<<<<<<<<
@@ -13112,7 +13134,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_12_break_text(CYTHON_UNUSED PyObjec
   return __pyx_r;
 }
 
-/* "lxml/html/clean.py":752
+/* "lxml/html/clean.py":754
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
@@ -13158,17 +13180,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, 752, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 1); __PYX_ERR(0, 754, __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, 752, __pyx_L3_error)
+          __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, 2); __PYX_ERR(0, 754, __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, 752, __pyx_L3_error)
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_insert_break") < 0)) __PYX_ERR(0, 754, __pyx_L3_error)
       }
     } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
       goto __pyx_L5_argtuple_error;
@@ -13183,7 +13205,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, 752, __pyx_L3_error)
+  __Pyx_RaiseArgtupleInvalid("_insert_break", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 754, __pyx_L3_error)
   __pyx_L3_error:;
   __Pyx_AddTraceback("lxml.html.clean._insert_break", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
@@ -13215,7 +13237,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":753
+  /* "lxml/html/clean.py":755
  * 
  * def _insert_break(word, width, break_character):
  *     orig_word = word             # <<<<<<<<<<<<<<
@@ -13225,7 +13247,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":754
+  /* "lxml/html/clean.py":756
  * def _insert_break(word, width, break_character):
  *     orig_word = word
  *     result = ''             # <<<<<<<<<<<<<<
@@ -13235,7 +13257,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":755
+  /* "lxml/html/clean.py":757
  *     orig_word = word
  *     result = ''
  *     while len(word) > width:             # <<<<<<<<<<<<<<
@@ -13243,37 +13265,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, 755, __pyx_L1_error)
-    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 755, __pyx_L1_error)
+    __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_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, 755, __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, 757, __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, 755, __pyx_L1_error)
+    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
     __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
     if (!__pyx_t_4) break;
 
-    /* "lxml/html/clean.py":756
+    /* "lxml/html/clean.py":758
  *     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, 756, __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, 758, __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":757
+    /* "lxml/html/clean.py":759
  *     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, 757, __pyx_L1_error)
+    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_break_prefer_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 759, __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, 757, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_5);
     __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
     __pyx_t_2 = NULL;
@@ -13288,16 +13310,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, 757, __pyx_L1_error)
+    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 759, __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, 757, __pyx_L1_error)
+    __pyx_t_5 = PySequence_List(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __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":758
+    /* "lxml/html/clean.py":760
  *         start = word[:width]
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:             # <<<<<<<<<<<<<<
@@ -13307,26 +13329,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":759
+      /* "lxml/html/clean.py":761
  *         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, 759, __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, 761, __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":761
+      /* "lxml/html/clean.py":763
  *             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, 761, __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, 763, __pyx_L1_error)
       __Pyx_GOTREF(__pyx_t_3);
       __pyx_t_2 = NULL;
       if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -13340,26 +13362,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, 761, __pyx_L1_error)
+      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 763, __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, 761, __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, 763, __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, 761, __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, 763, __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, 761, __pyx_L1_error)
+      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 763, __pyx_L1_error)
       __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
       if (__pyx_t_4) {
 
-        /* "lxml/html/clean.py":764
+        /* "lxml/html/clean.py":766
  *                 # 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, 764, __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, 766, __pyx_L1_error)
         __Pyx_GOTREF(__pyx_t_3);
         __pyx_t_5 = NULL;
         if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
@@ -13373,16 +13395,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, 764, __pyx_L1_error)
+        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 766, __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, 764, __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, 766, __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":761
+        /* "lxml/html/clean.py":763
  *             last_break = breaks[-1]
  *             # Only walk back up to 10 characters to find a nice break:
  *             if last_break.end() > width-10:             # <<<<<<<<<<<<<<
@@ -13391,7 +13413,7 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  */
       }
 
-      /* "lxml/html/clean.py":758
+      /* "lxml/html/clean.py":760
  *         start = word[:width]
  *         breaks = list(_break_prefer_re.finditer(start))
  *         if breaks:             # <<<<<<<<<<<<<<
@@ -13400,48 +13422,48 @@ static PyObject *__pyx_pf_4lxml_4html_5clean_14_insert_break(CYTHON_UNUSED PyObj
  */
     }
 
-    /* "lxml/html/clean.py":765
+    /* "lxml/html/clean.py":767
  *                 # 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, 765, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_3);
-    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 765, __pyx_L1_error)
+    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 767, __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":766
+    /* "lxml/html/clean.py":768
  *                 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, 766, __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, 766, __pyx_L1_error)
+    __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_GOTREF(__pyx_t_2);
     __Pyx_DECREF_SET(__pyx_v_word, __pyx_t_2);
     __pyx_t_2 = 0;
   }
 
-  /* "lxml/html/clean.py":767
+  /* "lxml/html/clean.py":769
  *         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, 767, __pyx_L1_error)
+  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_v_word); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 769, __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":768
+  /* "lxml/html/clean.py":770
  *         word = word[len(start):]
  *     result += word
  *     return result             # <<<<<<<<<<<<<<
@@ -13452,7 +13474,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":752
+  /* "lxml/html/clean.py":754
  * _break_prefer_re = re.compile(r'[^a-z]', re.I)
  * 
  * def _insert_break(word, width, break_character):             # <<<<<<<<<<<<<<
@@ -13754,7 +13776,6 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_finditer, __pyx_k_finditer, sizeof(__pyx_k_finditer), 0, 0, 1, 1},
   {&__pyx_n_s_form, __pyx_k_form, sizeof(__pyx_k_form), 0, 0, 1, 1},
   {&__pyx_n_s_forms, __pyx_k_forms, sizeof(__pyx_k_forms), 0, 0, 1, 1},
-  {&__pyx_n_s_found_parent, __pyx_k_found_parent, sizeof(__pyx_k_found_parent), 0, 0, 1, 1},
   {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1},
   {&__pyx_n_s_frame_tags, __pyx_k_frame_tags, sizeof(__pyx_k_frame_tags), 0, 0, 1, 1},
   {&__pyx_n_s_frames, __pyx_k_frames, sizeof(__pyx_k_frames), 0, 0, 1, 1},
@@ -13831,6 +13852,7 @@ static __Pyx_StringTabEntry __pyx_string_tab[] = {
   {&__pyx_n_s_nofollow, __pyx_k_nofollow, sizeof(__pyx_k_nofollow), 0, 0, 1, 1},
   {&__pyx_kp_s_nofollow_2, __pyx_k_nofollow_2, sizeof(__pyx_k_nofollow_2), 0, 0, 1, 0},
   {&__pyx_n_s_nolink, __pyx_k_nolink, sizeof(__pyx_k_nolink), 0, 0, 1, 1},
+  {&__pyx_kp_s_noscript, __pyx_k_noscript, sizeof(__pyx_k_noscript), 0, 0, 1, 0},
   {&__pyx_n_s_not_an_attribute, __pyx_k_not_an_attribute, sizeof(__pyx_k_not_an_attribute), 0, 0, 1, 1},
   {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
   {&__pyx_n_s_old, __pyx_k_old, sizeof(__pyx_k_old), 0, 0, 1, 1},
@@ -13983,91 +14005,91 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
   __Pyx_GOTREF(__pyx_tuple__5);
   __Pyx_GIVEREF(__pyx_tuple__5);
 
-  /* "lxml/html/clean.py":361
+  /* "lxml/html/clean.py":360
  *                 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, 361, __pyx_L1_error)
+  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_applet); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 360, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__6);
   __Pyx_GIVEREF(__pyx_tuple__6);
 
-  /* "lxml/html/clean.py":363
+  /* "lxml/html/clean.py":362
  *             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, 363, __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, 362, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__7);
   __Pyx_GIVEREF(__pyx_tuple__7);
 
-  /* "lxml/html/clean.py":371
+  /* "lxml/html/clean.py":370
  *         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, 371, __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, 370, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__8);
   __Pyx_GIVEREF(__pyx_tuple__8);
 
-  /* "lxml/html/clean.py":373
+  /* "lxml/html/clean.py":372
  *             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, 373, __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, 372, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__9);
   __Pyx_GIVEREF(__pyx_tuple__9);
 
-  /* "lxml/html/clean.py":485
+  /* "lxml/html/clean.py":484
  *             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, 485, __pyx_L1_error)
+  __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_GOTREF(__pyx_tuple__11);
   __Pyx_GIVEREF(__pyx_tuple__11);
 
-  /* "lxml/html/clean.py":533
+  /* "lxml/html/clean.py":532
  *         """
  *         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, 533, __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, 532, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__13);
   __Pyx_GIVEREF(__pyx_tuple__13);
 
-  /* "lxml/html/clean.py":617
+  /* "lxml/html/clean.py":619
  *         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, 617, __pyx_L1_error)
+  __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_GOTREF(__pyx_slice__14);
   __Pyx_GIVEREF(__pyx_slice__14);
 
-  /* "lxml/html/clean.py":657
+  /* "lxml/html/clean.py":659
  *             # 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, 657, __pyx_L1_error)
+  __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_GOTREF(__pyx_slice__17);
   __Pyx_GIVEREF(__pyx_slice__17);
 
@@ -14146,215 +14168,215 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  *         """
  *         Cleans the document.
  */
-  __pyx_tuple__26 = PyTuple_Pack(18, __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_found_parent, __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_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, 18, 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_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)
 
-  /* "lxml/html/clean.py":443
+  /* "lxml/html/clean.py":442
  *                     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, 443, __pyx_L1_error)
+  __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, 443, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 443, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":449
+  /* "lxml/html/clean.py":448
  *         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, 449, __pyx_L1_error)
+  __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, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 449, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":473
+  /* "lxml/html/clean.py":472
  *             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, 473, __pyx_L1_error)
+  __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, 473, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 473, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":492
+  /* "lxml/html/clean.py":491
  *         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, 492, __pyx_L1_error)
+  __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, 492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 492, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":503
+  /* "lxml/html/clean.py":502
  *             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, 503, __pyx_L1_error)
+  __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, 503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 503, __pyx_L1_error)
-  __pyx_tuple__38 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 503, __pyx_L1_error)
+  __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);
 
-  /* "lxml/html/clean.py":511
+  /* "lxml/html/clean.py":510
  *             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, 511, __pyx_L1_error)
+  __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, 511, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 511, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":521
+  /* "lxml/html/clean.py":520
  *     _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, 521, __pyx_L1_error)
+  __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, 521, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 521, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":542
+  /* "lxml/html/clean.py":544
  *         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, 542, __pyx_L1_error)
+  __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, 542, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 542, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":569
+  /* "lxml/html/clean.py":571
  *     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, 569, __pyx_L1_error)
+  __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);
 
-  /* "lxml/html/clean.py":574
+  /* "lxml/html/clean.py":576
  * _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, 574, __pyx_L1_error)
+  __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, 574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 574, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":619
+  /* "lxml/html/clean.py":621
  *             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, 619, __pyx_L1_error)
+  __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, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 619, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":677
+  /* "lxml/html/clean.py":679
  *     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, 677, __pyx_L1_error)
+  __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, 677, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 677, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":695
+  /* "lxml/html/clean.py":697
  * _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, 695, __pyx_L1_error)
+  __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, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__54)) __PYX_ERR(0, 695, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":698
+  /* "lxml/html/clean.py":700
  *                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, 698, __pyx_L1_error)
+  __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);
 
-  /* "lxml/html/clean.py":736
+  /* "lxml/html/clean.py":738
  *             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, 736, __pyx_L1_error)
+  __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, 736, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 736, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":742
+  /* "lxml/html/clean.py":744
  *     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, 742, __pyx_L1_error)
+  __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, 742, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 742, __pyx_L1_error)
+  __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)
 
-  /* "lxml/html/clean.py":752
+  /* "lxml/html/clean.py":754
  * _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, 752, __pyx_L1_error)
+  __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, 752, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 752, __pyx_L1_error)
+  __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_RefNannyFinishContext();
   return 0;
   __pyx_L1_error:;
@@ -14416,7 +14438,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, 492, __pyx_L1_error)
+  if (PyType_Ready(&__pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments) < 0) __PYX_ERR(0, 491, __pyx_L1_error)
   #if PY_VERSION_HEX < 0x030800B1
   __pyx_type_4lxml_4html_5clean___pyx_scope_struct__kill_conditional_comments.tp_print = 0;
   #endif
@@ -15923,94 +15945,94 @@ if (!__Pyx_RefNanny) {
   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;
 
-  /* "lxml/html/clean.py":443
+  /* "lxml/html/clean.py":442
  *                     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, 443, __pyx_L1_error)
+  __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, 443, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":449
+  /* "lxml/html/clean.py":448
  *         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, 449, __pyx_L1_error)
+  __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, 449, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":473
+  /* "lxml/html/clean.py":472
  *             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, 473, __pyx_L1_error)
+  __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, 473, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":492
+  /* "lxml/html/clean.py":491
  *         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, 492, __pyx_L1_error)
+  __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, 492, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":503
+  /* "lxml/html/clean.py":502
  *             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, 503, __pyx_L1_error)
+  __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, 503, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":511
+  /* "lxml/html/clean.py":510
  *             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, 511, __pyx_L1_error)
+  __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, 511, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":519
+  /* "lxml/html/clean.py":518
  *         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, 519, __pyx_L1_error)
+  __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, 519, __pyx_L1_error)
+  __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_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, 519, __pyx_L1_error)
+  __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, 519, __pyx_L1_error)
+  __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;
@@ -16028,7 +16050,7 @@ 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, 519, __pyx_L1_error)
+    __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;
@@ -16037,14 +16059,14 @@ if (!__Pyx_RefNanny) {
   #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, 519, __pyx_L1_error)
+    __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;
   } else
   #endif
   {
-    __pyx_t_11 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 519, __pyx_L1_error)
+    __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;
@@ -16055,39 +16077,39 @@ if (!__Pyx_RefNanny) {
     __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, 519, __pyx_L1_error)
+    __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_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, 519, __pyx_L1_error)
+  __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_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, 519, __pyx_L1_error)
+  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_8); __pyx_t_8 = 0;
 
-  /* "lxml/html/clean.py":521
+  /* "lxml/html/clean.py":520
  *     _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, 521, __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__43)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 520, __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, 521, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_has_sneaky_javascript, __pyx_t_8) < 0) __PYX_ERR(0, 520, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
-  /* "lxml/html/clean.py":542
+  /* "lxml/html/clean.py":544
  *         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, 542, __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__45)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 544, __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, 542, __pyx_L1_error)
+  if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_clean_html, __pyx_t_8) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
   /* "lxml/html/clean.py":99
@@ -16104,54 +16126,54 @@ if (!__Pyx_RefNanny) {
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":551
+  /* "lxml/html/clean.py":553
  *         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, 551, __pyx_L1_error)
+  __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, 551, __pyx_L1_error)
+  __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, 551, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":552
+  /* "lxml/html/clean.py":554
  * 
  * clean = Cleaner()
  * clean_html = clean.clean_html             # <<<<<<<<<<<<<<
  * 
  * ############################################################
  */
-  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_clean); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 552, __pyx_L1_error)
+  __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, 552, __pyx_L1_error)
+  __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, 552, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":559
+  /* "lxml/html/clean.py":561
  * 
  * _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, 559, __pyx_L1_error)
+  __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, 559, __pyx_L1_error)
+  __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, 559, __pyx_L1_error)
+  __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, 559, __pyx_L1_error)
+  __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_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, 559, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __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);
@@ -16159,29 +16181,29 @@ if (!__Pyx_RefNanny) {
   __Pyx_GIVEREF(__pyx_t_8);
   PyTuple_SET_ITEM(__pyx_t_5, 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, 559, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":561
+  /* "lxml/html/clean.py":563
  *     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_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, 561, __pyx_L1_error)
+  __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, 561, __pyx_L1_error)
+  __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, 561, __pyx_L1_error)
+  __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_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, 561, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 563, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __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);
@@ -16189,19 +16211,19 @@ if (!__Pyx_RefNanny) {
   __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, 561, __pyx_L1_error)
+  __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;
 
-  /* "lxml/html/clean.py":558
+  /* "lxml/html/clean.py":560
  * ############################################################
  * 
  * _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, 558, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_GIVEREF(__pyx_t_8);
   PyList_SET_ITEM(__pyx_t_5, 0, __pyx_t_8);
@@ -16209,17 +16231,17 @@ if (!__Pyx_RefNanny) {
   PyList_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
   __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, 558, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":564
+  /* "lxml/html/clean.py":566
  *     ]
  * 
  * _avoid_elements = ['textarea', 'pre', 'code', 'head', 'select', 'a']             # <<<<<<<<<<<<<<
  * 
  * _avoid_hosts = [
  */
-  __pyx_t_5 = PyList_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 564, __pyx_L1_error)
+  __pyx_t_5 = PyList_New(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_n_s_textarea);
   __Pyx_GIVEREF(__pyx_n_s_textarea);
@@ -16239,27 +16261,27 @@ if (!__Pyx_RefNanny) {
   __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, 564, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":567
+  /* "lxml/html/clean.py":569
  * 
  * _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, 567, __pyx_L1_error)
+  __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, 567, __pyx_L1_error)
+  __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, 567, __pyx_L1_error)
+  __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_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_I); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 567, __pyx_L1_error)
+  __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_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, 567, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_kp_s_localhost);
   __Pyx_GIVEREF(__pyx_kp_s_localhost);
@@ -16267,29 +16289,29 @@ if (!__Pyx_RefNanny) {
   __Pyx_GIVEREF(__pyx_t_8);
   PyTuple_SET_ITEM(__pyx_t_5, 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, 567, __pyx_L1_error)
+  __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_GOTREF(__pyx_t_8);
   __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":568
+  /* "lxml/html/clean.py":570
  * _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, 568, __pyx_L1_error)
+  __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_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_compile); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
+  __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_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, 568, __pyx_L1_error)
+  __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, 568, __pyx_L1_error)
+  __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, 568, __pyx_L1_error)
+  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_5);
   __Pyx_INCREF(__pyx_kp_s_bexample_com_org_net);
   __Pyx_GIVEREF(__pyx_kp_s_bexample_com_org_net);
@@ -16297,35 +16319,35 @@ if (!__Pyx_RefNanny) {
   __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, 568, __pyx_L1_error)
+  __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;
   __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
-  /* "lxml/html/clean.py":569
+  /* "lxml/html/clean.py":571
  *     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_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_re); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 571, __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_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_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, 569, __pyx_L1_error)
+  __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":566
+  /* "lxml/html/clean.py":568
  * _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, 566, __pyx_L1_error)
+  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 568, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_GIVEREF(__pyx_t_8);
   PyList_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
@@ -16336,132 +16358,132 @@ if (!__Pyx_RefNanny) {
   __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, 566, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":572
+  /* "lxml/html/clean.py":574
  *     ]
  * 
  * _avoid_classes = ['nolink']             # <<<<<<<<<<<<<<
  * 
  * def autolink(el, link_regexes=_link_regexes,
  */
-  __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 572, __pyx_L1_error)
+  __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 574, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __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, 572, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":574
+  /* "lxml/html/clean.py":576
  * _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, 574, __pyx_L1_error)
+  __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, 574, __pyx_L1_error)
-  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_link_regexes_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error)
+  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_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;
 
-  /* "lxml/html/clean.py":575
+  /* "lxml/html/clean.py":577
  * 
  * 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, 575, __pyx_L1_error)
+  __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;
 
-  /* "lxml/html/clean.py":576
+  /* "lxml/html/clean.py":578
  * 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, 576, __pyx_L1_error)
+  __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;
 
-  /* "lxml/html/clean.py":577
+  /* "lxml/html/clean.py":579
  *              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, 577, __pyx_L1_error)
+  __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, 574, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":619
+  /* "lxml/html/clean.py":621
  *             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, 619, __pyx_L1_error)
+  __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, 619, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":677
+  /* "lxml/html/clean.py":679
  *     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, 677, __pyx_L1_error)
+  __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, 677, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":686
+  /* "lxml/html/clean.py":688
  *     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, 686, __pyx_L1_error)
+  __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, 686, __pyx_L1_error)
+  __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_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, 686, __pyx_L1_error)
+  __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, 686, __pyx_L1_error)
+  if (__Pyx_PyObject_SetAttrStr(__pyx_t_9, __pyx_n_s_doc_2, __pyx_t_5) < 0) __PYX_ERR(0, 688, __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":692
+  /* "lxml/html/clean.py":694
  * ############################################################
  * 
  * _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, 692, __pyx_L1_error)
+  __pyx_t_9 = PyList_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 694, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_INCREF(__pyx_n_s_pre);
   __Pyx_GIVEREF(__pyx_n_s_pre);
@@ -16472,122 +16494,122 @@ if (!__Pyx_RefNanny) {
   __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, 692, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":693
+  /* "lxml/html/clean.py":695
  * 
  * _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, 693, __pyx_L1_error)
+  __pyx_t_9 = PyList_New(1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 695, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __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, 693, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":695
+  /* "lxml/html/clean.py":697
  * _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, 695, __pyx_L1_error)
+  __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, 695, __pyx_L1_error)
+  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_9, sizeof(__pyx_defaults1), 3)) __PYX_ERR(0, 697, __pyx_L1_error)
 
-  /* "lxml/html/clean.py":696
+  /* "lxml/html/clean.py":698
  * 
  * 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, 696, __pyx_L1_error)
+  __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;
 
-  /* "lxml/html/clean.py":697
+  /* "lxml/html/clean.py":699
  * 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, 697, __pyx_L1_error)
+  __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;
 
-  /* "lxml/html/clean.py":698
+  /* "lxml/html/clean.py":700
  *                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, 698, __pyx_L1_error)
+  __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, 698, __pyx_L1_error)
+  __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_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, 695, __pyx_L1_error)
+  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":736
+  /* "lxml/html/clean.py":738
  *             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, 736, __pyx_L1_error)
+  __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, 736, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":742
+  /* "lxml/html/clean.py":744
  *     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, 742, __pyx_L1_error)
+  __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, 742, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":750
+  /* "lxml/html/clean.py":752
  *     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, 750, __pyx_L1_error)
+  __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, 750, __pyx_L1_error)
+  __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, 750, __pyx_L1_error)
+  __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, 750, __pyx_L1_error)
+  __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_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, 750, __pyx_L1_error)
+  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 752, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_9);
   __Pyx_INCREF(__pyx_kp_s_a_z);
   __Pyx_GIVEREF(__pyx_kp_s_a_z);
@@ -16595,23 +16617,23 @@ if (!__Pyx_RefNanny) {
   __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, 750, __pyx_L1_error)
+  __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;
   __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, 750, __pyx_L1_error)
+  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;
 
-  /* "lxml/html/clean.py":752
+  /* "lxml/html/clean.py":754
  * _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, 752, __pyx_L1_error)
+  __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, 752, __pyx_L1_error)
+  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;
 
   /* "lxml/html/clean.py":1
index d43b9ba..7b51981 100644 (file)
@@ -536,6 +536,9 @@ class Cleaner(object):
             return True
         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
         return False
 
     def clean_html(self, html):
index 4477337..3c8ee25 100644 (file)
@@ -103,6 +103,16 @@ class CleanerTest(unittest.TestCase):
             '<p><span>Cy<!-- xx -->an</span><!-- XXX --></p>',
             cleaner.clean_html(html))
 
+    def test_sneaky_noscript_in_style(self):
+        # This gets parsed as <noscript> -> <style>"...</noscript>..."</style>
+        # thus passing the </noscript> through into the output.
+        html = '<noscript><style><a title="</noscript><img src=x onerror=alert(1)>">'
+        s = lxml.html.fragment_fromstring(html)
+
+        self.assertEqual(
+            b'<noscript><style>/* deleted */</style></noscript>',
+            lxml.html.tostring(clean_html(s)))
+
 
 def test_suite():
     suite = unittest.TestSuite()
index 8621e8c..63bdca7 100644 (file)
@@ -1,3 +1,3 @@
 #ifndef LXML_VERSION_STRING
-#define LXML_VERSION_STRING "4.6.0"
+#define LXML_VERSION_STRING "4.6.1"
 #endif
index 564408b..dac555d 100644 (file)
@@ -1669,7 +1669,7 @@ static const char __pyx_k_ElementTreeContentHandler[] = "ElementTreeContentHandl
 static const char __pyx_k_Unexpected_element_closed[] = "Unexpected element closed: ";
 static const char __pyx_k_ElementTreeProducer_saxify[] = "ElementTreeProducer.saxify";
 static const char __pyx_k_pyx_unpickle_ElementTreeProduc[] = "__pyx_unpickle_ElementTreeProducer";
-static const char __pyx_k_SAX_based_adapter_to_copy_trees[] = "\nSAX-based adapter to copy trees from/to the Python standard library.\n\nUse the `ElementTreeContentHandler` class to build an ElementTree from\nSAX events.\n\nUse the `ElementTreeProducer` class or the `saxify()` function to fire\nthe SAX events of an ElementTree against a SAX ContentHandler.\n\nSee http://codespeak.net/lxml/sax.html\n";
+static const char __pyx_k_SAX_based_adapter_to_copy_trees[] = "\nSAX-based adapter to copy trees from/to the Python standard library.\n\nUse the `ElementTreeContentHandler` class to build an ElementTree from\nSAX events.\n\nUse the `ElementTreeProducer` class or the `saxify()` function to fire\nthe SAX events of an ElementTree against a SAX ContentHandler.\n\nSee https://lxml.de/sax.html\n";
 static const char __pyx_k_Build_an_lxml_ElementTree_from_S[] = "Build an lxml ElementTree from SAX events.\n    ";
 static const char __pyx_k_ElementTreeContentHandler___init[] = "ElementTreeContentHandler.__init__";
 static const char __pyx_k_ElementTreeContentHandler__build[] = "ElementTreeContentHandler._buildTag";