Imported Upstream version 4.5.2
[platform/upstream/python-lxml.git] / doc / html / changes-4.5.2.html
1 <?xml version="1.0" encoding="utf-8" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6 <meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
7 <title>lxml changelog</title>
8 <link rel="stylesheet" href="style.css" type="text/css" />
9 </head>
10 <body>
11 <div class="document" id="lxml-changelog">
12 <h1 class="title">lxml changelog</h1>
13
14 <div class="section" id="id1">
15 <h1>4.5.2 (2020-07-09)</h1>
16 <div class="section" id="bugs-fixed">
17 <h2>Bugs fixed</h2>
18 <ul class="simple">
19 <li><tt class="docutils literal">Cleaner()</tt> now validates that only known configuration options can be set.</li>
20 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1882606">LP#1882606</a>: <tt class="docutils literal">Cleaner.clean_html()</tt> discarded comments and PIs regardless of the
21 corresponding configuration option, if <tt class="docutils literal">remove_unknown_tags</tt> was set.</li>
22 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1880251">LP#1880251</a>: Instead of globally overwriting the document loader in libxml2, lxml now
23 sets it per parser run, which improves the interoperability with other users of libxml2
24 such as libxmlsec.</li>
25 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1881960">LP#1881960</a>: Fix build in CPython 3.10 by using Cython 0.29.21.</li>
26 <li>The setup options &quot;--with-xml2-config&quot; and &quot;--with-xslt-config&quot; were accidentally renamed
27 to &quot;--xml2-config&quot; and &quot;--xslt-config&quot; in 4.5.1 and are now available again.</li>
28 </ul>
29 </div>
30 </div>
31 <div class="section" id="id2">
32 <h1>4.5.1 (2020-05-19)</h1>
33 <div class="section" id="id3">
34 <h2>Bugs fixed</h2>
35 <ul class="simple">
36 <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>
37 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1865141">LP#1865141</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/298">GH#298</a>: <tt class="docutils literal">QName</tt> values were not accepted by the <tt class="docutils literal">el.iter()</tt> method.
38 Patch by xmo-odoo.</li>
39 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1863413">LP#1863413</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/297">GH#297</a>: The build failed to detect libraries on Linux that are only
40 configured via pkg-config.
41 Patch by Hugh McMaster.</li>
42 </ul>
43 </div>
44 </div>
45 <div class="section" id="id4">
46 <h1>4.5.0 (2020-01-29)</h1>
47 <div class="section" id="features-added">
48 <h2>Features added</h2>
49 <ul class="simple">
50 <li>A new function <tt class="docutils literal">indent()</tt> was added to insert tail whitespace for pretty-printing
51 an XML tree.</li>
52 </ul>
53 </div>
54 <div class="section" id="id5">
55 <h2>Bugs fixed</h2>
56 <ul class="simple">
57 <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
58 deletion disappeared silently instead of sticking with the node that was removed.</li>
59 </ul>
60 </div>
61 <div class="section" id="other-changes">
62 <h2>Other changes</h2>
63 <ul class="simple">
64 <li>MacOS builds are 64-bit-only by default.
65 Set CFLAGS and LDFLAGS explicitly to override it.</li>
66 <li>Linux/MacOS Binary wheels now use libxml2 2.9.10 and libxslt 1.1.34.</li>
67 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1840234">LP#1840234</a>: The package version number is now available as <tt class="docutils literal">lxml.__version__</tt>.</li>
68 </ul>
69 </div>
70 </div>
71 <div class="section" id="id6">
72 <h1>4.4.3 (2020-01-28)</h1>
73 <div class="section" id="id7">
74 <h2>Bugs fixed</h2>
75 <ul class="simple">
76 <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>
77 </ul>
78 </div>
79 </div>
80 <div class="section" id="id8">
81 <h1>4.4.2 (2019-11-25)</h1>
82 <div class="section" id="id9">
83 <h2>Bugs fixed</h2>
84 <ul class="simple">
85 <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
86 includes as recursive.
87 Patch by Rainer Hausdorf.</li>
88 </ul>
89 </div>
90 </div>
91 <div class="section" id="id10">
92 <h1>4.4.1 (2019-08-11)</h1>
93 <div class="section" id="id11">
94 <h2>Bugs fixed</h2>
95 <ul class="simple">
96 <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
97 attrib mapping during element creation.</li>
98 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1838521">LP#1838521</a>: The package metadata now lists the supported Python versions.</li>
99 </ul>
100 </div>
101 </div>
102 <div class="section" id="id12">
103 <h1>4.4.0 (2019-07-27)</h1>
104 <div class="section" id="id13">
105 <h2>Features added</h2>
106 <ul class="simple">
107 <li><tt class="docutils literal">Element.clear()</tt> accepts a new keyword argument <tt class="docutils literal">keep_tail=True</tt> to clear
108 everything but the tail text.  This is helpful in some document-style use cases
109 and for clearing the current element in <tt class="docutils literal">iterparse()</tt> and pull parsing.</li>
110 <li>When creating attributes or namespaces from a dict in Python 3.6+, lxml now
111 preserves the original insertion order of that dict, instead of always sorting
112 the items by name.  A similar change was made for ElementTree in CPython 3.8.
113 See <a class="reference external" href="https://bugs.python.org/issue34160">https://bugs.python.org/issue34160</a></li>
114 <li>Integer elements in <tt class="docutils literal">lxml.objectify</tt> implement the <tt class="docutils literal">__index__()</tt> special method.</li>
115 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/269">GH#269</a>: Read-only elements in XSLT were missing the <tt class="docutils literal">nsmap</tt> property.
116 Original patch by Jan Pazdziora.</li>
117 <li>ElementInclude can now restrict the maximum inclusion depth via a <tt class="docutils literal">max_depth</tt>
118 argument to prevent content explosion.  It is limited to 6 by default.</li>
119 <li>The <tt class="docutils literal">target</tt> object of the XMLParser can have <tt class="docutils literal">start_ns()</tt> and <tt class="docutils literal">end_ns()</tt>
120 callback methods to listen to namespace declarations.</li>
121 <li>The <tt class="docutils literal">TreeBuilder</tt> has new arguments <tt class="docutils literal">comment_factory</tt> and <tt class="docutils literal">pi_factory</tt> to
122 pass factories for creating comments and processing instructions, as well as
123 flag arguments <tt class="docutils literal">insert_comments</tt> and <tt class="docutils literal">insert_pis</tt> to discard them from the
124 tree when set to false.</li>
125 <li>A <a class="reference external" href="https://www.w3.org/TR/xml-c14n2/">C14N 2.0</a> implementation was added as
126 <tt class="docutils literal">etree.canonicalize()</tt>, a corresponding <tt class="docutils literal">C14NWriterTarget</tt> class, and
127 a <tt class="docutils literal">c14n2</tt> serialisation method.</li>
128 </ul>
129 </div>
130 <div class="section" id="id14">
131 <h2>Bugs fixed</h2>
132 <ul class="simple">
133 <li>When writing to file paths that contain the URL escape character '%', the file
134 path could wrongly be mangled by URL unescaping and thus write to a different
135 file or directory.  Code that writes to file paths that are provided by untrusted
136 sources, but that must work with previous versions of lxml, should best either
137 reject paths that contain '%' characters, or otherwise make sure that the path
138 does not contain maliciously injected '%XX' URL hex escapes for paths like '../'.</li>
139 <li>Assigning to Element child slices with negative step could insert the slice at
140 the wrong position, starting too far on the left.</li>
141 <li>Assigning to Element child slices with overly large step size could take very
142 long, regardless of the length of the actual slice.</li>
143 <li>Assigning to Element child slices of the wrong size could sometimes fail to
144 raise a ValueError (like a list assignment would) and instead assign outside
145 of the original slice bounds or leave parts of it unreplaced.</li>
146 <li>The <tt class="docutils literal">comment</tt> and <tt class="docutils literal">pi</tt> events in <tt class="docutils literal">iterwalk()</tt> were never triggered, and
147 instead, comments and processing instructions in the tree were reported as
148 <tt class="docutils literal">start</tt> elements.  Also, when walking an ElementTree (as opposed to its root
149 element), comments and PIs outside of the root element are now reported.</li>
150 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1827833">LP#1827833</a>: The RelaxNG compact syntax support was broken with recent versions
151 of <tt class="docutils literal">rnc2rng</tt>.</li>
152 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1758553">LP#1758553</a>: The HTML elements <tt class="docutils literal">source</tt> and <tt class="docutils literal">track</tt> were added to the list
153 of empty tags in <tt class="docutils literal">lxml.html.defs</tt>.</li>
154 <li>Registering a prefix other than &quot;xml&quot; for the XML namespace is now rejected.</li>
155 <li>Failing to write XSLT output to a file could raise a misleading exception.
156 It now raises <tt class="docutils literal">IOError</tt>.</li>
157 </ul>
158 </div>
159 <div class="section" id="id15">
160 <h2>Other changes</h2>
161 <ul class="simple">
162 <li>Support for Python 3.4 was removed.</li>
163 <li>When using <tt class="docutils literal"><span class="pre">Element.find*()</span></tt> with prefix-namespace mappings, the empty string
164 is now accepted to define a default namespace, in addition to the previously
165 supported <tt class="docutils literal">None</tt> prefix.  Empty strings are more convenient since they keep
166 all prefix keys in a namespace dict strings, which simplifies sorting etc.</li>
167 <li>The <tt class="docutils literal">ElementTree.write_c14n()</tt> method has been deprecated in favour of the
168 long preferred <tt class="docutils literal">ElementTree.write(f, <span class="pre">method=&quot;c14n&quot;)</span></tt>.  It will be removed
169 in a future release.</li>
170 </ul>
171 </div>
172 </div>
173 <div class="section" id="id16">
174 <h1>4.3.5 (2019-07-27)</h1>
175 <ul class="simple">
176 <li>Rebuilt with Cython 0.29.13 to support Python 3.8.</li>
177 </ul>
178 </div>
179 <div class="section" id="id17">
180 <h1>4.3.4 (2019-06-10)</h1>
181 <ul class="simple">
182 <li>Rebuilt with Cython 0.29.10 to support Python 3.8.</li>
183 </ul>
184 </div>
185 <div class="section" id="id18">
186 <h1>4.3.3 (2019-03-26)</h1>
187 <div class="section" id="id19">
188 <h2>Bugs fixed</h2>
189 <ul class="simple">
190 <li>Fix leak of output buffer and unclosed files in <tt class="docutils literal">_XSLTResultTree.write_output()</tt>.</li>
191 </ul>
192 </div>
193 </div>
194 <div class="section" id="id20">
195 <h1>4.3.2 (2019-02-29)</h1>
196 <div class="section" id="id21">
197 <h2>Bugs fixed</h2>
198 <ul class="simple">
199 <li>Crash in 4.3.1 when appending a child subtree with certain text nodes.</li>
200 </ul>
201 </div>
202 <div class="section" id="id22">
203 <h2>Other changes</h2>
204 <ul class="simple">
205 <li>Built with Cython 0.29.6.</li>
206 </ul>
207 </div>
208 </div>
209 <div class="section" id="id23">
210 <h1>4.3.1 (2019-02-08)</h1>
211 <div class="section" id="id24">
212 <h2>Bugs fixed</h2>
213 <ul class="simple">
214 <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
215 entity references.</li>
216 </ul>
217 </div>
218 <div class="section" id="id25">
219 <h2>Other changes</h2>
220 <ul class="simple">
221 <li>Built with Cython 0.29.5.</li>
222 </ul>
223 </div>
224 </div>
225 <div class="section" id="id26">
226 <h1>4.3.0 (2019-01-04)</h1>
227 <div class="section" id="id27">
228 <h2>Features added</h2>
229 <ul class="simple">
230 <li>The module <tt class="docutils literal">lxml.sax</tt> is compiled using Cython in order to speed it up.</li>
231 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/267">GH#267</a>: <tt class="docutils literal">lxml.sax.ElementTreeProducer</tt> now preserves the namespace prefixes.
232 If two prefixes point to the same URI, the first prefix in alphabetical order
233 is used.  Patch by Lennart Regebro.</li>
234 <li>Updated ISO-Schematron implementation to 2013 version (now MIT licensed)
235 and the corresponding schema to the 2016 version (with optional &quot;properties&quot;).</li>
236 </ul>
237 </div>
238 <div class="section" id="id28">
239 <h2>Other changes</h2>
240 <ul class="simple">
241 <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.
242 Patch by hugovk.</li>
243 <li>The minimum dependency versions were raised to libxml2 2.9.2 and libxslt 1.1.27,
244 which were released in 2014 and 2012 respectively.</li>
245 <li>Built with Cython 0.29.2.</li>
246 </ul>
247 </div>
248 </div>
249 <div class="section" id="id29">
250 <h1>4.2.6 (2019-01-02)</h1>
251 <div class="section" id="id30">
252 <h2>Bugs fixed</h2>
253 <ul class="simple">
254 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1799755">LP#1799755</a>: Fix a DeprecationWarning in Py3.7+.</li>
255 <li>Import warnings in Python 3.6+ were resolved.</li>
256 </ul>
257 </div>
258 </div>
259 <div class="section" id="id31">
260 <h1>4.2.5 (2018-09-09)</h1>
261 <div class="section" id="id32">
262 <h2>Bugs fixed</h2>
263 <ul class="simple">
264 <li>Javascript URLs that used URL escaping were not removed by the HTML cleaner.
265 Security problem found by Omar Eissa.  (CVE-2018-19787)</li>
266 </ul>
267 </div>
268 </div>
269 <div class="section" id="id33">
270 <h1>4.2.4 (2018-08-03)</h1>
271 <div class="section" id="id34">
272 <h2>Features added</h2>
273 <ul class="simple">
274 <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.
275 Patch by Patrick Griffis.</li>
276 </ul>
277 </div>
278 <div class="section" id="id35">
279 <h2>Bugs fixed</h2>
280 <ul class="simple">
281 <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
282 <tt class="docutils literal">Element.insert()</tt>.
283 Patch by Alexander Weggerle.</li>
284 </ul>
285 </div>
286 </div>
287 <div class="section" id="id36">
288 <h1>4.2.3 (2018-06-27)</h1>
289 <div class="section" id="id37">
290 <h2>Bugs fixed</h2>
291 <ul class="simple">
292 <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>
293 </ul>
294 </div>
295 </div>
296 <div class="section" id="id38">
297 <h1>4.2.2 (2018-06-22)</h1>
298 <div class="section" id="id39">
299 <h2>Bugs fixed</h2>
300 <ul class="simple">
301 <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
302 and the parser participates in a reference cycle.
303 Original patch by Julien Greard.</li>
304 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/265">GH#265</a>: lxml no longer links against zlib as a shared library, only on static builds.
305 Patch by Nehal J Wani.</li>
306 </ul>
307 </div>
308 </div>
309 <div class="section" id="id41">
310 <h1>4.2.1 (2018-03-21)</h1>
311 <div class="section" id="id42">
312 <h2>Bugs fixed</h2>
313 <ul class="simple">
314 <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
315 element if a tag selector is used.</li>
316 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1756314">LP#1756314</a>: Failure to import 4.2.0 into PyPy due to a missing library symbol.</li>
317 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1727864">LP#1727864</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/258">GH#258</a>: Add &quot;-isysroot&quot; linker option on MacOS as needed by XCode 9.</li>
318 </ul>
319 </div>
320 </div>
321 <div class="section" id="id43">
322 <h1>4.2.0 (2018-03-13)</h1>
323 <div class="section" id="id44">
324 <h2>Features added</h2>
325 <ul class="simple">
326 <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
327 browser-like defaults for non-multi-selects.  If no option is selected, the
328 value of the first option is returned (instead of None).  If multiple options
329 are selected, the value of the last one is returned (instead of that of the
330 first one).  If no options are present (not standard-compliant)
331 <tt class="docutils literal">SelectElement.value</tt> still returns <tt class="docutils literal">None</tt>.</li>
332 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/261">GH#261</a>: The <tt class="docutils literal">HTMLParser()</tt> now supports the <tt class="docutils literal">huge_tree</tt> option.
333 Patch by stranac.</li>
334 </ul>
335 </div>
336 <div class="section" id="id45">
337 <h2>Bugs fixed</h2>
338 <ul class="simple">
339 <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>
340 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1737825">LP#1737825</a>: Crash at shutdown after an interrupted iterparse run with XMLSchema
341 validation.</li>
342 </ul>
343 </div>
344 <div class="section" id="id46">
345 <h2>Other changes</h2>
346 </div>
347 </div>
348 <div class="section" id="id47">
349 <h1>4.1.1 (2017-11-04)</h1>
350 <ul class="simple">
351 <li>Rebuild with Cython 0.27.3 to improve support for Py3.7.</li>
352 </ul>
353 </div>
354 <div class="section" id="id48">
355 <h1>4.1.0 (2017-10-13)</h1>
356 <div class="section" id="id49">
357 <h2>Features added</h2>
358 <ul class="simple">
359 <li>ElementPath supports text predicates for current node, like &quot;[.='text']&quot;.</li>
360 <li>ElementPath allows spaces in predicates.</li>
361 <li>Custom Element classes and XPath functions can now be registered with a
362 decorator rather than explicit dict assignments.</li>
363 <li>Static Linux wheels are now built with link time optimisation (LTO) enabled.
364 This should have a beneficial impact on the overall performance by providing
365 a tighter compiler integration between lxml and libxml2/libxslt.</li>
366 </ul>
367 </div>
368 <div class="section" id="id50">
369 <h2>Bugs fixed</h2>
370 <ul class="simple">
371 <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
372 <tt class="docutils literal">PythonElementClassLookup</tt> could fail with a TypeError.</li>
373 </ul>
374 </div>
375 </div>
376 <div class="section" id="id51">
377 <h1>4.0.0 (2017-09-17)</h1>
378 <div class="section" id="id52">
379 <h2>Features added</h2>
380 <ul class="simple">
381 <li>The ElementPath implementation is now compiled using Cython,
382 which speeds up the <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods quite significantly.</li>
383 <li>The modules <tt class="docutils literal">lxml.builder</tt>, <tt class="docutils literal">lxml.html.diff</tt> and <tt class="docutils literal">lxml.html.clean</tt>
384 are also compiled using Cython in order to speed them up.</li>
385 <li><tt class="docutils literal">xmlfile()</tt> supports async coroutines using <tt class="docutils literal">async with</tt> and <tt class="docutils literal">await</tt>.</li>
386 <li><tt class="docutils literal">iterwalk()</tt> has a new method <tt class="docutils literal">skip_subtree()</tt> that prevents walking into
387 the descendants of the current element.</li>
388 <li><tt class="docutils literal">RelaxNG.from_rnc_string()</tt> accepts a <tt class="docutils literal">base_url</tt> argument to
389 allow relative resource lookups.</li>
390 <li>The XSLT result object has a new method <tt class="docutils literal">.write_output(file)</tt> that serialises
391 output data into a file according to the <tt class="docutils literal">&lt;xsl:output&gt;</tt> configuration.</li>
392 </ul>
393 </div>
394 <div class="section" id="id53">
395 <h2>Bugs fixed</h2>
396 <ul>
397 <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.
398 Patch by mozbugbox.</p>
399 </li>
400 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1654544">LP#1654544</a>: The html5parser no longer passes the <tt class="docutils literal">useChardet</tt> option
401 if the input is a Unicode string, unless explicitly requested.  When parsing
402 files, the default is to enable it when a URL or file path is passed (because
403 the file is then opened in binary mode), and to disable it when reading from
404 a file(-like) object.</p>
405 <p>Note: This is a backwards incompatible change of the default configuration.
406 If your code parses byte strings/streams and depends on character detection,
407 please pass the option <tt class="docutils literal">guess_charset=True</tt> explicitly, which already worked
408 in older lxml versions.</p>
409 </li>
410 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1703810">LP#1703810</a>: <tt class="docutils literal">etree.fromstring()</tt> failed to parse UTF-32 data with BOM.</p>
411 </li>
412 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1526522">LP#1526522</a>: Some RelaxNG errors were not reported in the error log.</p>
413 </li>
414 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1567526">LP#1567526</a>: Empty and plain text input raised a TypeError in soupparser.</p>
415 </li>
416 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1710429">LP#1710429</a>: Uninitialised variable usage in HTML diff.</p>
417 </li>
418 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1415643">LP#1415643</a>: The closing tags context manager in <tt class="docutils literal">xmlfile()</tt> could continue
419 to output end tags even after writing failed with an exception.</p>
420 </li>
421 <li><p class="first"><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1465357">LP#1465357</a>: <tt class="docutils literal">xmlfile.write()</tt> now accepts and ignores None as input argument.</p>
422 </li>
423 <li><p class="first">Compilation under Py3.7-pre failed due to a modified function signature.</p>
424 </li>
425 </ul>
426 </div>
427 <div class="section" id="id54">
428 <h2>Other changes</h2>
429 <ul class="simple">
430 <li>The main module source files were renamed from <tt class="docutils literal"><span class="pre">lxml.*.pyx</span></tt> to plain
431 <tt class="docutils literal">*.pyx</tt> (e.g. <tt class="docutils literal">etree.pyx</tt>) to simplify their handling in the build
432 process.  Care was taken to keep the old header files as fallbacks for
433 code that compiles against the public C-API of lxml, but it might still
434 be worth validating that third-party code does not notice this change.</li>
435 </ul>
436 </div>
437 </div>
438 <div class="section" id="id55">
439 <h1>3.8.0 (2017-06-03)</h1>
440 <div class="section" id="id56">
441 <h2>Features added</h2>
442 <ul class="simple">
443 <li><tt class="docutils literal">ElementTree.write()</tt> has a new option <tt class="docutils literal">doctype</tt> that writes out a
444 doctype string before the serialisation, in the same way as <tt class="docutils literal">tostring()</tt>.</li>
445 <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.
446 Patch by Burak Arslan.</li>
447 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1595781">LP#1595781</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/240">GH#240</a>: added a PyCapsule Python API and C-level API for
448 passing externally generated libxml2 documents into lxml.</li>
449 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/244">GH#244</a>: error log entries have a new property <tt class="docutils literal">path</tt> with an XPath
450 expression (if known, None otherwise) that points to the tree element
451 responsible for the error. Patch by Bob Kline.</li>
452 <li>The namespace prefix mapping that can be used in ElementPath now injects
453 a default namespace when passing a None prefix.</li>
454 </ul>
455 </div>
456 <div class="section" id="id57">
457 <h2>Bugs fixed</h2>
458 <ul class="simple">
459 <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.
460 Patch by matejcik.</li>
461 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/229">GH#229</a>: fix for externally created XML documents.  Patch by Theodore Dubois.</li>
462 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1665241">LP#1665241</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/228">GH#228</a>: Form data handling in lxml.html no longer strips the
463 option values specified in form attributes but only the text values.
464 Patch by Ashish Kulkarni.</li>
465 <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
466 multi-threaded XSLT processing.</li>
467 <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>
468 </ul>
469 </div>
470 <div class="section" id="id59">
471 <h2>Other changes</h2>
472 <ul class="simple">
473 <li>The previously undocumented <tt class="docutils literal">docstring</tt> option in <tt class="docutils literal">ElementTree.write()</tt>
474 produces a deprecation warning and will eventually be removed.</li>
475 </ul>
476 </div>
477 </div>
478 <div class="section" id="id60">
479 <h1>3.7.4 (2017-??-??)</h1>
480 <div class="section" id="id61">
481 <h2>Bugs fixed</h2>
482 <ul class="simple">
483 <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
484 multi-threaded XSLT processing.</li>
485 <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>
486 </ul>
487 </div>
488 </div>
489 <div class="section" id="id65">
490 <h1>3.7.3 (2017-02-18)</h1>
491 <div class="section" id="id66">
492 <h2>Bugs fixed</h2>
493 <ul class="simple">
494 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a> was ineffective in Python 3.</li>
495 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/222">GH#222</a>: <tt class="docutils literal">lxml.html.submit_form()</tt> failed in Python 3.
496 Patch by Jakub Wilk.</li>
497 </ul>
498 </div>
499 </div>
500 <div class="section" id="id67">
501 <h1>3.7.2 (2017-01-08)</h1>
502 <ul class="simple">
503 <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.
504 Patch by Burak Arslan.</li>
505 </ul>
506 <div class="section" id="id69">
507 <h2>Bugs fixed</h2>
508 <ul class="simple">
509 <li>Work around installation problems in recent Python 2.7 versions
510 due to FTP download failures.</li>
511 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/219">GH#219</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly quoting attribute values.
512 Patch by Burak Arslan.</li>
513 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/218">GH#218</a>: <tt class="docutils literal">xmlfile.element()</tt> was not properly escaping text content of
514 script/style tags.  Patch by Burak Arslan.</li>
515 </ul>
516 </div>
517 </div>
518 <div class="section" id="id71">
519 <h1>3.7.1 (2016-12-23)</h1>
520 <ul class="simple">
521 <li>No source changes, issued only to solve problems with the
522 binary packages released for 3.7.0.</li>
523 </ul>
524 </div>
525 <div class="section" id="id72">
526 <h1>3.7.0 (2016-12-10)</h1>
527 <div class="section" id="id73">
528 <h2>Features added</h2>
529 <ul class="simple">
530 <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>
531 baseclass.  Patch by Philipp A.</li>
532 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/216">GH#216</a>: <tt class="docutils literal">HTMLParser()</tt> now supports the same <tt class="docutils literal">collect_ids</tt> parameter
533 as <tt class="docutils literal">XMLParser()</tt>.  Patch by Burak Arslan.</li>
534 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/210">GH#210</a>: Allow specifying a serialisation method in <tt class="docutils literal">xmlfile.write()</tt>.
535 Patch by Burak Arslan.</li>
536 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/203">GH#203</a>: New option <tt class="docutils literal">default_doctype</tt> in <tt class="docutils literal">HTMLParser</tt> that allows
537 disabling the automatic doctype creation.  Patch by Shadab Zafar.</li>
538 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/201">GH#201</a>: Calling the method <tt class="docutils literal"><span class="pre">.set('attrname')</span></tt> without value argument
539 (or <tt class="docutils literal">None</tt>) on HTML elements creates an attribute without value that
540 serialises like <tt class="docutils literal">&lt;div <span class="pre">attrname&gt;&lt;/div&gt;</span></tt>.  Patch by Daniel Holth.</li>
541 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/197">GH#197</a>: Ignore form input fields in <tt class="docutils literal">form_values()</tt> when they are
542 marked as <tt class="docutils literal">disabled</tt> in HTML.  Patch by Kristian Klemon.</li>
543 </ul>
544 </div>
545 <div class="section" id="id74">
546 <h2>Bugs fixed</h2>
547 <ul class="simple">
548 <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.
549 Patch by Marcus Brinkmann.</li>
550 </ul>
551 </div>
552 <div class="section" id="id75">
553 <h2>Other changes</h2>
554 <ul class="simple">
555 <li>Log entries no longer allow anything but plain string objects as message text
556 and file name.</li>
557 <li><tt class="docutils literal">zlib</tt> is included in the list of statically built libraries.</li>
558 </ul>
559 </div>
560 </div>
561 <div class="section" id="id76">
562 <h1>3.6.4 (2016-08-20)</h1>
563 <ul class="simple">
564 <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>
565 </ul>
566 </div>
567 <div class="section" id="id77">
568 <h1>3.6.3 (2016-08-18)</h1>
569 <ul class="simple">
570 <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>
571 </ul>
572 </div>
573 <div class="section" id="id78">
574 <h1>3.6.2 (2016-08-18)</h1>
575 <ul class="simple">
576 <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>
577 </ul>
578 </div>
579 <div class="section" id="id80">
580 <h1>3.6.1 (2016-07-24)</h1>
581 <div class="section" id="id81">
582 <h2>Features added</h2>
583 <ul class="simple">
584 <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>
585 attributes instead of all styles.  Patch by Christian Pedersen.</li>
586 <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>
587 </ul>
588 </div>
589 <div class="section" id="id82">
590 <h2>Bugs fixed</h2>
591 <ul class="simple">
592 <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).
593 Patch by Tomas Divis.</li>
594 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/198">GH#198</a>, <a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1568167">LP#1568167</a>: Try to provide base URL from <tt class="docutils literal">Resolver.resolve_string()</tt>.
595 Patch by Michael van Tellingen.</li>
596 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/191">GH#191</a>: More accurate float serialisation in <tt class="docutils literal">objectify.FloatElement</tt>.
597 Patch by Holger Joukl.</li>
598 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1551797">LP#1551797</a>: Repair XSLT error logging. Patch by Marcus Brinkmann.</li>
599 </ul>
600 </div>
601 </div>
602 <div class="section" id="id84">
603 <h1>3.6.0 (2016-03-17)</h1>
604 <div class="section" id="id85">
605 <h2>Features added</h2>
606 <ul class="simple">
607 <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.
608 Patch by Armin Rigo.</li>
609 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/181">GH#181</a>: Direct support for <tt class="docutils literal">.rnc</tt> files in <cite>RelaxNG()</cite> if <tt class="docutils literal">rnc2rng</tt>
610 is installed.  Patch by Dirkjan Ochtman.</li>
611 </ul>
612 </div>
613 <div class="section" id="id86">
614 <h2>Bugs fixed</h2>
615 <ul class="simple">
616 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/189">GH#189</a>: Static builds honour FTP proxy configurations when downloading
617 the external libs.  Patch by Youhei Sakurai.</li>
618 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/186">GH#186</a>: Soupparser failed to process entities in Python 3.x.
619 Patch by Duncan Morris.</li>
620 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/185">GH#185</a>: Rare encoding related <tt class="docutils literal">TypeError</tt> on import was fixed.
621 Patch by Petr Demin.</li>
622 </ul>
623 </div>
624 </div>
625 <div class="section" id="id87">
626 <h1>3.5.0 (2015-11-13)</h1>
627 <div class="section" id="id88">
628 <h2>Bugs fixed</h2>
629 <ul class="simple">
630 <li>Unicode string results failed XPath queries in PyPy.</li>
631 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1497051">LP#1497051</a>: HTML target parser failed to terminate on exceptions
632 and continued parsing instead.</li>
633 <li>Deprecated API usage in doctestcompare.</li>
634 </ul>
635 </div>
636 </div>
637 <div class="section" id="b1-2015-09-18">
638 <h1>3.5.0b1 (2015-09-18)</h1>
639 <div class="section" id="id89">
640 <h2>Features added</h2>
641 <ul class="simple">
642 <li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">keep_ns_prefixes</tt>
643 that does not remove definitions of the provided prefix-namespace
644 mapping from the tree.</li>
645 <li><tt class="docutils literal">cleanup_namespaces()</tt> accepts a new argument <tt class="docutils literal">top_nsmap</tt> that
646 moves definitions of the provided prefix-namespace mapping to the
647 top of the tree.</li>
648 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1490451">LP#1490451</a>: <tt class="docutils literal">Element</tt> objects gained a <tt class="docutils literal">cssselect()</tt> method as
649 known from <tt class="docutils literal">lxml.html</tt>.  Patch by Simon Sapin.</li>
650 <li>API functions and methods behave and look more like Python functions,
651 which allows introspection on them etc.  One side effect to be aware of
652 is that the functions now bind as methods when assigned to a class
653 variable.  A quick fix is to wrap them in <tt class="docutils literal">staticmethod()</tt> (as for
654 normal Python functions).</li>
655 <li>ISO-Schematron support gained an option <tt class="docutils literal">error_finder</tt> that allows
656 passing a filter function for picking validation errors from reports.</li>
657 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1243600">LP#1243600</a>: Elements in <tt class="docutils literal">lxml.html</tt> gained a <tt class="docutils literal">classes</tt> property
658 that provides a set-like interface to the <tt class="docutils literal">class</tt> attribute.
659 Original patch by masklinn.</li>
660 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1341964">LP#1341964</a>: The soupparser now handles DOCTYPE declarations, comments
661 and processing instructions outside of the root element.
662 Patch by Olli Pottonen.</li>
663 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421512">LP#1421512</a>: The <tt class="docutils literal">docinfo</tt> of a tree was made editable to allow
664 setting and removing the public ID and system ID of the DOCTYPE.
665 Patch by Olli Pottonen.</li>
666 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1442427">LP#1442427</a>: More work-arounds for quirks and bugs in pypy and pypy3.</li>
667 <li><tt class="docutils literal">lxml.html.soupparser</tt> now uses BeautifulSoup version 4 instead
668 of version 3 if available.</li>
669 </ul>
670 </div>
671 <div class="section" id="id90">
672 <h2>Bugs fixed</h2>
673 <ul class="simple">
674 <li>Memory errors that occur during tree adaptations (e.g. moving subtrees
675 to foreign documents) could leave the tree in a crash prone state.</li>
676 <li>Calling <tt class="docutils literal">process_children()</tt> in an XSLT extension element without
677 an <tt class="docutils literal">output_parent</tt> argument failed with a <tt class="docutils literal">TypeError</tt>.
678 Fix by Jens Tröger.</li>
679 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/162">GH#162</a>: Image data in HTML <tt class="docutils literal">data</tt> URLs is considered safe and
680 no longer removed by <tt class="docutils literal">lxml.html.clean</tt> JavaScript cleaner.</li>
681 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/166">GH#166</a>: Static build could link libraries in wrong order.</li>
682 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/172">GH#172</a>: Rely a bit more on libxml2 for encoding detection rather than
683 rolling our own in some cases.  Patch by Olli Pottonen.</li>
684 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/159">GH#159</a>: Validity checks for names and string content were tightened
685 to detect the use of illegal characters early.  Patch by Olli Pottonen.</li>
686 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421921">LP#1421921</a>: Comments/PIs before the DOCTYPE declaration were not
687 serialised.  Patch by Olli Pottonen.</li>
688 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/659367">LP#659367</a>: Some HTML DOCTYPE declarations were not serialised.
689 Patch by Olli Pottonen.</li>
690 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238503">LP#1238503</a>: lxml.doctestcompare is now consistent with stdlib's doctest
691 in how it uses <tt class="docutils literal">+</tt> and <tt class="docutils literal">-</tt> to refer to unexpected and missing output.</li>
692 <li>Empty prefixes are explicitly rejected when a namespace mapping is used
693 with ElementPath to avoid hiding bugs in user code.</li>
694 <li>Several problems with PyPy were fixed by switching to Cython 0.23.</li>
695 </ul>
696 </div>
697 </div>
698 <div class="section" id="id91">
699 <h1>3.4.4 (2015-04-25)</h1>
700 <div class="section" id="id92">
701 <h2>Bugs fixed</h2>
702 <ul class="simple">
703 <li>An ElementTree compatibility test added in lxml 3.4.3 that failed in
704 Python 3.4+ was removed again.</li>
705 </ul>
706 </div>
707 </div>
708 <div class="section" id="id93">
709 <h1>3.4.3 (2015-04-15)</h1>
710 <div class="section" id="id94">
711 <h2>Bugs fixed</h2>
712 <ul class="simple">
713 <li>Expression cache in ElementPath was ignored.  Fix by Changaco.</li>
714 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1426868">LP#1426868</a>: Passing a default namespace and a prefixed namespace mapping
715 as nsmap into <tt class="docutils literal">xmlfile.element()</tt> raised a <tt class="docutils literal">TypeError</tt>.</li>
716 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1421927">LP#1421927</a>: DOCTYPE system URLs were incorrectly quoted when containing
717 double quotes.  Patch by Olli Pottonen.</li>
718 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1419354">LP#1419354</a>: meta-redirect URLs were incorrectly processed by
719 <tt class="docutils literal">iterlinks()</tt> if preceded by whitespace.</li>
720 </ul>
721 </div>
722 </div>
723 <div class="section" id="id95">
724 <h1>3.4.2 (2015-02-07)</h1>
725 <div class="section" id="id96">
726 <h2>Bugs fixed</h2>
727 <ul class="simple">
728 <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
729 of an XML document.</li>
730 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1369362">LP#1369362</a>: HTML cleaning failed when hitting processing instructions
731 with pseudo-attributes.</li>
732 <li><tt class="docutils literal">CDATA()</tt> wrapped content was rejected for tail text.</li>
733 <li>CDATA sections were not serialised as tail text of the top-level element.</li>
734 </ul>
735 </div>
736 </div>
737 <div class="section" id="id97">
738 <h1>3.4.1 (2014-11-20)</h1>
739 <div class="section" id="id98">
740 <h2>Features added</h2>
741 <ul class="simple">
742 <li>New <tt class="docutils literal">htmlfile</tt> HTML generator to accompany the incremental <tt class="docutils literal">xmlfile</tt>
743 serialisation API.  Patch by Burak Arslan.</li>
744 </ul>
745 </div>
746 <div class="section" id="id99">
747 <h2>Bugs fixed</h2>
748 <ul class="simple">
749 <li><tt class="docutils literal">lxml.sax.ElementTreeContentHandler</tt> did not initialise its superclass.</li>
750 </ul>
751 </div>
752 </div>
753 <div class="section" id="id100">
754 <h1>3.4.0 (2014-09-10)</h1>
755 <div class="section" id="id101">
756 <h2>Features added</h2>
757 <ul class="simple">
758 <li><tt class="docutils literal">xmlfile(buffered=False)</tt> disables output buffering and flushes the
759 content after each API operation (starting/ending element blocks or writes).
760 A new method <tt class="docutils literal">xf.flush()</tt> can alternatively be used to explicitly flush
761 the output.</li>
762 <li><tt class="docutils literal">lxml.html.document_fromstring</tt> has a new option <tt class="docutils literal">ensure_head_body=True</tt>
763 which will add an empty head and/or body element to the result document if
764 missing.</li>
765 <li><tt class="docutils literal">lxml.html.iterlinks</tt> now returns links inside meta refresh tags.</li>
766 <li>New <tt class="docutils literal">XMLParser</tt> option <tt class="docutils literal">collect_ids=False</tt> to disable ID hash table
767 creation.  This can substantially speed up parsing of documents with many
768 different IDs that are not used.</li>
769 <li>The parser uses per-document hash tables for XML IDs.  This reduces the
770 load of the global parser dict and speeds up parsing for documents with
771 many different IDs.</li>
772 <li><tt class="docutils literal">ElementTree.getelementpath(element)</tt> returns a structural ElementPath
773 expression for the given element, which can be used for lookups later.</li>
774 <li><tt class="docutils literal">xmlfile()</tt> accepts a new argument <tt class="docutils literal">close=True</tt> to close file(-like)
775 objects after writing to them.  Before, <tt class="docutils literal">xmlfile()</tt> only closed the file
776 if it had opened it internally.</li>
777 <li>Allow &quot;bytearray&quot; type for ASCII text input.</li>
778 </ul>
779 </div>
780 <div class="section" id="id102">
781 <h2>Bugs fixed</h2>
782 </div>
783 <div class="section" id="id103">
784 <h2>Other changes</h2>
785 <ul class="simple">
786 <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.
787 Previously, they could lead to an internal tree representation in a mixed
788 encoding state, which lead to very late errors or even silently incorrect
789 behaviour during tree traversal or serialisation.</li>
790 <li>Requires Python 2.6, 2.7, 3.2 or later. No longer supports
791 Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.</li>
792 <li>Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later,
793 use lxml 3.3.x with older versions.</li>
794 </ul>
795 </div>
796 </div>
797 <div class="section" id="id104">
798 <h1>3.3.6 (2014-08-28)</h1>
799 <div class="section" id="id105">
800 <h2>Bugs fixed</h2>
801 <ul class="simple">
802 <li>Prevent tree cycle creation when adding Elements as siblings.</li>
803 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1361948">LP#1361948</a>: crash when deallocating Element siblings without parent.</li>
804 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1354652">LP#1354652</a>: crash when traversing internally loaded documents in XSLT
805 extension functions.</li>
806 </ul>
807 </div>
808 </div>
809 <div class="section" id="id106">
810 <h1>3.3.5 (2014-04-18)</h1>
811 <div class="section" id="id107">
812 <h2>Bugs fixed</h2>
813 <ul class="simple">
814 <li>HTML cleaning could fail to strip javascript links that mix control
815 characters into the link scheme.</li>
816 </ul>
817 </div>
818 </div>
819 <div class="section" id="id108">
820 <h1>3.3.4 (2014-04-03)</h1>
821 <div class="section" id="id109">
822 <h2>Features added</h2>
823 <ul class="simple">
824 <li>Source line numbers above 65535 are available on Elements when
825 using libxml2 2.9 or later.</li>
826 </ul>
827 </div>
828 <div class="section" id="id110">
829 <h2>Bugs fixed</h2>
830 <ul class="simple">
831 <li><tt class="docutils literal">lxml.html.fragment_fromstring()</tt> failed for bytes input in Py3.</li>
832 </ul>
833 </div>
834 <div class="section" id="id111">
835 <h2>Other changes</h2>
836 </div>
837 </div>
838 <div class="section" id="id112">
839 <h1>3.3.3 (2014-03-04)</h1>
840 <div class="section" id="id113">
841 <h2>Bugs fixed</h2>
842 <ul class="simple">
843 <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>
844 </ul>
845 </div>
846 <div class="section" id="id114">
847 <h2>Other changes</h2>
848 <ul class="simple">
849 <li>The internal classes <tt class="docutils literal">_LogEntry</tt> and <tt class="docutils literal">_Attrib</tt> can no longer be
850 subclassed from Python code.</li>
851 </ul>
852 </div>
853 </div>
854 <div class="section" id="id115">
855 <h1>3.3.2 (2014-02-26)</h1>
856 <div class="section" id="id116">
857 <h2>Bugs fixed</h2>
858 <ul class="simple">
859 <li>The properties <tt class="docutils literal">resolvers</tt> and <tt class="docutils literal">version</tt>, as well as the methods
860 <tt class="docutils literal">set_element_class_lookup()</tt> and <tt class="docutils literal">makeelement()</tt>, were lost from
861 <tt class="docutils literal">iterparse</tt> objects in 3.3.0.</li>
862 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1222132">LP#1222132</a>: instances of <tt class="docutils literal">XMLSchema</tt>, <tt class="docutils literal">Schematron</tt> and <tt class="docutils literal">RelaxNG</tt>
863 did not clear their local <tt class="docutils literal">error_log</tt> before running a validation.</li>
864 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1238500">LP#1238500</a>: lxml.doctestcompare mixed up &quot;expected&quot; and &quot;actual&quot; in
865 attribute values.</li>
866 <li>Some file I/O tests were failing in MS-Windows due to non-portable temp
867 file usage.  Initial patch by Gabi Davar.</li>
868 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/910014">LP#910014</a>: duplicate IDs in a document were not reported by DTD validation.</li>
869 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185332">LP#1185332</a>: <tt class="docutils literal"><span class="pre">tostring(method=&quot;html&quot;)</span></tt> did not use HTML serialisation
870 semantics for trailing tail text.  Initial patch by Sylvain Viollon.</li>
871 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1281139">LP#1281139</a>: <tt class="docutils literal">.attrib</tt> value of Comments lost its mutation methods
872 in 3.3.0.  Even though it is empty and immutable, it should still
873 provide the same interface as that returned for Elements.</li>
874 </ul>
875 </div>
876 </div>
877 <div class="section" id="id117">
878 <h1>3.3.1 (2014-02-12)</h1>
879 <div class="section" id="id118">
880 <h2>Features added</h2>
881 </div>
882 <div class="section" id="id119">
883 <h2>Bugs fixed</h2>
884 <ul class="simple">
885 <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
886 elements during tag iteration.</li>
887 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1273709">LP#1273709</a>: Building in PyPy failed due to missing support for
888 <tt class="docutils literal">PyUnicode_Compare()</tt> and <tt class="docutils literal"><span class="pre">PyByteArray_*()</span></tt> in PyPy's C-API.</li>
889 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274413">LP#1274413</a>: Compilation in MSVC failed due to missing &quot;stdint.h&quot; standard
890 header file.</li>
891 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1274118">LP#1274118</a>: iterparse() failed to parse BOM prefixed files.</li>
892 </ul>
893 </div>
894 <div class="section" id="id120">
895 <h2>Other changes</h2>
896 </div>
897 </div>
898 <div class="section" id="id121">
899 <h1>3.3.0 (2014-01-26)</h1>
900 <div class="section" id="id122">
901 <h2>Features added</h2>
902 </div>
903 <div class="section" id="id123">
904 <h2>Bugs fixed</h2>
905 <ul class="simple">
906 <li>The heuristic that distinguishes file paths from URLs was tightened
907 to produce less false negatives.</li>
908 </ul>
909 </div>
910 <div class="section" id="id124">
911 <h2>Other changes</h2>
912 </div>
913 </div>
914 <div class="section" id="beta5-2014-01-18">
915 <h1>3.3.0beta5 (2014-01-18)</h1>
916 <div class="section" id="id125">
917 <h2>Features added</h2>
918 <ul class="simple">
919 <li>The PEP 393 unicode parsing support gained a fallback for wchar strings
920 which might still be somewhat common on Windows systems.</li>
921 </ul>
922 </div>
923 <div class="section" id="id126">
924 <h2>Bugs fixed</h2>
925 <ul class="simple">
926 <li>Several error handling problems were fixed throughout the code base that
927 could previously lead to exceptions being silently swallowed or not
928 properly reported.</li>
929 <li>The C-API function <tt class="docutils literal">appendChild()</tt> is now deprecated as it does not
930 propagate exceptions (its return type is <tt class="docutils literal">void</tt>).  The new function
931 <tt class="docutils literal">appendChildToElement()</tt> was added as a safe replacement.</li>
932 <li>Passing a string into <tt class="docutils literal">fromstringlist()</tt> raises an exception instead of
933 parsing the string character by character.</li>
934 </ul>
935 </div>
936 <div class="section" id="id127">
937 <h2>Other changes</h2>
938 <ul class="simple">
939 <li>Document cleanup code was simplified using the new GC features in
940 Cython 0.20.</li>
941 </ul>
942 </div>
943 </div>
944 <div class="section" id="beta4-2014-01-12">
945 <h1>3.3.0beta4 (2014-01-12)</h1>
946 <div class="section" id="id128">
947 <h2>Features added</h2>
948 </div>
949 <div class="section" id="id129">
950 <h2>Bugs fixed</h2>
951 <ul class="simple">
952 <li>The (empty) value returned by the <tt class="docutils literal">attrib</tt> property of Entity and Comment
953 objects was mutable.</li>
954 <li>Element class lookup wasn't available for the new pull parsers or when using
955 a custom parser target.</li>
956 <li>Setting Element attributes on instantiation with both the <tt class="docutils literal">attrib</tt> argument
957 and keyword arguments could modify the mapping passed as <tt class="docutils literal">attrib</tt>.</li>
958 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1266171">LP#1266171</a>: DTDs instantiated from internal/external subsets (i.e. through
959 the docinfo property) lost their attribute declarations.</li>
960 </ul>
961 </div>
962 <div class="section" id="id130">
963 <h2>Other changes</h2>
964 <ul class="simple">
965 <li>Built with Cython 0.20pre (gitrev 012ae82eb) to prepare support for
966 Python 3.4.</li>
967 </ul>
968 </div>
969 </div>
970 <div class="section" id="beta3-2014-01-02">
971 <h1>3.3.0beta3 (2014-01-02)</h1>
972 <div class="section" id="id131">
973 <h2>Features added</h2>
974 <ul class="simple">
975 <li>Unicode string parsing was optimised for Python 3.3 (PEP 393).</li>
976 </ul>
977 </div>
978 <div class="section" id="id132">
979 <h2>Bugs fixed</h2>
980 <ul class="simple">
981 <li>HTML parsing of Unicode strings could misdecode the input on some platforms.</li>
982 <li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
983 </ul>
984 </div>
985 <div class="section" id="id133">
986 <h2>Other changes</h2>
987 </div>
988 </div>
989 <div class="section" id="beta2-2013-12-20">
990 <h1>3.3.0beta2 (2013-12-20)</h1>
991 <div class="section" id="id134">
992 <h2>Features added</h2>
993 <ul class="simple">
994 <li><tt class="docutils literal">iterparse()</tt> supports the <tt class="docutils literal">recover</tt> option.</li>
995 </ul>
996 </div>
997 <div class="section" id="id135">
998 <h2>Bugs fixed</h2>
999 <ul class="simple">
1000 <li>Crash in <tt class="docutils literal">iterparse()</tt> for HTML parsing.</li>
1001 <li>Crash in target parsing with attributes.</li>
1002 </ul>
1003 </div>
1004 <div class="section" id="id136">
1005 <h2>Other changes</h2>
1006 <ul class="simple">
1007 <li>The safety check in the read-only tree implementation (e.g. used by
1008 <tt class="docutils literal">PythonElementClassLookup</tt>) raises a more appropriate <tt class="docutils literal">ReferenceError</tt>
1009 for illegal access after tree disposal instead of an <tt class="docutils literal">AssertionError</tt>.
1010 This should only impact test code that specifically checks the original
1011 behaviour.</li>
1012 </ul>
1013 </div>
1014 </div>
1015 <div class="section" id="beta1-2013-12-12">
1016 <h1>3.3.0beta1 (2013-12-12)</h1>
1017 <div class="section" id="id137">
1018 <h2>Features added</h2>
1019 <ul class="simple">
1020 <li>New option <tt class="docutils literal">handle_failures</tt> in <tt class="docutils literal">make_links_absolute()</tt> and
1021 <tt class="docutils literal">resolve_base_href()</tt> (lxml.html) that enables ignoring or
1022 discarding links that fail to parse as URLs.</li>
1023 <li>New parser classes <tt class="docutils literal">XMLPullParser</tt> and <tt class="docutils literal">HTMLPullParser</tt> for
1024 incremental parsing, as implemented for ElementTree in Python 3.4.</li>
1025 <li><tt class="docutils literal">iterparse()</tt> enables recovery mode by default for HTML parsing
1026 (<tt class="docutils literal">html=True</tt>).</li>
1027 </ul>
1028 </div>
1029 <div class="section" id="id138">
1030 <h2>Bugs fixed</h2>
1031 <ul class="simple">
1032 <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.
1033 comment or PI).</li>
1034 <li>Error messages in the log and in exception messages that originated
1035 from libxml2 could accidentally be picked up from preceding warnings
1036 instead of the actual error.</li>
1037 <li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify did not accept a dict as
1038 argument for adding attributes to the element it's building. This
1039 works as in lxml.builder now.</li>
1040 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
1041 <li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
1042 to one of its own descendants, instead of running into an infinite
1043 loop.</li>
1044 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
1045 <li>Compressed plain-text serialisation to file-like objects was broken.</li>
1046 <li>lxml.html.formfill: Fix textarea form filling.
1047 The textarea used to be cleared before the new content was set,
1048 which removed the name attribute.</li>
1049 </ul>
1050 </div>
1051 <div class="section" id="id139">
1052 <h2>Other changes</h2>
1053 <ul class="simple">
1054 <li>Some basic API classes use freelists internally for faster
1055 instantiation.  This can speed up some <tt class="docutils literal">iterparse()</tt> scenarios,
1056 for example.</li>
1057 <li><tt class="docutils literal">iterparse()</tt> was rewritten to use the new <tt class="docutils literal">*PullParser</tt>
1058 classes internally instead of being a parser itself.</li>
1059 </ul>
1060 </div>
1061 </div>
1062 <div class="section" id="id140">
1063 <h1>3.2.5 (2014-01-02)</h1>
1064 <div class="section" id="id141">
1065 <h2>Features added</h2>
1066 </div>
1067 <div class="section" id="id142">
1068 <h2>Bugs fixed</h2>
1069 <ul class="simple">
1070 <li>Crash in xmlfile() when closing open elements out of order in an error case.</li>
1071 <li>Crash in target parsing with attributes.</li>
1072 <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 comment or PI).</li>
1074 </ul>
1075 </div>
1076 <div class="section" id="id144">
1077 <h2>Other changes</h2>
1078 </div>
1079 </div>
1080 <div class="section" id="id145">
1081 <h1>3.2.4 (2013-11-07)</h1>
1082 <div class="section" id="id146">
1083 <h2>Features added</h2>
1084 </div>
1085 <div class="section" id="id147">
1086 <h2>Bugs fixed</h2>
1087 <ul class="simple">
1088 <li>Memory leak when creating an XPath evaluator in a thread.</li>
1089 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1228881">LP#1228881</a>: <tt class="docutils literal">repr(XSLTAccessControl)</tt> failed in Python 3.</li>
1090 <li>Raise <tt class="docutils literal">ValueError</tt> when trying to append an Element to itself or
1091 to one of its own descendants.</li>
1092 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1206077">LP#1206077</a>: htmldiff discarded whitespace from the output.</li>
1093 <li>Compressed plain-text serialisation to file-like objects was broken.</li>
1094 </ul>
1095 </div>
1096 <div class="section" id="id150">
1097 <h2>Other changes</h2>
1098 </div>
1099 </div>
1100 <div class="section" id="id151">
1101 <h1>3.2.3 (2013-07-28)</h1>
1102 <div class="section" id="id152">
1103 <h2>Bugs fixed</h2>
1104 <ul class="simple">
1105 <li>Fix support for Python 2.4 which was lost in 3.2.2.</li>
1106 </ul>
1107 </div>
1108 </div>
1109 <div class="section" id="id153">
1110 <h1>3.2.2 (2013-07-28)</h1>
1111 <div class="section" id="id154">
1112 <h2>Features added</h2>
1113 </div>
1114 <div class="section" id="id155">
1115 <h2>Bugs fixed</h2>
1116 <ul class="simple">
1117 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1185701">LP#1185701</a>: spurious XMLSyntaxError after finishing iterparse().</li>
1118 <li>Crash in lxml.objectify during xsi annotation.</li>
1119 </ul>
1120 </div>
1121 <div class="section" id="id156">
1122 <h2>Other changes</h2>
1123 <ul class="simple">
1124 <li>Return values of user provided element class lookup methods are now
1125 validated against the type of the XML node they represent to prevent
1126 API class mismatches.</li>
1127 </ul>
1128 </div>
1129 </div>
1130 <div class="section" id="id157">
1131 <h1>3.2.1 (2013-05-11)</h1>
1132 <div class="section" id="id158">
1133 <h2>Features added</h2>
1134 <ul class="simple">
1135 <li>The methods <tt class="docutils literal">apply_templates()</tt> and <tt class="docutils literal">process_children()</tt> of XSLT
1136 extension elements have gained two new boolean options <tt class="docutils literal">elements_only</tt>
1137 and <tt class="docutils literal">remove_blank_text</tt> that discard either all strings or whitespace-only
1138 strings from the result list.</li>
1139 </ul>
1140 </div>
1141 <div class="section" id="id159">
1142 <h2>Bugs fixed</h2>
1143 <ul class="simple">
1144 <li>When moving Elements to another tree, the namespace cleanup mechanism
1145 no longer drops namespace prefixes from attributes for which it finds
1146 a default namespace declaration, to prevent them from appearing as
1147 unnamespaced attributes after serialisation.</li>
1148 <li>Returning non-type objects from a custom class lookup method could lead
1149 to a crash.</li>
1150 <li>Instantiating and using subtypes of Comments and ProcessingInstructions
1151 crashed.</li>
1152 </ul>
1153 </div>
1154 <div class="section" id="id160">
1155 <h2>Other changes</h2>
1156 </div>
1157 </div>
1158 <div class="section" id="id161">
1159 <h1>3.2.0 (2013-04-28)</h1>
1160 <div class="section" id="id162">
1161 <h2>Features added</h2>
1162 </div>
1163 <div class="section" id="id163">
1164 <h2>Bugs fixed</h2>
1165 <ul class="simple">
1166 <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
1167 parsing functions in <tt class="docutils literal">lxml.html</tt>.</li>
1168 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/599318">LP#599318</a>: The string parsing functions in <tt class="docutils literal">lxml.html</tt> are more robust
1169 in the face of uncommon HTML content like framesets or missing body tags.
1170 Patch by Stefan Seelmann.</li>
1171 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/712941">LP#712941</a>: I/O errors while trying to access files with paths that contain
1172 non-ASCII characters could raise <tt class="docutils literal">UnicodeDecodeError</tt> instead of properly
1173 reporting the <tt class="docutils literal">IOError</tt>.</li>
1174 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/673205">LP#673205</a>: Parsing from in-memory strings disabled network access in the
1175 default parser and made subsequent attempts to parse from a URL fail.</li>
1176 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/971754">LP#971754</a>: lxml.html.clean appends 'nofollow' to 'rel' attributes instead
1177 of overwriting the current value.</li>
1178 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/715687">LP#715687</a>: lxml.html.clean no longer discards scripts that are explicitly
1179 allowed by the user provided whitelist.  Patch by Christine Koppelt.</li>
1180 </ul>
1181 </div>
1182 <div class="section" id="id164">
1183 <h2>Other changes</h2>
1184 </div>
1185 </div>
1186 <div class="section" id="id165">
1187 <h1>3.1.2 (2013-04-12)</h1>
1188 <div class="section" id="id166">
1189 <h2>Features added</h2>
1190 </div>
1191 <div class="section" id="id167">
1192 <h2>Bugs fixed</h2>
1193 <ul class="simple">
1194 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1136509">LP#1136509</a>: Passing attributes through the namespace-unaware API of
1195 the sax bridge (i.e. the <tt class="docutils literal">handler.startElement()</tt> method) failed
1196 with a <tt class="docutils literal">TypeError</tt>.  Patch by Mike Bayer.</li>
1197 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1123074">LP#1123074</a>: Fix serialisation error in XSLT output when converting
1198 the result tree to a Unicode string.</li>
1199 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/105">GH#105</a>: Replace illegal usage of <tt class="docutils literal">xmlBufLength()</tt> in libxml2 2.9.0
1200 by properly exported API function <tt class="docutils literal">xmlBufUse()</tt>.</li>
1201 </ul>
1202 </div>
1203 <div class="section" id="id168">
1204 <h2>Other changes</h2>
1205 </div>
1206 </div>
1207 <div class="section" id="id169">
1208 <h1>3.1.1 (2013-03-29)</h1>
1209 <div class="section" id="id170">
1210 <h2>Features added</h2>
1211 </div>
1212 <div class="section" id="id171">
1213 <h2>Bugs fixed</h2>
1214 <ul class="simple">
1215 <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
1216 an AttributeError in Py3.</li>
1217 <li>Illegal memory access during cleanup in incremental xmlfile writer.</li>
1218 </ul>
1219 </div>
1220 <div class="section" id="id172">
1221 <h2>Other changes</h2>
1222 <ul class="simple">
1223 <li>The externally useless class <tt class="docutils literal">lxml.etree._BaseParser</tt> was removed
1224 from the module dict.</li>
1225 </ul>
1226 </div>
1227 </div>
1228 <div class="section" id="id173">
1229 <h1>3.1.0 (2013-02-10)</h1>
1230 <div class="section" id="id174">
1231 <h2>Features added</h2>
1232 <ul class="simple">
1233 <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
1234 considers 'safe'.  Patch by Francis Devereux.</li>
1235 </ul>
1236 </div>
1237 <div class="section" id="id175">
1238 <h2>Bugs fixed</h2>
1239 <ul class="simple">
1240 <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
1241 a copy of the attributes as a plain Python dict.</li>
1242 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/95">GH#95</a>: When used with namespace prefixes, the  <tt class="docutils literal"><span class="pre">el.find*()</span></tt> methods
1243 always used the first namespace mapping that was provided for each
1244 path expression instead of using the one that was actually passed
1245 in for the current run.</li>
1246 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1092521">LP#1092521</a>, <a class="reference external" href="https://github.com/lxml/lxml/issues/91">GH#91</a>: Fix undefined C symbol in Python runtimes compiled
1247 without threading support.  Patch by Ulrich Seidl.</li>
1248 </ul>
1249 </div>
1250 <div class="section" id="id176">
1251 <h2>Other changes</h2>
1252 </div>
1253 </div>
1254 <div class="section" id="beta1-2012-12-21">
1255 <h1>3.1beta1 (2012-12-21)</h1>
1256 <div class="section" id="id177">
1257 <h2>Features added</h2>
1258 <ul class="simple">
1259 <li>New build-time option <tt class="docutils literal"><span class="pre">--with-unicode-strings</span></tt> for Python 2 that
1260 makes the API always return Unicode strings for names and text
1261 instead of byte strings for plain ASCII content.</li>
1262 <li>New incremental XML file writing API <tt class="docutils literal">etree.xmlfile()</tt>.</li>
1263 <li>E factory in lxml.objectify is callable to simplify the creation of
1264 tags with non-identifier names without having to resort to getattr().</li>
1265 </ul>
1266 </div>
1267 <div class="section" id="id178">
1268 <h2>Bugs fixed</h2>
1269 <ul class="simple">
1270 <li>When starting from a non-namespaced element in lxml.objectify, searching
1271 for a child without explicitly specifying a namespace incorrectly found
1272 namespaced elements with the requested local name, instead of restricting
1273 the search to non-namespaced children.</li>
1274 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/85">GH#85</a>: Deprecation warnings were fixed for Python 3.x.</li>
1275 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/33">GH#33</a>: lxml.html.fromstring() failed to accept bytes input in Py3.</li>
1276 <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>
1277 </ul>
1278 </div>
1279 <div class="section" id="id179">
1280 <h2>Other changes</h2>
1281 <ul class="simple">
1282 <li>The externally useless class <tt class="docutils literal">_ObjectifyElementMakerCaller</tt> was
1283 removed from the module API of lxml.objectify.</li>
1284 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1075622">LP#1075622</a>: lxml.builder is faster for adding text to elements with
1285 many children.  Patch by Anders Hammarquist.</li>
1286 </ul>
1287 </div>
1288 </div>
1289 <div class="section" id="id180">
1290 <h1>3.0.2 (2012-12-14)</h1>
1291 <div class="section" id="id181">
1292 <h2>Features added</h2>
1293 </div>
1294 <div class="section" id="id182">
1295 <h2>Bugs fixed</h2>
1296 <ul class="simple">
1297 <li>Fix crash during interpreter shutdown by switching to Cython 0.17.3 for building.</li>
1298 </ul>
1299 </div>
1300 <div class="section" id="id183">
1301 <h2>Other changes</h2>
1302 </div>
1303 </div>
1304 <div class="section" id="id184">
1305 <h1>3.0.1 (2012-10-14)</h1>
1306 <div class="section" id="id185">
1307 <h2>Features added</h2>
1308 </div>
1309 <div class="section" id="id186">
1310 <h2>Bugs fixed</h2>
1311 <ul class="simple">
1312 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065924">LP#1065924</a>: Element proxies could disappear during garbage collection
1313 in PyPy without proper cleanup.</li>
1314 <li><a class="reference external" href="https://github.com/lxml/lxml/issues/71">GH#71</a>: Failure to work with libxml2 2.6.x.</li>
1315 <li><a class="reference external" href="https://bugs.launchpad.net/lxml/+bug/1065139">LP#1065139</a>: static MacOS-X build failed in Py3.</li>
1316 </ul>
1317 </div>
1318 <div class="section" id="id187">
1319 <h2>Other changes</h2>
1320 </div>
1321 </div>
1322 <div class="section" id="id188">
1323 <h1>3.0 (2012-10-08)</h1>
1324 <div class="section" id="id189">
1325 <h2>Features added</h2>
1326 </div>
1327 <div class="section" id="id190">
1328 <h2>Bugs fixed</h2>
1329 <ul class="simple">
1330 <li>End-of-file handling was incorrect in iterparse() when reading from
1331 a low-level C file stream and failed in libxml2 2.9.0 due to its
1332 improved consistency checks.</li>
1333 </ul>
1334 </div>
1335 <div class="section" id="id191">
1336 <h2>Other changes</h2>
1337 <ul class="simple">
1338 <li>The build no longer uses Cython by default unless the generated C files
1339 are missing.  To use Cython, pass the option &quot;--with-cython&quot;.  To ignore
1340 the fatal build error when Cython is required but not available (e.g. to
1341 run special setup.py commands that do not actually run a build), pass
1342 &quot;--without-cython&quot;.</li>
1343 </ul>
1344 </div>
1345 </div>
1346 <div class="section" id="beta1-2012-09-26">
1347 <h1>3.0beta1 (2012-09-26)</h1>
1348 <div class="section" id="id192">
1349 <h2>Features added</h2>
1350 <ul class="simple">
1351 <li>Python level access to (optional) libxml2 memory debugging features
1352 to simplify debugging of memory leaks etc.</li>
1353 </ul>
1354 </div>
1355 <div class="section" id="id193">
1356 <h2>Bugs fixed</h2>
1357 <ul class="simple">
1358 <li>Fix a memory leak in XPath by switching to Cython 0.17.1.</li>
1359 <li>Some tests were adapted to work with PyPy.</li>
1360 </ul>
1361 </div>
1362 <div class="section" id="id194">
1363 <h2>Other changes</h2>
1364 <ul class="simple">
1365 <li>The code was adapted to work with the upcoming libxml2 2.9.0 release.</li>
1366 </ul>
1367 </div>
1368 </div>
1369 <div class="section" id="alpha2-2012-08-23">
1370 <h1>3.0alpha2 (2012-08-23)</h1>
1371 <div class="section" id="id195">
1372 <h2>Features added</h2>
1373 <ul class="simple">
1374 <li>The <tt class="docutils literal">.iter()</tt> method of elements now accepts <tt class="docutils literal">tag</tt> arguments like
1375 <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt> to search for elements with a given local name in any
1376 namespace. With this addition, all combinations of wildcards now work
1377 as expected:
1378 <tt class="docutils literal">&quot;{ns}name&quot;</tt>, <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{*}name&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{ns}*&quot;</span></tt>, <tt class="docutils literal"><span class="pre">&quot;{}*&quot;</span></tt>
1379 and <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.  Note that <tt class="docutils literal">&quot;name&quot;</tt> is equivalent to <tt class="docutils literal"><span class="pre">&quot;{}name&quot;</span></tt>,
1380 but <tt class="docutils literal">&quot;*&quot;</tt> is <tt class="docutils literal"><span class="pre">&quot;{*}*&quot;</span></tt>.
1381 The same change applies to the <tt class="docutils literal">.getiterator()</tt>, <tt class="docutils literal">.itersiblings()</tt>,
1382 <tt class="docutils literal">.iterancestors()</tt>, <tt class="docutils literal">.iterdescendants()</tt>, <tt class="docutils literal">.iterchildren()</tt>
1383 and <tt class="docutils literal">.itertext()</tt> methods;the <tt class="docutils literal">strip_attributes()</tt>,
1384 <tt class="docutils literal">strip_elements()</tt> and <tt class="docutils literal">strip_tags()</tt> functions as well as the
1385 <tt class="docutils literal">iterparse()</tt> class.  Patch by Simon Sapin.</li>
1386 <li>C14N allows specifying the inclusive prefixes to be promoted
1387 to top-level during exclusive serialisation.</li>
1388 </ul>
1389 </div>
1390 <div class="section" id="id196">
1391 <h2>Bugs fixed</h2>
1392 <ul class="simple">
1393 <li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
1394 failed to read the entire string.</li>
1395 </ul>
1396 </div>
1397 <div class="section" id="id197">
1398 <h2>Other changes</h2>
1399 </div>
1400 </div>
1401 <div class="section" id="alpha1-2012-07-31">
1402 <h1>3.0alpha1 (2012-07-31)</h1>
1403 <div class="section" id="id198">
1404 <h2>Features added</h2>
1405 <ul class="simple">
1406 <li>Initial support for building in PyPy (through cpyext).</li>
1407 <li>DTD objects gained an API that allows read access to their
1408 declarations.</li>
1409 <li><tt class="docutils literal">xpathgrep.py</tt> gained support for parsing line-by-line (e.g.
1410 from grep output) and for surrounding the output with a new root
1411 tag.</li>
1412 <li><tt class="docutils literal"><span class="pre">E-factory</span></tt> in <tt class="docutils literal">lxml.builder</tt> accepts subtypes of known data
1413 types (such as string subtypes) when building elements around them.</li>
1414 <li>Tree iteration and <tt class="docutils literal">iterparse()</tt> with a selective <tt class="docutils literal">tag</tt>
1415 argument supports passing a set of tags.  Tree nodes will be
1416 returned by the iterators if they match any of the tags.</li>
1417 </ul>
1418 </div>
1419 <div class="section" id="id199">
1420 <h2>Bugs fixed</h2>
1421 <ul class="simple">
1422 <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
1423 internally, which makes them faster in many cases (especially when
1424 short circuiting after a single or couple of elements) and fixes
1425 some behavioural differences compared to <tt class="docutils literal">lxml.etree</tt>.  Note that
1426 this means that they no longer support arbitrary XPath expressions
1427 but only the subset that the <tt class="docutils literal">ElementPath</tt> language supports.
1428 The previous implementation was also redundant with the normal
1429 XPath support, which can be used as a replacement.</li>
1430 <li><tt class="docutils literal"><span class="pre">el.find('*')</span></tt> could accidentally return a comment or processing
1431 instruction that happened to be in the wrong spot.  (Same for the
1432 other <tt class="docutils literal"><span class="pre">.find*()</span></tt> methods.)</li>
1433 <li>The error logging is less intrusive and avoids a global setup where
1434 possible.</li>
1435 <li>Fixed undefined names in html5lib parser.</li>
1436 <li><tt class="docutils literal">xpathgrep.py</tt> did not work in Python 3.</li>
1437 <li><tt class="docutils literal">Element.attrib.update()</tt> did not accept an <tt class="docutils literal">attrib</tt> of
1438 another Element as parameter.</li>
1439 <li>For subtypes of <tt class="docutils literal">ElementBase</tt> that make the <tt class="docutils literal">.text</tt> or <tt class="docutils literal">.tail</tt>
1440 properties immutable (as in objectify, for example), inserting text
1441 when creating Elements through the E-Factory feature of the class
1442 constructor would fail with an exception, stating that the text
1443 cannot be modified.</li>
1444 </ul>
1445 </div>
1446 <div class="section" id="id200">
1447 <h2>Other changes</h2>
1448 <ul class="simple">
1449 <li>The code base was overhauled to properly use 'const' where the API
1450 of libxml2 and libxslt requests it.  This also has an impact on the
1451 public C-API of lxml itself, as defined in <tt class="docutils literal">etreepublic.pxd</tt>, as
1452 well as the provided declarations in the <tt class="docutils literal">lxml/includes/</tt> directory.
1453 Code that uses these declarations may have to be adapted.  On the
1454 plus side, this fixes several C compiler warnings, also for user
1455 code, thus making it easier to spot real problems again.</li>
1456 <li>The functionality of &quot;lxml.cssselect&quot; was moved into a separate PyPI
1457 package called &quot;cssselect&quot;.  To continue using it, you must install
1458 that package separately.  The &quot;lxml.cssselect&quot; module is still
1459 available and provides the same interface, provided the &quot;cssselect&quot;
1460 package can be imported at runtime.</li>
1461 <li>Element attributes passed in as an <tt class="docutils literal">attrib</tt> dict or as keyword
1462 arguments are now sorted by (namespaced) name before being created
1463 to make their order predictable for serialisation and iteration.
1464 Note that adding or deleting attributes afterwards does not take
1465 that order into account, i.e. setting a new attribute appends it
1466 after the existing ones.</li>
1467 <li>Several classes that are for internal use only were removed
1468 from the <tt class="docutils literal">lxml.etree</tt> module dict:
1469 <tt class="docutils literal">_InputDocument, _ResolverRegistry, _ResolverContext, _BaseContext,
1470 _ExsltRegExp, _IterparseContext, _TempStore, _ExceptionContext,
1471 __ContentOnlyElement, _AttribIterator, _NamespaceRegistry,
1472 _ClassNamespaceRegistry, _FunctionNamespaceRegistry,
1473 _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
1474 _FileReaderContext, _ParserContext, _PythonSaxParserTarget,
1475 _TargetParserContext, _ReadOnlyProxy, _ReadOnlyPIProxy,
1476 _ReadOnlyEntityProxy, _ReadOnlyElementProxy, _OpaqueNodeWrapper,
1477 _OpaqueDocumentWrapper, _ModifyContentOnlyProxy,
1478 _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
1479 _AppendOnlyElementProxy, _SaxParserContext, _FilelikeWriter,
1480 _ParserSchemaValidationContext, _XPathContext,
1481 _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam</tt></li>
1482 <li>Several internal classes can no longer be inherited from:
1483 <tt class="docutils literal">_InputDocument, _ResolverRegistry, _ExsltRegExp, _ElementUnicodeResult,
1484 _IterparseContext, _TempStore, _AttribIterator, _ClassNamespaceRegistry,
1485 _XPathFunctionNamespaceRegistry, _ParserDictionaryContext,
1486 _FileReaderContext, _PythonSaxParserTarget, _TargetParserContext,
1487 _ReadOnlyPIProxy, _ReadOnlyEntityProxy, _OpaqueDocumentWrapper,
1488 _ModifyContentOnlyPIProxy, _ModifyContentOnlyEntityProxy,
1489 _AppendOnlyElementProxy, _FilelikeWriter, _ParserSchemaValidationContext,
1490 _XPathContext, _XSLTResolverContext, _XSLTContext, _XSLTQuotedStringParam,
1491 _XSLTResultTree, _XSLTProcessingInstruction</tt></li>
1492 </ul>
1493 </div>
1494 </div>
1495 <div class="section" id="id201">
1496 <h1>2.3.6 (2012-09-28)</h1>
1497 <div class="section" id="id202">
1498 <h2>Features added</h2>
1499 </div>
1500 <div class="section" id="id203">
1501 <h2>Bugs fixed</h2>
1502 <ul class="simple">
1503 <li>Passing long Unicode strings into the <tt class="docutils literal">feed()</tt> parser interface
1504 failed to read the entire string.</li>
1505 </ul>
1506 </div>
1507 <div class="section" id="id204">
1508 <h2>Other changes</h2>
1509 </div>
1510 </div>
1511 <div class="section" id="id205">
1512 <h1>2.3.5 (2012-07-31)</h1>
1513 <div class="section" id="id206">
1514 <h2>Features added</h2>
1515 </div>
1516 <div class="section" id="id207">
1517 <h2>Bugs fixed</h2>
1518 <ul class="simple">
1519 <li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
1520 <li>Crash in sax/target parser when reporting empty doctype.</li>
1521 </ul>
1522 </div>
1523 <div class="section" id="id208">
1524 <h2>Other changes</h2>
1525 </div>
1526 </div>
1527 <div class="section" id="id209">
1528 <h1>2.3.4 (2012-03-26)</h1>
1529 <div class="section" id="id210">
1530 <h2>Features added</h2>
1531 </div>
1532 <div class="section" id="id211">
1533 <h2>Bugs fixed</h2>
1534 <ul class="simple">
1535 <li>Crash when building an nsmap (Element property) with empty
1536 namespace URIs.</li>
1537 <li>Crash due to race condition when errors (or user messages) occur
1538 during threaded XSLT processing.</li>
1539 <li>XSLT stylesheet compilation could ignore compilation errors.</li>
1540 </ul>
1541 </div>
1542 <div class="section" id="id212">
1543 <h2>Other changes</h2>
1544 </div>
1545 </div>
1546 <div class="section" id="id213">
1547 <h1>2.3.3 (2012-01-04)</h1>
1548 <div class="section" id="id214">
1549 <h2>Features added</h2>
1550 <ul class="simple">
1551 <li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
1552 <tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
1553 </ul>
1554 </div>
1555 <div class="section" id="id215">
1556 <h2>Bugs fixed</h2>
1557 <ul class="simple">
1558 <li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
1559 requesting start events.</li>
1560 <li>Fixed parsing of more selectors in cssselect.  Whitespace before
1561 pseudo-elements and pseudo-classes is significant as it is a
1562 descendant combinator.
1563 &quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
1564 Patch by Simon Sapin.</li>
1565 <li>lxml.html.diff no longer raises an exception when hitting
1566 'img' tags without 'src' attribute.</li>
1567 </ul>
1568 </div>
1569 <div class="section" id="id216">
1570 <h2>Other changes</h2>
1571 </div>
1572 </div>
1573 <div class="section" id="id217">
1574 <h1>2.3.2 (2011-11-11)</h1>
1575 <div class="section" id="id218">
1576 <h2>Features added</h2>
1577 <ul class="simple">
1578 <li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
1579 <tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
1580 declarations (and generally clean up the namespace declarations)
1581 after removing the type annotations.</li>
1582 <li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
1583 copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
1584 of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
1585 </ul>
1586 </div>
1587 <div class="section" id="id219">
1588 <h2>Bugs fixed</h2>
1589 <ul class="simple">
1590 <li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
1591 fix in lxml 2.3.1).  The previous change resulted in a serious
1592 performance regression for the XPath based evaluation of the
1593 translated expression.  Note that this breaks the usage of some of
1594 the generated XPath expressions as XSLT location paths that
1595 previously worked in 2.3.1.</li>
1596 <li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
1597 &quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously it was parsed as
1598 a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
1599 &quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
1600 </ul>
1601 </div>
1602 <div class="section" id="id220">
1603 <h2>Other changes</h2>
1604 </div>
1605 </div>
1606 <div class="section" id="id221">
1607 <h1>2.3.1 (2011-09-25)</h1>
1608 <div class="section" id="id222">
1609 <h2>Features added</h2>
1610 <ul class="simple">
1611 <li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
1612 tags and their content (i.e. their whole subtree).</li>
1613 <li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
1614 pseudo-attributes from the text content of processing instructions.</li>
1615 <li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
1616 used to compile external C code against lxml.etree.  This is
1617 specifically required for statically linked lxml builds when code
1618 needs to compile against the exact same header file versions as lxml
1619 itself.</li>
1620 <li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
1621 <tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
1622 closed after reading or not.  By default, the file will be closed,
1623 as the user is not expected to keep a reference to it.</li>
1624 </ul>
1625 </div>
1626 <div class="section" id="id223">
1627 <h2>Bugs fixed</h2>
1628 <ul class="simple">
1629 <li>HTML cleaning didn't remove 'data:' links.</li>
1630 <li>The html5lib parser integration now uses the 'official'
1631 implementation in html5lib itself, which makes it work with newer
1632 releases of the library.</li>
1633 <li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
1634 tag name when the corresponding start event inferred the same plain
1635 tag name to be in the default namespace.</li>
1636 <li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
1637 <tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
1638 reverts a change in lxml 2.3 where all files would be closed.  It is
1639 the users responsibility to properly close the file(-like) object,
1640 also in error cases.</li>
1641 <li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
1642 <li>In lxml.cssselect, use the xpath 'A//B' (short for
1643 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
1644 the css descendant selector ('A B').  This makes a few edge cases
1645 like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
1646 WebKit and Firefox, and makes more css expressions valid location
1647 paths (for use in xsl:template match).</li>
1648 <li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
1649 collected form values.</li>
1650 <li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
1651 field properly selects them and unselects them.</li>
1652 </ul>
1653 </div>
1654 <div class="section" id="id224">
1655 <h2>Other changes</h2>
1656 <ul class="simple">
1657 <li>Static builds can specify the download directory with the
1658 <tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
1659 </ul>
1660 </div>
1661 </div>
1662 <div class="section" id="id225">
1663 <h1>2.3 (2011-02-06)</h1>
1664 <div class="section" id="id226">
1665 <h2>Features added</h2>
1666 <ul class="simple">
1667 <li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
1668 meaning an empty namespace, as opposed to the parent namespace.</li>
1669 </ul>
1670 </div>
1671 <div class="section" id="id227">
1672 <h2>Bugs fixed</h2>
1673 <ul class="simple">
1674 <li>When finished reading from a file-like object, the parser
1675 immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
1676 <li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
1677 file.</li>
1678 <li>Work-around for libxml2 bug that can leave the HTML parser in a
1679 non-functional state after parsing a severely broken document (fixed
1680 in libxml2 2.7.8).</li>
1681 <li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
1682 </ul>
1683 </div>
1684 <div class="section" id="id228">
1685 <h2>Other changes</h2>
1686 <ul class="simple">
1687 <li>Some public functions in the Cython-level C-API have more explicit
1688 return types.</li>
1689 </ul>
1690 </div>
1691 </div>
1692 <div class="section" id="beta1-2010-09-06">
1693 <h1>2.3beta1 (2010-09-06)</h1>
1694 <div class="section" id="id229">
1695 <h2>Features added</h2>
1696 </div>
1697 <div class="section" id="id230">
1698 <h2>Bugs fixed</h2>
1699 <ul class="simple">
1700 <li>Crash in newer libxml2 versions when moving elements between
1701 documents that had attributes on replaced XInclude nodes.</li>
1702 <li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
1703 <tt class="docutils literal">base_url</tt> parameters.</li>
1704 <li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
1705 <li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
1706 use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
1707 </ul>
1708 </div>
1709 <div class="section" id="id231">
1710 <h2>Other changes</h2>
1711 </div>
1712 </div>
1713 <div class="section" id="alpha2-2010-07-24">
1714 <h1>2.3alpha2 (2010-07-24)</h1>
1715 <div class="section" id="id232">
1716 <h2>Features added</h2>
1717 </div>
1718 <div class="section" id="id233">
1719 <h2>Bugs fixed</h2>
1720 <ul class="simple">
1721 <li>Crash in XSLT when generating text-only result documents with a
1722 stylesheet created in a different thread.</li>
1723 </ul>
1724 </div>
1725 <div class="section" id="id234">
1726 <h2>Other changes</h2>
1727 <ul class="simple">
1728 <li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
1729 (following ElementTree 1.3).</li>
1730 </ul>
1731 </div>
1732 </div>
1733 <div class="section" id="alpha1-2010-06-19">
1734 <h1>2.3alpha1 (2010-06-19)</h1>
1735 <div class="section" id="id235">
1736 <h2>Features added</h2>
1737 <ul class="simple">
1738 <li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
1739 to pass a prefix-to-namespace mapping for the selector.</li>
1740 <li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
1741 globally registers a namespace prefix for a namespace that newly
1742 created Elements in that namespace will use automatically.  Follows
1743 ElementTree 1.3.</li>
1744 <li>Support 'unicode' string name as encoding parameter in
1745 <tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
1746 <li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
1747 <tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
1748 <li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
1749 match the upcoming ElementTree 1.3 that will ship in the standard
1750 library of Python 3.2/2.7.  This includes extended support for
1751 predicates as well as namespace prefixes (as known from XPath).</li>
1752 <li>During regular XPath evaluation, various ESXLT functions are
1753 available within their namespace when using libxslt 1.1.26 or later.</li>
1754 <li>Support passing a readily configured logger instance into
1755 <tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
1756 <li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
1757 override the DOCTYPE (internal subset) of the document.</li>
1758 <li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
1759 to append the resulting content directly to an output element.</li>
1760 <li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
1761 XSLT extension element itself.</li>
1762 <li>ISO-Schematron support based on the de-facto Schematron reference
1763 'skeleton implementation'.</li>
1764 <li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
1765 parameters.</li>
1766 <li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
1767 overhead.</li>
1768 <li>Setting the value of a namespaced attribute always uses a prefixed
1769 namespace instead of the default namespace even if both declare the
1770 same namespace URI.  This avoids serialisation problems when an
1771 attribute from a default namespace is set on an element from a
1772 different namespace.</li>
1773 <li>XSLT extension elements: support for XSLT context nodes other than
1774 elements: document root, comments, processing instructions.</li>
1775 <li>Support for strings (in addition to Elements) in node-sets returned
1776 by extension functions.</li>
1777 <li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
1778 the document on submit.</li>
1779 <li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
1780 <li>Namespace URIs get validated against RFC 3986 at the API level
1781 (required by the XML namespace specification).</li>
1782 <li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
1783 (compatible with ElementTree).</li>
1784 </ul>
1785 </div>
1786 <div class="section" id="id236">
1787 <h2>Bugs fixed</h2>
1788 <ul class="simple">
1789 <li>API is hardened against invalid proxy instances to prevent crashes
1790 due to incorrectly instantiated Element instances.</li>
1791 <li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
1792 <li>Export ElementTree compatible XML parser class as
1793 <tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
1794 <li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
1795 now use the hash value of the underlying Python value (string,
1796 number, etc.) to which they compare equal.</li>
1797 <li>Parsing broken fragments in lxml.html could fail if the fragment
1798 contained an orphaned closing '&lt;/div&gt;' tag.</li>
1799 <li>Using XSLT extension elements around the root of the output document
1800 crashed.</li>
1801 <li><tt class="docutils literal">lxml.cssselect</tt> did not distinguish between <tt class="docutils literal"><span class="pre">x[attr=&quot;val&quot;]</span></tt> and
1802 <tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
1803 attribute independent of the element.</li>
1804 <li>Rewriting multiple links inside of HTML text content could end up
1805 replacing unrelated content as replacements could impact the
1806 reported position of subsequent matches.  Modifications are now
1807 simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
1808 return links in reversed order if they appear inside the same text
1809 node.  Thus, replacements and link-internal modifications no longer
1810 change the position of links reported afterwards.</li>
1811 <li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
1812 not represent the complete raw value (including child tags etc.). It
1813 now serialises the complete content on read and replaces the
1814 complete content by a string on write.</li>
1815 <li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
1816 parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
1817 called after parsing, regardless of the outcome.</li>
1818 </ul>
1819 </div>
1820 <div class="section" id="id237">
1821 <h2>Other changes</h2>
1822 <ul class="simple">
1823 <li>Official support for Python 3.1.2 and later.</li>
1824 <li>Static MS Windows builds can now download their dependencies
1825 themselves.</li>
1826 <li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
1827 Element object.  It therefore no longer requires the garbage
1828 collector to clean up.</li>
1829 <li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
1830 </ul>
1831 </div>
1832 </div>
1833 <div class="section" id="id238">
1834 <h1>2.2.8 (2010-09-02)</h1>
1835 <div class="section" id="id239">
1836 <h2>Bugs fixed</h2>
1837 <ul class="simple">
1838 <li>Crash in newer libxml2 versions when moving elements between
1839 documents that had attributes on replaced XInclude nodes.</li>
1840 <li>Import fix for urljoin in Python 3.1+.</li>
1841 </ul>
1842 </div>
1843 </div>
1844 <div class="section" id="id240">
1845 <h1>2.2.7 (2010-07-24)</h1>
1846 <div class="section" id="id241">
1847 <h2>Bugs fixed</h2>
1848 <ul class="simple">
1849 <li>Crash in XSLT when generating text-only result documents with a
1850 stylesheet created in a different thread.</li>
1851 </ul>
1852 </div>
1853 </div>
1854 <div class="section" id="id242">
1855 <h1>2.2.6 (2010-03-02)</h1>
1856 <div class="section" id="id243">
1857 <h2>Bugs fixed</h2>
1858 <ul class="simple">
1859 <li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
1860 </ul>
1861 </div>
1862 </div>
1863 <div class="section" id="id244">
1864 <h1>2.2.5 (2010-02-28)</h1>
1865 <div class="section" id="id245">
1866 <h2>Features added</h2>
1867 <ul class="simple">
1868 <li>Support for running XSLT extension elements on the input root node
1869 (e.g. in a template matching on &quot;/&quot;).</li>
1870 </ul>
1871 </div>
1872 <div class="section" id="id246">
1873 <h2>Bugs fixed</h2>
1874 <ul class="simple">
1875 <li>Crash in XPath evaluation when reading smart strings from a document
1876 other than the original context document.</li>
1877 <li>Support recent versions of html5lib by not requiring its
1878 <tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
1879 <li>Manually instantiating the custom element classes in
1880 <tt class="docutils literal">lxml.objectify</tt> could crash.</li>
1881 <li>Invalid XML text characters were not rejected by the API when they
1882 appeared in unicode strings directly after non-ASCII characters.</li>
1883 <li>lxml.html.open_http_urllib() did not work in Python 3.</li>
1884 <li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
1885 <tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
1886 <li>Crash in XSLT extension elements when the XSLT context node is not
1887 an element.</li>
1888 </ul>
1889 </div>
1890 </div>
1891 <div class="section" id="id247">
1892 <h1>2.2.4 (2009-11-11)</h1>
1893 <div class="section" id="id248">
1894 <h2>Bugs fixed</h2>
1895 <ul class="simple">
1896 <li>Static build of libxml2/libxslt was broken.</li>
1897 </ul>
1898 </div>
1899 </div>
1900 <div class="section" id="id249">
1901 <h1>2.2.3 (2009-10-30)</h1>
1902 <div class="section" id="id250">
1903 <h2>Features added</h2>
1904 </div>
1905 <div class="section" id="id251">
1906 <h2>Bugs fixed</h2>
1907 <ul class="simple">
1908 <li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
1909 parser.</li>
1910 <li>Looking up and deleting attributes without a namespace could hit a
1911 namespaced attribute of the same name instead.</li>
1912 <li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
1913 ones) could leave a partially initialised element in the tree.</li>
1914 <li>Modifying trees that contain parsed entity references could result
1915 in an infinite loop.</li>
1916 <li>ObjectifiedElement.__setattr__ created an empty-string child element when the
1917 attribute value was rejected as a non-unicode/non-ascii string</li>
1918 <li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
1919 messages.</li>
1920 <li>Invalid syntax in CSS expressions could lead to an infinite loop in
1921 the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
1922 <li>CSS special character escapes were not properly handled in
1923 <tt class="docutils literal">lxml.cssselect</tt>.</li>
1924 <li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
1925 <li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
1926 attribute were not handled correctly.  The HTML standard dictates
1927 that their value is defined by their text content.  This is now
1928 supported by lxml.html.</li>
1929 <li>XPath raised a TypeError when finding CDATA sections.  This is now
1930 fully supported.</li>
1931 <li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
1932 <li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
1933 namespaces when annotation is disabled.</li>
1934 <li>Feed parser failed to honour the 'recover' option on parse errors.</li>
1935 <li>Diverting the error logging to Python's logging system was broken.</li>
1936 </ul>
1937 </div>
1938 <div class="section" id="id252">
1939 <h2>Other changes</h2>
1940 </div>
1941 </div>
1942 <div class="section" id="id253">
1943 <h1>2.2.2 (2009-06-21)</h1>
1944 <div class="section" id="id254">
1945 <h2>Features added</h2>
1946 <ul class="simple">
1947 <li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
1948 <tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
1949 from a subtree.</li>
1950 </ul>
1951 </div>
1952 <div class="section" id="id255">
1953 <h2>Bugs fixed</h2>
1954 <ul class="simple">
1955 <li>Namespace cleanup on subtree insertions could result in missing
1956 namespace declarations (and potentially crashes) if the element
1957 defining a namespace was deleted and the namespace was not used by
1958 the top element of the inserted subtree but only in deeper subtrees.</li>
1959 <li>Raising an exception from a parser target callback didn't always
1960 terminate the parser.</li>
1961 <li>Only {true, false, 1, 0} are accepted as the lexical representation for
1962 BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
1963 behaviour.</li>
1964 </ul>
1965 </div>
1966 <div class="section" id="id256">
1967 <h2>Other changes</h2>
1968 </div>
1969 </div>
1970 <div class="section" id="id257">
1971 <h1>2.2.1 (2009-06-02)</h1>
1972 <div class="section" id="id258">
1973 <h2>Features added</h2>
1974 <ul class="simple">
1975 <li>Injecting default attributes into a document during XML Schema
1976 validation (also at parse time).</li>
1977 <li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
1978 restrictions imposed by libxml2 2.7.</li>
1979 </ul>
1980 </div>
1981 <div class="section" id="id259">
1982 <h2>Bugs fixed</h2>
1983 <ul class="simple">
1984 <li>The script for statically building libxml2 and libxslt didn't work
1985 in Py3.</li>
1986 <li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
1987 for parsing (which could lead to a crash before release 2.6.24).</li>
1988 </ul>
1989 </div>
1990 <div class="section" id="id260">
1991 <h2>Other changes</h2>
1992 </div>
1993 </div>
1994 <div class="section" id="id261">
1995 <h1>2.2 (2009-03-21)</h1>
1996 <div class="section" id="id262">
1997 <h2>Features added</h2>
1998 <ul class="simple">
1999 <li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
2000 <tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
2001 on serialisation.</li>
2002 </ul>
2003 </div>
2004 <div class="section" id="id263">
2005 <h2>Bugs fixed</h2>
2006 <ul class="simple">
2007 <li>Crash when parsing an XML Schema with external imports from a
2008 filename.</li>
2009 </ul>
2010 </div>
2011 </div>
2012 <div class="section" id="beta4-2009-02-27">
2013 <h1>2.2beta4 (2009-02-27)</h1>
2014 <div class="section" id="id264">
2015 <h2>Features added</h2>
2016 <ul class="simple">
2017 <li>Support strings and instantiable Element classes as child arguments
2018 to the constructor of custom Element classes.</li>
2019 <li>GZip compression support for serialisation to files and file-like
2020 objects.</li>
2021 </ul>
2022 </div>
2023 <div class="section" id="id265">
2024 <h2>Bugs fixed</h2>
2025 <ul class="simple">
2026 <li>Deep-copying an ElementTree copied neither its sibling PIs and
2027 comments nor its internal/external DTD subsets.</li>
2028 <li>Soupparser failed on broken attributes without values.</li>
2029 <li>Crash in XSLT when overwriting an already defined attribute using
2030 <tt class="docutils literal">xsl:attribute</tt>.</li>
2031 <li>Crash bug in exception handling code under Python 3.  This was due
2032 to a problem in Cython, not lxml itself.</li>
2033 <li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
2034 <li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
2035 was evaluated incorrectly.</li>
2036 </ul>
2037 </div>
2038 <div class="section" id="id266">
2039 <h2>Other changes</h2>
2040 <ul class="simple">
2041 <li>Official support for Python 3.0.1.</li>
2042 <li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
2043 for Elements without text content.</li>
2044 </ul>
2045 </div>
2046 </div>
2047 <div class="section" id="beta3-2009-02-17">
2048 <h1>2.2beta3 (2009-02-17)</h1>
2049 <div class="section" id="id267">
2050 <h2>Features added</h2>
2051 <ul class="simple">
2052 <li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
2053 that require escaping.</li>
2054 </ul>
2055 </div>
2056 <div class="section" id="id268">
2057 <h2>Bugs fixed</h2>
2058 <ul class="simple">
2059 <li>Memory leak in XPath evaluators.</li>
2060 <li>Crash when parsing indented XML in one thread and merging it with
2061 other documents parsed in another thread.</li>
2062 <li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
2063 string failed.</li>
2064 <li>Fixes following changes in Python 3.0.1.</li>
2065 <li>Minor fixes for Python 3.</li>
2066 </ul>
2067 </div>
2068 <div class="section" id="id269">
2069 <h2>Other changes</h2>
2070 <ul class="simple">
2071 <li>The global error log (which is copied into the exception log) is now
2072 local to a thread, which fixes some race conditions.</li>
2073 <li>More robust error handling on serialisation.</li>
2074 </ul>
2075 </div>
2076 </div>
2077 <div class="section" id="beta2-2009-01-25">
2078 <h1>2.2beta2 (2009-01-25)</h1>
2079 <div class="section" id="id270">
2080 <h2>Bugs fixed</h2>
2081 <ul class="simple">
2082 <li>Potential memory leak on exception handling.  This was due to a
2083 problem in Cython, not lxml itself.</li>
2084 <li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
2085 <tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url(&quot;link&quot;)</span></tt> incorrectly
2086 (treating the quotation marks as part of the link).</li>
2087 <li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
2088 </ul>
2089 </div>
2090 </div>
2091 <div class="section" id="id271">
2092 <h1>2.1.5 (2009-01-06)</h1>
2093 <div class="section" id="id272">
2094 <h2>Bugs fixed</h2>
2095 <ul class="simple">
2096 <li>Potential memory leak on exception handling.  This was due to a
2097 problem in Cython, not lxml itself.</li>
2098 <li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
2099 </ul>
2100 </div>
2101 </div>
2102 <div class="section" id="beta1-2008-12-12">
2103 <h1>2.2beta1 (2008-12-12)</h1>
2104 <div class="section" id="id273">
2105 <h2>Features added</h2>
2106 <ul class="simple">
2107 <li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
2108 just HTML strings.</li>
2109 </ul>
2110 </div>
2111 <div class="section" id="id274">
2112 <h2>Bugs fixed</h2>
2113 <ul class="simple">
2114 <li>Crash when using an XPath evaluator in multiple threads.</li>
2115 <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>
2116 </ul>
2117 </div>
2118 <div class="section" id="id275">
2119 <h2>Other changes</h2>
2120 <ul class="simple">
2121 <li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
2122 </ul>
2123 </div>
2124 </div>
2125 <div class="section" id="id276">
2126 <h1>2.1.4 (2008-12-12)</h1>
2127 <div class="section" id="id277">
2128 <h2>Bugs fixed</h2>
2129 <ul class="simple">
2130 <li>Crash when using an XPath evaluator in multiple threads.</li>
2131 </ul>
2132 </div>
2133 </div>
2134 <div class="section" id="id278">
2135 <h1>2.0.11 (2008-12-12)</h1>
2136 <div class="section" id="id279">
2137 <h2>Bugs fixed</h2>
2138 <ul class="simple">
2139 <li>Crash when using an XPath evaluator in multiple threads.</li>
2140 </ul>
2141 </div>
2142 </div>
2143 <div class="section" id="alpha1-2008-11-23">
2144 <h1>2.2alpha1 (2008-11-23)</h1>
2145 <div class="section" id="id280">
2146 <h2>Features added</h2>
2147 <ul class="simple">
2148 <li>Support for XSLT result tree fragments in XPath/XSLT extension
2149 functions.</li>
2150 <li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
2151 <li>New options for exclusive C14N and C14N without comments.</li>
2152 <li>Instantiating a custom Element classes creates a new Element.</li>
2153 </ul>
2154 </div>
2155 <div class="section" id="id281">
2156 <h2>Bugs fixed</h2>
2157 <ul class="simple">
2158 <li>XSLT didn't inherit the parse options of the input document.</li>
2159 <li>0-bytes could slip through the API when used inside of Unicode
2160 strings.</li>
2161 <li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
2162 that end in a parenthesis, will be linked in their entirety (typical
2163 with Wikipedia links).</li>
2164 </ul>
2165 </div>
2166 <div class="section" id="id282">
2167 <h2>Other changes</h2>
2168 </div>
2169 </div>
2170 <div class="section" id="id283">
2171 <h1>2.1.3 (2008-11-17)</h1>
2172 <div class="section" id="id284">
2173 <h2>Features added</h2>
2174 </div>
2175 <div class="section" id="id285">
2176 <h2>Bugs fixed</h2>
2177 <ul class="simple">
2178 <li>Ref-count leaks when lxml enters a try-except statement while an
2179 outside exception lives in sys.exc_*(). This was due to a problem in
2180 Cython, not lxml itself.</li>
2181 <li>Parser Unicode decoding errors could get swallowed by other
2182 exceptions.</li>
2183 <li>Name/import errors in some Python modules.</li>
2184 <li>Internal DTD subsets that did not specify a system or public ID were
2185 not serialised and did not appear in the docinfo property of
2186 ElementTrees.</li>
2187 <li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
2188 <li>Test suite fixes for libxml2 2.7.</li>
2189 <li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
2190 <li>Resolver.resolve_file() was broken.</li>
2191 <li>Overriding the parser encoding didn't work for many encodings.</li>
2192 </ul>
2193 </div>
2194 <div class="section" id="id286">
2195 <h2>Other changes</h2>
2196 </div>
2197 </div>
2198 <div class="section" id="id287">
2199 <h1>2.0.10 (2008-11-17)</h1>
2200 <div class="section" id="id288">
2201 <h2>Bugs fixed</h2>
2202 <ul class="simple">
2203 <li>Ref-count leaks when lxml enters a try-except statement while an
2204 outside exception lives in sys.exc_*(). This was due to a problem in
2205 Cython, not lxml itself.</li>
2206 </ul>
2207 </div>
2208 </div>
2209 <div class="section" id="id289">
2210 <h1>2.1.2 (2008-09-05)</h1>
2211 <div class="section" id="id290">
2212 <h2>Features added</h2>
2213 <ul class="simple">
2214 <li>lxml.etree now tries to find the absolute path name of files when
2215 parsing from a file-like object.  This helps custom resolvers when
2216 resolving relative URLs, as lixbml2 can prepend them with the path
2217 of the source document.</li>
2218 </ul>
2219 </div>
2220 <div class="section" id="id291">
2221 <h2>Bugs fixed</h2>
2222 <ul class="simple">
2223 <li>Memory problem when passing documents between threads.</li>
2224 <li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
2225 exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
2226 </ul>
2227 </div>
2228 <div class="section" id="id292">
2229 <h2>Other changes</h2>
2230 </div>
2231 </div>
2232 <div class="section" id="id293">
2233 <h1>2.0.9 (2008-09-05)</h1>
2234 <div class="section" id="id294">
2235 <h2>Bugs fixed</h2>
2236 <ul class="simple">
2237 <li>Memory problem when passing documents between threads.</li>
2238 <li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
2239 exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
2240 </ul>
2241 </div>
2242 </div>
2243 <div class="section" id="id295">
2244 <h1>2.1.1 (2008-07-24)</h1>
2245 <div class="section" id="id296">
2246 <h2>Features added</h2>
2247 </div>
2248 <div class="section" id="id297">
2249 <h2>Bugs fixed</h2>
2250 <ul class="simple">
2251 <li>Crash when parsing XSLT stylesheets in a thread and using them in
2252 another.</li>
2253 <li>Encoding problem when including text with ElementInclude under
2254 Python 3.</li>
2255 </ul>
2256 </div>
2257 <div class="section" id="id298">
2258 <h2>Other changes</h2>
2259 </div>
2260 </div>
2261 <div class="section" id="id299">
2262 <h1>2.0.8 (2008-07-24)</h1>
2263 <div class="section" id="id300">
2264 <h2>Features added</h2>
2265 <ul class="simple">
2266 <li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
2267 with whitespace in URL attributes.</li>
2268 </ul>
2269 </div>
2270 <div class="section" id="id301">
2271 <h2>Bugs fixed</h2>
2272 <ul class="simple">
2273 <li>Crash when parsing XSLT stylesheets in a thread and using them in
2274 another.</li>
2275 <li>CSS selector parser dropped remaining expression after a function
2276 with parameters.</li>
2277 </ul>
2278 </div>
2279 <div class="section" id="id302">
2280 <h2>Other changes</h2>
2281 </div>
2282 </div>
2283 <div class="section" id="id303">
2284 <h1>2.1 (2008-07-09)</h1>
2285 <div class="section" id="id304">
2286 <h2>Features added</h2>
2287 <ul class="simple">
2288 <li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
2289 keyword option).</li>
2290 <li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
2291 with whitespace in URL attributes.</li>
2292 </ul>
2293 </div>
2294 <div class="section" id="id305">
2295 <h2>Bugs fixed</h2>
2296 <ul class="simple">
2297 <li>Custom resolvers were not used for XMLSchema includes/imports and
2298 XInclude processing.</li>
2299 <li>CSS selector parser dropped remaining expression after a function
2300 with parameters.</li>
2301 </ul>
2302 </div>
2303 <div class="section" id="id306">
2304 <h2>Other changes</h2>
2305 <ul class="simple">
2306 <li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
2307 <tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
2308 <li>Speed-up when running XSLTs on documents from other threads</li>
2309 </ul>
2310 </div>
2311 </div>
2312 <div class="section" id="id307">
2313 <h1>2.0.7 (2008-06-20)</h1>
2314 <div class="section" id="id308">
2315 <h2>Features added</h2>
2316 <ul class="simple">
2317 <li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
2318 </ul>
2319 </div>
2320 <div class="section" id="id309">
2321 <h2>Bugs fixed</h2>
2322 <ul class="simple">
2323 <li>Descending dot-separated classes in CSS selectors were not resolved
2324 correctly.</li>
2325 <li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
2326 <li>Potential threading problem in XInclude.</li>
2327 <li>Crash in Element class lookup classes when the __init__() method of
2328 the super class is not called from Python subclasses.</li>
2329 </ul>
2330 </div>
2331 <div class="section" id="id310">
2332 <h2>Other changes</h2>
2333 <ul class="simple">
2334 <li>Non-ASCII characters in attribute values are no longer escaped on
2335 serialisation.</li>
2336 </ul>
2337 </div>
2338 </div>
2339 <div class="section" id="beta3-2008-06-19">
2340 <h1>2.1beta3 (2008-06-19)</h1>
2341 <div class="section" id="id311">
2342 <h2>Features added</h2>
2343 <ul class="simple">
2344 <li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
2345 <li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
2346 <li>Support for parsing from file-like objects that return unicode
2347 strings.</li>
2348 <li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
2349 namespace declarations from a (sub)tree (experimental).</li>
2350 <li>XSLT results support the buffer protocol in Python 3.</li>
2351 <li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
2352 a parsable string will return either a UTF-8 encoded byte string, a
2353 unicode string or a tree, based on the type of the input.
2354 Previously, the result was always a byte string or a tree.</li>
2355 <li>Support for Python 2.6 and 3.0 beta.</li>
2356 <li>File name handling now uses a heuristic to convert between byte
2357 strings (usually filenames) and unicode strings (usually URLs).</li>
2358 <li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
2359 <li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
2360 on reading under Python 2.x.</li>
2361 <li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
2362 lxml.html (experimental).</li>
2363 <li>Most features in lxml.html work for XHTML namespaced tag names
2364 (experimental).</li>
2365 </ul>
2366 </div>
2367 <div class="section" id="id312">
2368 <h2>Bugs fixed</h2>
2369 <ul class="simple">
2370 <li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
2371 <li>Crash in Element class lookup classes when the __init__() method of
2372 the super class is not called from Python subclasses.</li>
2373 <li>A number of problems related to unicode/byte string conversion of
2374 filenames and error messages were fixed.</li>
2375 <li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
2376 compiler, which reportedly prevents build quirks and crashes on this
2377 platform.</li>
2378 <li>Windows build was broken.</li>
2379 <li>Rare crash when serialising to a file object with certain encodings.</li>
2380 </ul>
2381 </div>
2382 <div class="section" id="id313">
2383 <h2>Other changes</h2>
2384 <ul class="simple">
2385 <li>Non-ASCII characters in attribute values are no longer escaped on
2386 serialisation.</li>
2387 <li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
2388 namespaces, etc. will result in a ValueError instead of an
2389 AssertionError (just like the tag well-formedness check).</li>
2390 <li>Up to several times faster attribute access (i.e. tree traversal) in
2391 lxml.objectify.</li>
2392 </ul>
2393 </div>
2394 </div>
2395 <div class="section" id="id314">
2396 <h1>2.0.6 (2008-05-31)</h1>
2397 <div class="section" id="id315">
2398 <h2>Features added</h2>
2399 </div>
2400 <div class="section" id="id316">
2401 <h2>Bugs fixed</h2>
2402 <ul class="simple">
2403 <li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
2404 <li>Windows build was broken.</li>
2405 <li>Moving a subtree from a document created in one thread into a
2406 document of another thread could crash when the rest of the source
2407 document is deleted while the subtree is still in use.</li>
2408 <li>Rare crash when serialising to a file object with certain encodings.</li>
2409 </ul>
2410 </div>
2411 <div class="section" id="id317">
2412 <h2>Other changes</h2>
2413 <ul class="simple">
2414 <li>lxml should now build without problems on MacOS-X.</li>
2415 </ul>
2416 </div>
2417 </div>
2418 <div class="section" id="beta2-2008-05-02">
2419 <h1>2.1beta2 (2008-05-02)</h1>
2420 <div class="section" id="id318">
2421 <h2>Features added</h2>
2422 <ul class="simple">
2423 <li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
2424 <li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
2425 attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
2426 pre-configured for the lxml.html package.</li>
2427 </ul>
2428 </div>
2429 <div class="section" id="id319">
2430 <h2>Bugs fixed</h2>
2431 <ul class="simple">
2432 <li>Moving a subtree from a document created in one thread into a
2433 document of another thread could crash when the rest of the source
2434 document is deleted while the subtree is still in use.</li>
2435 <li>Passing an nsmap when creating an Element will no longer strip
2436 redundantly defined namespace URIs.  This prevented the definition
2437 of more than one prefix for a namespace on the same Element.</li>
2438 </ul>
2439 </div>
2440 <div class="section" id="id320">
2441 <h2>Other changes</h2>
2442 <ul class="simple">
2443 <li>If the default namespace is redundantly defined with a prefix on the
2444 same Element, the prefix will now be preferred for subelements and
2445 attributes.  This allows users to work around a problem in libxml2
2446 where attributes from the default namespace could serialise without
2447 a prefix even when they appear on an Element with a different
2448 namespace (i.e. they would end up in the wrong namespace).</li>
2449 </ul>
2450 </div>
2451 </div>
2452 <div class="section" id="id321">
2453 <h1>2.0.5 (2008-05-01)</h1>
2454 <div class="section" id="id322">
2455 <h2>Features added</h2>
2456 </div>
2457 <div class="section" id="id323">
2458 <h2>Bugs fixed</h2>
2459 <ul class="simple">
2460 <li>Resolving to a filename in custom resolvers didn't work.</li>
2461 <li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
2462 let some XSLT errors pass silently.</li>
2463 <li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
2464 </ul>
2465 </div>
2466 <div class="section" id="id324">
2467 <h2>Other changes</h2>
2468 </div>
2469 </div>
2470 <div class="section" id="beta1-2008-04-15">
2471 <h1>2.1beta1 (2008-04-15)</h1>
2472 <div class="section" id="id325">
2473 <h2>Features added</h2>
2474 <ul class="simple">
2475 <li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
2476 <li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
2477 sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
2478 sections by their text content.</li>
2479 <li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
2480 </ul>
2481 </div>
2482 <div class="section" id="id326">
2483 <h2>Bugs fixed</h2>
2484 <ul class="simple">
2485 <li>Resolving to a filename in custom resolvers didn't work.</li>
2486 <li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
2487 let some XSLT errors pass silently.</li>
2488 <li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
2489 <li>lxml.etree accepted non well-formed namespace prefix names.</li>
2490 </ul>
2491 </div>
2492 <div class="section" id="id327">
2493 <h2>Other changes</h2>
2494 <ul class="simple">
2495 <li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
2496 takes care of namespace cleanup when moving elements between
2497 different namespace contexts.</li>
2498 <li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
2499 parser or through lxml.html now end up in a new HTML document
2500 (doctype HTML 4.01 Transitional) instead of a generic XML document.
2501 This mostly impacts the serialisation and the availability of a DTD
2502 context.</li>
2503 </ul>
2504 </div>
2505 </div>
2506 <div class="section" id="id328">
2507 <h1>2.0.4 (2008-04-13)</h1>
2508 <div class="section" id="id329">
2509 <h2>Features added</h2>
2510 </div>
2511 <div class="section" id="id330">
2512 <h2>Bugs fixed</h2>
2513 <ul class="simple">
2514 <li>Hanging thread in conjunction with GTK threading.</li>
2515 <li>Crash bug in iterparse when moving elements into other documents.</li>
2516 <li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
2517 <li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
2518 </ul>
2519 </div>
2520 <div class="section" id="id331">
2521 <h2>Other changes</h2>
2522 </div>
2523 </div>
2524 <div class="section" id="alpha1-2008-03-27">
2525 <h1>2.1alpha1 (2008-03-27)</h1>
2526 <div class="section" id="id332">
2527 <h2>Features added</h2>
2528 <ul class="simple">
2529 <li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
2530 <li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
2531 returns a dict of access configuration options.</li>
2532 <li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
2533 <tt class="docutils literal">XSLTAccessControl</tt> class.</li>
2534 <li>Extension elements for XSLT (experimental!)</li>
2535 <li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
2536 an Element.</li>
2537 <li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
2538 </ul>
2539 </div>
2540 <div class="section" id="id333">
2541 <h2>Bugs fixed</h2>
2542 <ul class="simple">
2543 <li>Default encoding for plain text serialisation was different from
2544 that of XML serialisation (UTF-8 instead of ASCII).</li>
2545 </ul>
2546 </div>
2547 <div class="section" id="id334">
2548 <h2>Other changes</h2>
2549 <ul class="simple">
2550 <li>Minor API speed-ups.</li>
2551 <li>The benchmark suite now uses tail text in the trees, which makes the
2552 absolute numbers incomparable to previous results.</li>
2553 <li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
2554 used to enable syntax highlighting for the doctest examples.</li>
2555 </ul>
2556 <p>Most long-time deprecated functions and methods were removed:</p>
2557 <ul>
2558 <li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
2559 </li>
2560 <li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
2561 <tt class="docutils literal">etree.use_global_python_log()</tt></p>
2562 </li>
2563 <li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
2564 <tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
2565 </li>
2566 <li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
2567 </li>
2568 <li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
2569 </li>
2570 <li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
2571 <tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
2572 <p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
2573 yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
2574 instead.</p>
2575 </li>
2576 <li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
2577 <tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
2578 </li>
2579 <li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
2580 <tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
2581 </li>
2582 <li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
2583 <tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
2584 </li>
2585 <li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
2586 <tt class="docutils literal">objectify.set_default_parser()</tt></p>
2587 </li>
2588 </ul>
2589 </div>
2590 </div>
2591 <div class="section" id="id335">
2592 <h1>2.0.3 (2008-03-26)</h1>
2593 <div class="section" id="id336">
2594 <h2>Features added</h2>
2595 <ul class="simple">
2596 <li>soupparser.parse() allows passing keyword arguments on to
2597 BeautifulSoup.</li>
2598 <li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
2599 </ul>
2600 </div>
2601 <div class="section" id="id337">
2602 <h2>Bugs fixed</h2>
2603 <ul class="simple">
2604 <li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
2605 <tt class="docutils literal">&lt;br&gt;</tt>).</li>
2606 <li>Handle entity replacements correctly in target parser.</li>
2607 <li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
2608 <li>The BeautifulSoup parser (soupparser.py) did not replace entities,
2609 which made them turn up in text content.</li>
2610 <li>Attribute assignment of custom PyTypes in objectify could fail to
2611 correctly serialise the value to a string.</li>
2612 </ul>
2613 </div>
2614 <div class="section" id="id338">
2615 <h2>Other changes</h2>
2616 <ul class="simple">
2617 <li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
2618 <tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
2619 remains for compatibility with ElementTree's own ElementSoup module.</li>
2620 <li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
2621 build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
2622 <tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
2623 <li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
2624 override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
2625 compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
2626 option.</li>
2627 </ul>
2628 </div>
2629 </div>
2630 <div class="section" id="id339">
2631 <h1>2.0.2 (2008-02-22)</h1>
2632 <div class="section" id="id340">
2633 <h2>Features added</h2>
2634 <ul class="simple">
2635 <li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
2636 the filename of the file(-like) object.</li>
2637 </ul>
2638 </div>
2639 <div class="section" id="id341">
2640 <h2>Bugs fixed</h2>
2641 <ul class="simple">
2642 <li>The prefix for objectify's pytype namespace was missing from the set
2643 of default prefixes.</li>
2644 <li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
2645 <li>Error type names in RelaxNG were reported incorrectly.</li>
2646 <li>Slice deletion bug fixed in objectify.</li>
2647 </ul>
2648 </div>
2649 <div class="section" id="id342">
2650 <h2>Other changes</h2>
2651 <ul class="simple">
2652 <li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
2653 <li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
2654 (<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
2655 <li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
2656 <tt class="docutils literal">base_url</tt> argument.</li>
2657 </ul>
2658 </div>
2659 </div>
2660 <div class="section" id="id343">
2661 <h1>2.0.1 (2008-02-13)</h1>
2662 <div class="section" id="id344">
2663 <h2>Features added</h2>
2664 <ul class="simple">
2665 <li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
2666 <li>Loads of new docstrings reflect the signature of functions and
2667 methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
2668 </ul>
2669 </div>
2670 <div class="section" id="id345">
2671 <h2>Bugs fixed</h2>
2672 <ul class="simple">
2673 <li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
2674 <tt class="docutils literal">lxml.htmlbuilder</tt></li>
2675 <li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
2676 was an unnamed input field.  Now unnamed input fields are completely
2677 ignored.</li>
2678 <li>Setting an element slice in objectify could insert slice-overlapping
2679 elements at the wrong position.</li>
2680 </ul>
2681 </div>
2682 <div class="section" id="id346">
2683 <h2>Other changes</h2>
2684 <ul class="simple">
2685 <li>The generated API documentation was cleaned up and disburdened from
2686 non-public classes etc.</li>
2687 <li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
2688 <tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
2689 you want to use it, feel free to copy it over to your own source
2690 base.</li>
2691 <li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
2692 override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
2693 compiler options.</li>
2694 </ul>
2695 </div>
2696 </div>
2697 <div class="section" id="id347">
2698 <h1>2.0 (2008-02-01)</h1>
2699 <div class="section" id="id348">
2700 <h2>Features added</h2>
2701 <ul class="simple">
2702 <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
2703 serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
2704 deprecated.</li>
2705 <li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
2706 <li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
2707 parser with the usual objectify setup.</li>
2708 <li>Plain ASCII XPath string results are no longer forced into unicode
2709 objects as in 2.0beta1, but are returned as plain strings as before.</li>
2710 <li>All XPath string results are 'smart' objects that have a
2711 <tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
2712 <li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
2713 <li>More accurate exception messages in validator creation.</li>
2714 <li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
2715 <li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
2716 selection make their Element container accessible through a
2717 <tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
2718 unicode objects (even ASCII strings).</li>
2719 <li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
2720 copy if they were not created in that thread.</li>
2721 <li>Invalid entity names and character references will be rejected by
2722 the <tt class="docutils literal">Entity()</tt> factory.</li>
2723 <li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
2724 e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
2725 <li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
2726 in ET 1.3)</li>
2727 <li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
2728 <li>ElementTree compatible TreeBuilder class.</li>
2729 <li>Use default prefixes for some common XML namespaces.</li>
2730 <li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
2731 two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
2732 more general <tt class="docutils literal">allow_element(el)</tt>.</li>
2733 <li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
2734 etree and in objectify</li>
2735 <li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
2736 resolving a document as string data.</li>
2737 <li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
2738 <tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
2739 the special checking for one test.</li>
2740 <li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
2741 The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
2742 <tt class="docutils literal">error_log</tt>.</li>
2743 <li>The normal parsers and the feed parser interface are now separated
2744 and can be used concurrently on the same parser instance.</li>
2745 <li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
2746 ElementTree 1.3</li>
2747 <li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
2748 parsing with the HTML parser (note that this interface may be
2749 subject to change)</li>
2750 <li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
2751 of the parsed documents.</li>
2752 <li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
2753 <li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
2754 types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
2755 <li><tt class="docutils literal">ET.write()</tt>, <tt class="docutils literal">tostring()</tt> and <tt class="docutils literal">tounicode()</tt> now accept a keyword
2756 argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
2757 serialise as XML, HTML or plain text content.</li>
2758 <li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
2759 <tt class="docutils literal">findall()</tt></li>
2760 <li><tt class="docutils literal">itertext()</tt> method on Elements</li>
2761 <li>Setting a QName object as value of the .text property or as an attribute
2762 will resolve its prefix in the respective context</li>
2763 <li>ElementTree-like parser target interface as described in
2764 <a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
2765 <li>ElementTree-like feed parser interface on XMLParser and HTMLParser
2766 (<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
2767 <li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
2768 integration with objectify.  Provides extended type support based on
2769 registered PyTypes.</li>
2770 <li>XSLT objects now support deep copying</li>
2771 <li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
2772 subelement straight with text, tail and attributes.</li>
2773 <li>XPath extension functions can now access the current context node
2774 (<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
2775 (<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
2776 parameter</li>
2777 <li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
2778 <li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
2779 doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
2780 <tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
2781 <li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
2782 selectors.</li>
2783 <li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
2784 treatment.</li>
2785 <li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
2786 instance and no longer global.</li>
2787 <li>Schematron validation (incomplete in libxml2)</li>
2788 <li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
2789 conversion function to strings to support setting text values from arbitrary
2790 types.</li>
2791 <li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
2792 parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
2793 False to keep entities in the document.</li>
2794 <li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
2795 <li>Error specific messages in XPath parsing and evaluation
2796 NOTE: for evaluation errors, you will now get an XPathEvalError instead of
2797 an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
2798 <li>The regular expression functions in XPath now support passing a node-set
2799 instead of a string</li>
2800 <li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
2801 <li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
2802 </ul>
2803 </div>
2804 <div class="section" id="id349">
2805 <h2>Bugs fixed</h2>
2806 <ul class="simple">
2807 <li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
2808 <li>Some Python 2.4-isms prevented lxml from building/running under
2809 Python 2.3.</li>
2810 <li>XPath on ElementTrees could crash when selecting the virtual root
2811 node of the ElementTree.</li>
2812 <li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
2813 <li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
2814 <li>Minor bugs in XSLT error message formatting.</li>
2815 <li>Result document memory leak in target parser.</li>
2816 <li>Target parser failed to report comments.</li>
2817 <li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal">&lt;object&gt;</tt>
2818 tags weren't recognized.  (Note: plugin-specific link parameters
2819 still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
2820 standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
2821 <li>Using custom resolvers on XSLT stylesheets parsed from a string
2822 could request ill-formed URLs.</li>
2823 <li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal">&lt;tag <span class="pre">xmlns=&quot;...&quot;&gt;</span></tt> in your
2824 output, it will then be namespace-neutral (before the ellipsis was
2825 treated as a real namespace).</li>
2826 <li>AttributeError in feed parser on parse errors</li>
2827 <li>XML feed parser setup problem</li>
2828 <li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
2829 <li>lxml failed to serialise namespace declarations of elements other than the
2830 root node of a tree</li>
2831 <li>Race condition in XSLT where the resolver context leaked between concurrent
2832 XSLT calls</li>
2833 <li>lxml.etree did not check tag/attribute names</li>
2834 <li>The XML parser did not report undefined entities as error</li>
2835 <li>The text in exceptions raised by XML parsers, validators and XPath
2836 evaluators now reports the first error that occurred instead of the last</li>
2837 <li>Passing '' as XPath namespace prefix did not raise an error</li>
2838 <li>Thread safety in XPath evaluators</li>
2839 </ul>
2840 </div>
2841 <div class="section" id="id350">
2842 <h2>Other changes</h2>
2843 <ul class="simple">
2844 <li>Exceptions carry only the part of the error log that is related to
2845 the operation that caused the error.</li>
2846 <li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
2847 file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
2848 <li>The test suite now skips most doctests under Python 2.3.</li>
2849 <li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
2850 realclean</tt> instead)</li>
2851 <li>Minor performance tweaks for Element instantiation and subelement
2852 creation</li>
2853 <li>Various places in the XPath, XSLT and iteration APIs now require
2854 keyword-only arguments.</li>
2855 <li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
2856 match the order used in all other iteration methods.  The second
2857 argument ('preceding') is now a keyword-only argument.</li>
2858 <li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
2859 reverted to return an iterator as it did in lxml 1.x.  The ET API
2860 specification allows it to return either a sequence or an iterator,
2861 and it traditionally returned a sequence in ET and an iterator in
2862 lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
2863 method, which should be used in new code wherever possible.</li>
2864 <li>The 'pretty printed' serialisation of ElementTree objects now
2865 inserts newlines at the root level between processing instructions,
2866 comments and the root tag.</li>
2867 <li>A 'pretty printed' serialisation is now terminated with a newline.</li>
2868 <li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
2869 required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
2870 <li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
2871 <li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
2872 &quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
2873 Pyrex commonly handles package imports.  The main effect is that
2874 classes now know about their fully qualified class name, including
2875 the package name of their module.</li>
2876 <li>Keyword-only arguments in some API functions, especially in the
2877 parsers and serialisers.</li>
2878 <li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
2879 between HTML tags and XML tags based on the parser that was used to
2880 parse or create them.  HTML tags no longer reject any non-ASCII
2881 characters in tag names but only spaces and the special characters
2882 <tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
2883 <li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
2884 (which can crash on certain XPath errors)</li>
2885 <li>Type annotation in objectify now preserves the already annotated type by
2886 default to prevent losing type information that is already there.</li>
2887 <li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
2888 an iterator (ElementTree 1.3 compatible behaviour)</li>
2889 <li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
2890 <li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
2891 original name is still available as alias</li>
2892 <li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
2893 generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
2894 <li>Major refactoring in XPath/XSLT extension function code</li>
2895 <li>Network access in parsers disabled by default</li>
2896 </ul>
2897 </div>
2898 </div>
2899 <div class="section" id="id351">
2900 <h1>1.3.6 (2007-10-29)</h1>
2901 <div class="section" id="id352">
2902 <h2>Bugs fixed</h2>
2903 <ul class="simple">
2904 <li>Backported decref crash fix from 2.0</li>
2905 <li>Well hidden free-while-in-use crash bug in ObjectPath</li>
2906 </ul>
2907 </div>
2908 <div class="section" id="id353">
2909 <h2>Other changes</h2>
2910 <ul class="simple">
2911 <li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
2912 methods.  While this makes them take a lot longer to run, it also
2913 makes it easier to link a specific test to garbage collection
2914 problems that would otherwise appear in later tests.</li>
2915 </ul>
2916 </div>
2917 </div>
2918 <div class="section" id="id354">
2919 <h1>1.3.5 (2007-10-22)</h1>
2920 <div class="section" id="id355">
2921 <h2>Features added</h2>
2922 </div>
2923 <div class="section" id="id356">
2924 <h2>Bugs fixed</h2>
2925 <ul class="simple">
2926 <li>lxml.etree could crash when adding more than 10000 namespaces to a
2927 document</li>
2928 <li>lxml failed to serialise namespace declarations of elements other
2929 than the root node of a tree</li>
2930 </ul>
2931 </div>
2932 </div>
2933 <div class="section" id="id357">
2934 <h1>1.3.4 (2007-08-30)</h1>
2935 <div class="section" id="id358">
2936 <h2>Features added</h2>
2937 <ul class="simple">
2938 <li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
2939 <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
2940 creates.</li>
2941 <li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
2942 and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
2943 subset of the document respectively.</li>
2944 <li>Serialising an ElementTree now includes any internal DTD subsets that are
2945 part of the document, as well as comments and PIs that are siblings of the
2946 root node.</li>
2947 </ul>
2948 </div>
2949 <div class="section" id="id359">
2950 <h2>Bugs fixed</h2>
2951 <ul class="simple">
2952 <li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
2953 </ul>
2954 </div>
2955 <div class="section" id="id360">
2956 <h2>Other changes</h2>
2957 <ul class="simple">
2958 <li>lxml now raises a TagNameWarning about tag names containing ':' instead of
2959 an Error as 1.3.3 did.  The reason is that a number of projects currently
2960 misuse the previous lack of tag name validation to generate namespace
2961 prefixes without declaring namespaces.  Apart from the danger of generating
2962 broken XML this way, it also breaks most of the namespace-aware tools in
2963 XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
2964 support this bug with a Warning, while lxml 2.0 will be strict about
2965 well-formed tag names (not only regarding ':').</li>
2966 <li>Serialising an Element no longer includes its comment and PI siblings (only
2967 ElementTree serialisation includes them).</li>
2968 </ul>
2969 </div>
2970 </div>
2971 <div class="section" id="id361">
2972 <h1>1.3.3 (2007-07-26)</h1>
2973 <div class="section" id="id362">
2974 <h2>Features added</h2>
2975 <ul class="simple">
2976 <li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
2977 instructions and comments while parsing XML</li>
2978 <li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
2979 <li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
2980 the parser you pass.</li>
2981 <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>
2982 </ul>
2983 </div>
2984 <div class="section" id="id363">
2985 <h2>Bugs fixed</h2>
2986 <ul class="simple">
2987 <li>Parsing from Python Unicode strings failed on some platforms</li>
2988 <li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
2989 <li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
2990 <tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
2991 </ul>
2992 </div>
2993 </div>
2994 <div class="section" id="id364">
2995 <h1>1.3.2 (2007-07-03)</h1>
2996 <div class="section" id="id365">
2997 <h2>Features added</h2>
2998 </div>
2999 <div class="section" id="id366">
3000 <h2>Bugs fixed</h2>
3001 <ul class="simple">
3002 <li>&quot;deallocating None&quot; crash bug</li>
3003 </ul>
3004 </div>
3005 </div>
3006 <div class="section" id="id367">
3007 <h1>1.3.1 (2007-07-02)</h1>
3008 <div class="section" id="id368">
3009 <h2>Features added</h2>
3010 <ul class="simple">
3011 <li>objectify.DataElement now supports setting values from existing data
3012 elements (not just plain Python types) and reuses defined namespaces etc.</li>
3013 <li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
3014 </ul>
3015 </div>
3016 <div class="section" id="id369">
3017 <h2>Bugs fixed</h2>
3018 <ul class="simple">
3019 <li>Better way to prevent crashes in Element proxy cleanup code</li>
3020 <li>objectify.DataElement didn't set up None value correctly</li>
3021 <li>objectify.DataElement didn't check the value against the provided type hints</li>
3022 <li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
3023 </ul>
3024 </div>
3025 </div>
3026 <div class="section" id="id370">
3027 <h1>1.3 (2007-06-24)</h1>
3028 <div class="section" id="id371">
3029 <h2>Features added</h2>
3030 <ul class="simple">
3031 <li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
3032 scheme that can access the entire tree in read-only mode to help determining
3033 a suitable Element class</li>
3034 <li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
3035 <li><tt class="docutils literal">parse()</tt> function in <tt class="docutils literal">objectify</tt>, corresponding to <tt class="docutils literal">XML()</tt> etc.</li>
3036 <li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
3037 adding processing instructions and comments around the root node</li>
3038 <li><tt class="docutils literal">Element.attrib</tt> was missing <tt class="docutils literal">clear()</tt> and <tt class="docutils literal">pop()</tt> methods</li>
3039 <li>Extended type annotation in objectify: cleaner annotation namespace setup
3040 plus new <tt class="docutils literal">deannotate()</tt> function</li>
3041 <li>Support for custom Element class instantiation in lxml.sax: passing a
3042 <tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
3043 lookup context of that function</li>
3044 <li>'.' represents empty ObjectPath (identity)</li>
3045 <li><tt class="docutils literal">Element.values()</tt> to accompany the existing <tt class="docutils literal">.keys()</tt> and <tt class="docutils literal">.items()</tt></li>
3046 <li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
3047 keys/values/items for a libxml2 node</li>
3048 <li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
3049 <li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
3050 <li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
3051 <li>Support for pickling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
3052 <li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
3053 <li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
3054 a better handling of namespaces when moving elements between documents.</li>
3055 </ul>
3056 </div>
3057 <div class="section" id="id372">
3058 <h2>Bugs fixed</h2>
3059 <ul class="simple">
3060 <li>Removing Elements from a tree could make them lose their namespace
3061 declarations</li>
3062 <li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
3063 <li>Replacing the children slice of an Element would cut off the tails of the
3064 original children</li>
3065 <li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
3066 <tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
3067 <li>API functions now check incoming strings for XML conformity.  Zero bytes or
3068 low ASCII characters are no longer accepted (AssertionError).</li>
3069 <li>XSLT parsing failed to pass resolver context on to imported documents</li>
3070 <li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
3071 <li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
3072 <li>More ET compatible behaviour when writing out XML declarations or not</li>
3073 <li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
3074 <li>Documents lost their top-level PIs and comments on serialisation</li>
3075 <li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
3076 PIs are copied.</li>
3077 <li>Possible memory leaks in namespace handling when moving elements between
3078 documents</li>
3079 </ul>
3080 </div>
3081 <div class="section" id="id373">
3082 <h2>Other changes</h2>
3083 <ul class="simple">
3084 <li>major restructuring in the documentation</li>
3085 </ul>
3086 </div>
3087 </div>
3088 <div class="section" id="id374">
3089 <h1>1.2.1 (2007-02-27)</h1>
3090 <div class="section" id="id375">
3091 <h2>Bugs fixed</h2>
3092 <ul class="simple">
3093 <li>Build fixes for MS compiler</li>
3094 <li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
3095 <li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
3096 to access</li>
3097 <li>The pattern for attribute names in ObjectPath was too restrictive</li>
3098 </ul>
3099 </div>
3100 </div>
3101 <div class="section" id="id376">
3102 <h1>1.2 (2007-02-20)</h1>
3103 <div class="section" id="id377">
3104 <h2>Features added</h2>
3105 <ul class="simple">
3106 <li>Rich comparison of QName objects</li>
3107 <li>Support for regular expressions in benchmark selection</li>
3108 <li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
3109 <li>ElementInclude Python module for ElementTree compatible XInclude processing
3110 that honours custom resolvers registered with the source document</li>
3111 <li>ElementTree.parser property holds the parser used to parse the document</li>
3112 <li>setup.py has been refactored for greater readability and flexibility</li>
3113 <li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
3114 runtime search paths has been renamed to --auto-rpath. This makes it
3115 possible to pass an --rpath directly to distutils; previously this was being
3116 shadowed.</li>
3117 </ul>
3118 </div>
3119 <div class="section" id="id378">
3120 <h2>Bugs fixed</h2>
3121 <ul class="simple">
3122 <li>Element instantiation now uses locks to prevent race conditions with threads</li>
3123 <li>ElementTree.write() did not raise an exception when the file was not writable</li>
3124 <li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
3125 support in these environments</li>
3126 <li>Element.find*() did not accept QName objects as path</li>
3127 </ul>
3128 </div>
3129 <div class="section" id="id379">
3130 <h2>Other changes</h2>
3131 <ul class="simple">
3132 <li>code cleanup: redundant _NodeBase super class merged into _Element class
3133 Note: although the impact should be zero in most cases, this change breaks
3134 the compatibility of the public C-API</li>
3135 </ul>
3136 </div>
3137 </div>
3138 <div class="section" id="id380">
3139 <h1>1.1.2 (2006-10-30)</h1>
3140 <div class="section" id="id381">
3141 <h2>Features added</h2>
3142 <ul class="simple">
3143 <li>Data elements in objectify support repr(), which is now used by dump()</li>
3144 <li>Source distribution now ships with a patched Pyrex</li>
3145 <li>New C-API function makeElement() to create new elements with text,
3146 tail, attributes and namespaces</li>
3147 <li>Reuse original parser flags for XInclude</li>
3148 <li>Simplified support for handling XSLT processing instructions</li>
3149 </ul>
3150 </div>
3151 <div class="section" id="id382">
3152 <h2>Bugs fixed</h2>
3153 <ul class="simple">
3154 <li>Parser resources were not freed before the next parser run</li>
3155 <li>Open files and XML strings returned by Python resolvers were not
3156 closed/freed</li>
3157 <li>Crash in the IDDict returned by XMLDTDID</li>
3158 <li>Copying Comments and ProcessingInstructions failed</li>
3159 <li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
3160 <li>Memory leak when garbage collecting tailed root elements</li>
3161 <li>HTML script/style content was not propagated to .text</li>
3162 <li>Show text xincluded between text nodes correctly in .text and .tail</li>
3163 <li>'integer * objectify.StringElement' operation was not supported</li>
3164 </ul>
3165 </div>
3166 </div>
3167 <div class="section" id="id383">
3168 <h1>1.1.1 (2006-09-21)</h1>
3169 <div class="section" id="id384">
3170 <h2>Features added</h2>
3171 <ul class="simple">
3172 <li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
3173 <li>countchildren() method on objectify.ObjectifiedElement</li>
3174 <li>Support custom elements for tree nodes in lxml.objectify</li>
3175 </ul>
3176 </div>
3177 <div class="section" id="id385">
3178 <h2>Bugs fixed</h2>
3179 <ul class="simple">
3180 <li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
3181 <li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
3182 <li>Factories objectify.Element() and objectify.DataElement() were missing
3183 <tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
3184 <li>Changing the default parser in lxml.objectify did not update the factories
3185 Element() and DataElement()</li>
3186 <li>Let lxml.objectify.Element() always generate tree elements (not data
3187 elements)</li>
3188 <li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
3189 </ul>
3190 </div>
3191 </div>
3192 <div class="section" id="id386">
3193 <h1>1.1 (2006-09-13)</h1>
3194 <div class="section" id="id387">
3195 <h2>Features added</h2>
3196 <ul class="simple">
3197 <li>Comments and processing instructions return '&lt;!-- comment --&gt;' and
3198 '&lt;?pi-target content?&gt;' for repr()</li>
3199 <li>Parsers are now the preferred (and default) place where element class lookup
3200 schemes should be registered.  Namespace lookup is no longer supported by
3201 default.</li>
3202 <li>Support for Python 2.5 beta</li>
3203 <li>Unlock the GIL for deep copying documents and for XPath()</li>
3204 <li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
3205 <li>Support for parser options in iterparse()</li>
3206 <li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
3207 tuples</li>
3208 <li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
3209 exception</li>
3210 <li>XML-Object API on top of lxml (lxml.objectify)</li>
3211 <li>Customizable Element class lookup:<ul>
3212 <li>different pre-implemented lookup mechanisms</li>
3213 <li>support for externally provided lookup functions</li>
3214 </ul>
3215 </li>
3216 <li>Support for processing instructions (ET-like, not compatible)</li>
3217 <li>Public C-level API for independent extension modules</li>
3218 <li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
3219 <li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
3220 documentation for differences)</li>
3221 <li>Element.nsmap property returns a mapping of all namespace prefixes known at
3222 the Element to their namespace URI</li>
3223 <li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
3224 <li>Threading support in parsers and serializers:<ul>
3225 <li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
3226 <li>File operations (on file names) free the GIL</li>
3227 <li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
3228 <li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
3229 </ul>
3230 </li>
3231 <li>Element iteration over XPath axes:<ul>
3232 <li>Element.iterdescendants() iterates over the descendants of an element</li>
3233 <li>Element.iterancestors() iterates over the ancestors of an element (from
3234 parent to parent)</li>
3235 <li>Element.itersiblings() iterates over either the following or preceding
3236 siblings of an element</li>
3237 <li>Element.iterchildren() iterates over the children of an element in either
3238 direction</li>
3239 <li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
3240 generated elements</li>
3241 </ul>
3242 </li>
3243 <li>Element.getnext() and Element.getprevious() return the direct siblings of an
3244 element</li>
3245 </ul>
3246 </div>
3247 <div class="section" id="id388">
3248 <h2>Bugs fixed</h2>
3249 <ul class="simple">
3250 <li>filenames with local 8-bit encoding were not supported</li>
3251 <li>1.1beta did not compile under Python 2.3</li>
3252 <li>ignore unknown 'pyval' attribute values in objectify</li>
3253 <li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
3254 <li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
3255 <li>XPathSyntaxError now inherits from XPathError</li>
3256 <li>Threading race conditions in RelaxNG and XMLSchema</li>
3257 <li>Crash when mixing elements from XSLT results into other trees, concurrent
3258 XSLT is only allowed when the stylesheet was parsed in the main thread</li>
3259 <li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
3260 differences in the regular expression syntax)</li>
3261 <li>Setting element.text to '' returned None on request, not the empty string</li>
3262 <li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
3263 <li>Creating documents no longer copies the parser for later URL resolving.  For
3264 performance reasons, only a reference is kept.  Resolver updates on the
3265 parser will now be reflected by documents that were parsed before the
3266 change.  Although this should rarely become visible, it is a behavioral
3267 change from 1.0.</li>
3268 </ul>
3269 </div>
3270 </div>
3271 <div class="section" id="id389">
3272 <h1>1.0.4 (2006-09-09)</h1>
3273 <div class="section" id="id390">
3274 <h2>Features added</h2>
3275 <ul class="simple">
3276 <li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
3277 </ul>
3278 </div>
3279 <div class="section" id="id391">
3280 <h2>Bugs fixed</h2>
3281 <ul class="simple">
3282 <li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
3283 </ul>
3284 </div>
3285 </div>
3286 <div class="section" id="id392">
3287 <h1>1.0.3 (2006-08-08)</h1>
3288 <div class="section" id="id393">
3289 <h2>Features added</h2>
3290 <ul class="simple">
3291 <li>Element.replace(old, new) method to replace a subelement by another one</li>
3292 </ul>
3293 </div>
3294 <div class="section" id="id394">
3295 <h2>Bugs fixed</h2>
3296 <ul class="simple">
3297 <li>Crash when mixing elements from XSLT results into other trees</li>
3298 <li>Copying/deepcopying did not work for ElementTree objects</li>
3299 <li>Setting an attribute to a non-string value did not raise an exception</li>
3300 <li>Element.remove() deleted the tail text from the removed Element</li>
3301 </ul>
3302 </div>
3303 </div>
3304 <div class="section" id="id395">
3305 <h1>1.0.2 (2006-06-27)</h1>
3306 <div class="section" id="id396">
3307 <h2>Features added</h2>
3308 <ul class="simple">
3309 <li>Support for setting a custom default Element class as opposed to namespace
3310 specific classes (which still override the default class)</li>
3311 </ul>
3312 </div>
3313 <div class="section" id="id397">
3314 <h2>Bugs fixed</h2>
3315 <ul class="simple">
3316 <li>Rare exceptions in Python list functions were not handled</li>
3317 <li>Parsing accepted unicode strings with XML encoding declaration in certain
3318 cases</li>
3319 <li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
3320 <li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
3321 <li>XSLT and parser exception messages include the error line number</li>
3322 </ul>
3323 </div>
3324 </div>
3325 <div class="section" id="id398">
3326 <h1>1.0.1 (2006-06-09)</h1>
3327 <div class="section" id="id399">
3328 <h2>Features added</h2>
3329 <ul class="simple">
3330 <li>Repeated calls to Element.attrib now efficiently return the same instance</li>
3331 </ul>
3332 </div>
3333 <div class="section" id="id400">
3334 <h2>Bugs fixed</h2>
3335 <ul class="simple">
3336 <li>Document deallocation could crash in certain garbage collection scenarios</li>
3337 <li>Extension function calls in XSLT variable declarations could break the
3338 stylesheet and crash on repeated calls</li>
3339 <li>Deep copying Elements could lose namespaces declared in parents</li>
3340 <li>Deep copying Elements did not copy tail</li>
3341 <li>Parsing file(-like) objects failed to load external entities</li>
3342 <li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
3343 <li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
3344 <li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
3345 <li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
3346 </ul>
3347 </div>
3348 </div>
3349 <div class="section" id="id401">
3350 <h1>1.0 (2006-06-01)</h1>
3351 <div class="section" id="id402">
3352 <h2>Features added</h2>
3353 <ul class="simple">
3354 <li>Element.getiterator() and the findall() methods support finding arbitrary
3355 elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
3356 <li>Another speedup in tree iteration code</li>
3357 <li>General speedup of Python Element object creation and deallocation</li>
3358 <li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
3359 <li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
3360 <li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
3361 document that contains the element.</li>
3362 <li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
3363 find the element in the tree structure</li>
3364 <li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
3365 <li>Comment texts can be changed through the API</li>
3366 <li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
3367 <li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
3368 <li>ElementTree.write() no longer serializes in memory (reduced memory
3369 footprint)</li>
3370 <li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
3371 <li>Support for writing the XML representation of Elements and ElementTrees to
3372 Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
3373 <li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
3374 <li>Parsing a unicode string no longer copies the string (reduced memory
3375 footprint)</li>
3376 <li>Parsing file-like objects reads chunks rather than the whole file (reduced
3377 memory footprint)</li>
3378 <li>Parsing StringIO objects from the start avoids copying the string (reduced
3379 memory footprint)</li>
3380 <li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
3381 information, original encoding and XML version as seen by the parser</li>
3382 <li>etree module can be compiled without libxslt by commenting out the line
3383 <tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
3384 <li>Better error messages in parser exceptions</li>
3385 <li>Error reporting also works in XSLT</li>
3386 <li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
3387 resolvers are registered at parser level</li>
3388 <li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
3389 enabled by default, can be switched off with 'regexp=False' keyword argument</li>
3390 <li>Support for exslt extensions (libexslt) and libxslt extra functions
3391 (node-set, document, write, output)</li>
3392 <li>Substantial speedup in XPath.evaluate()</li>
3393 <li>HTMLParser for parsing (broken) HTML</li>
3394 <li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
3395 implementation of libxml2 (as opposed to ET compatible XMLID)</li>
3396 </ul>
3397 </div>
3398 <div class="section" id="id403">
3399 <h2>Bugs fixed</h2>
3400 <ul class="simple">
3401 <li>Memory leak in Element.__setitem__</li>
3402 <li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
3403 <li>Memory leak in XPath extension functions</li>
3404 <li>Memory leak in unicode related setup code</li>
3405 <li>Element now raises ValueError on empty tag names</li>
3406 <li>Namespace fixing after moving elements between documents could fail if the
3407 source document was freed too early</li>
3408 <li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
3409 didn't reset the namespace</li>
3410 <li>Unknown constants from newer libxml2 versions could raise exceptions in the
3411 error handlers</li>
3412 <li>lxml.etree compiles much faster</li>
3413 <li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
3414 in certain cases</li>
3415 <li>Document reference in ElementTree objects was not updated when the root
3416 element was moved to a different document</li>
3417 <li>Running absolute XPath expressions on an Element now evaluates against the
3418 root tree</li>
3419 <li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
3420 <li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
3421 objects</li>
3422 <li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
3423 <tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
3424 <li>Memory leak when using iconv encoders in tostring/write</li>
3425 <li>Deep copying Elements and ElementTrees maintains the document information</li>
3426 <li>Serialization functions raise LookupError for unknown encodings</li>
3427 <li>Memory deallocation crash resulting from deep copying elements</li>
3428 <li>Some ElementTree methods could crash if the root node was not initialized
3429 (neither file nor element passed to the constructor)</li>
3430 <li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
3431 dictionary</li>
3432 <li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
3433 <li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
3434 <li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
3435 ElementTree root node as reference point</li>
3436 <li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
3437 </ul>
3438 </div>
3439 </div>
3440 <div class="section" id="id404">
3441 <h1>0.9.2 (2006-05-10)</h1>
3442 <div class="section" id="id405">
3443 <h2>Features added</h2>
3444 <ul class="simple">
3445 <li>Speedup for Element.makeelement(): the new element reuses the original
3446 libxml2 document instead of creating a new empty one</li>
3447 <li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
3448 <li>ElementTree compatible QName class</li>
3449 <li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
3450 </ul>
3451 </div>
3452 <div class="section" id="id406">
3453 <h2>Bugs fixed</h2>
3454 <ul class="simple">
3455 <li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
3456 <li>Memory leak if write_c14n fails to write the file after conversion</li>
3457 <li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
3458 <li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
3459 </ul>
3460 </div>
3461 </div>
3462 <div class="section" id="id407">
3463 <h1>0.9.1 (2006-03-30)</h1>
3464 <div class="section" id="id408">
3465 <h2>Features added</h2>
3466 <ul class="simple">
3467 <li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
3468 SaxError on mismatch</li>
3469 <li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
3470 (startElement, endElement) and defaults to empty attributes (keyword
3471 argument)</li>
3472 <li>Speedup for repeatedly accessing element tag names</li>
3473 <li>Minor API performance improvements</li>
3474 </ul>
3475 </div>
3476 <div class="section" id="id409">
3477 <h2>Bugs fixed</h2>
3478 <ul class="simple">
3479 <li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
3480 <li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
3481 <li>lxml.tests package will no longer be installed (is still in source tar)</li>
3482 </ul>
3483 </div>
3484 </div>
3485 <div class="section" id="id410">
3486 <h1>0.9 (2006-03-20)</h1>
3487 <div class="section" id="id411">
3488 <h2>Features added</h2>
3489 <ul class="simple">
3490 <li>Error logging API for libxml2 error messages</li>
3491 <li>Various performance improvements</li>
3492 <li>Benchmark script for lxml, ElementTree and cElementTree</li>
3493 <li>Support for registering extension functions through new FunctionNamespace
3494 class (see doc/extensions.txt)</li>
3495 <li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
3496 <li>Support for variables in XPath expressions (also in XPath class)</li>
3497 <li>XPath class for compiled XPath expressions</li>
3498 <li>XMLID module level function (ElementTree compatible)</li>
3499 <li>XMLParser API for customized libxml2 parser configuration</li>
3500 <li>Support for custom Element classes through new Namespace API (see
3501 doc/namespace_extensions.txt)</li>
3502 <li>Common exception base class LxmlError for module exceptions</li>
3503 <li>real iterator support in iter(Element), Element.getiterator()</li>
3504 <li>XSLT objects are callable, result trees support str()</li>
3505 <li>Added MANIFEST.in for easier creation of RPM files.</li>
3506 <li>'getparent' method on elements allows navigation to an element's
3507 parent element.</li>
3508 <li>Python core compatible SAX tree builder and SAX event generator. See
3509 doc/sax.txt for more information.</li>
3510 </ul>
3511 </div>
3512 <div class="section" id="id412">
3513 <h2>Bugs fixed</h2>
3514 <ul class="simple">
3515 <li>Segfaults and memory leaks in various API functions of Element</li>
3516 <li>Segfault in XSLT.tostring()</li>
3517 <li>ElementTree objects no longer interfere, Elements can be root of different
3518 ElementTrees at the same time</li>
3519 <li>document('') works in XSLT documents read from files (in-memory documents
3520 cannot support this due to libxslt deficiencies)</li>
3521 </ul>
3522 </div>
3523 </div>
3524 <div class="section" id="id413">
3525 <h1>0.8 (2005-11-03)</h1>
3526 <div class="section" id="id414">
3527 <h2>Features added</h2>
3528 <ul class="simple">
3529 <li>Support for copy.deepcopy() on elements. copy.copy() works also, but
3530 does the same thing, and does <em>not</em> create a shallow copy, as that
3531 makes no sense in the context of libxml2 trees. This means a
3532 potential incompatibility with ElementTree, but there's more chance
3533 that it works than if copy.copy() isn't supported at all.</li>
3534 <li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
3535 supported and parsing of gzipped XML files works.</li>
3536 <li>implemented index() on elements, allowing one to find the index of a
3537 SubElement.</li>
3538 </ul>
3539 </div>
3540 <div class="section" id="id415">
3541 <h2>Bugs fixed</h2>
3542 <ul class="simple">
3543 <li>Use xslt-config instead of xml2-config to find out libxml2
3544 directories to take into account a case where libxslt is installed
3545 in a different directory than libxslt.</li>
3546 <li>Eliminate crash condition in iteration when text nodes are changed.</li>
3547 <li>Passing 'None' to tostring() does not result in a segfault anymore,
3548 but an AssertionError.</li>
3549 <li>Some test fixes for Windows.</li>
3550 <li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
3551 syntax errors. This should be less confusing.</li>
3552 <li>Fixed error with uncaught exception in Pyrex code.</li>
3553 <li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
3554 segfault.</li>
3555 <li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
3556 <li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
3557 libxml2 version, as it should.</li>
3558 <li>Passing a UTF-8 encoded string to the XML() function would fail;
3559 fixed.</li>
3560 </ul>
3561 </div>
3562 </div>
3563 <div class="section" id="id416">
3564 <h1>0.7 (2005-06-15)</h1>
3565 <div class="section" id="id417">
3566 <h2>Features added</h2>
3567 <ul class="simple">
3568 <li>parameters (XPath expressions) can be passed to XSLT using keyword
3569 parameters.</li>
3570 <li>Simple XInclude support. Calling the xinclude() method on a tree
3571 will process any XInclude statements in the document.</li>
3572 <li>XMLSchema support. Use the XMLSchema class or the convenience
3573 xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
3574 <li>Added convenience xslt() method on tree. This is less efficient
3575 than the XSLT object, but makes it easier to write quick code.</li>
3576 <li>Added convenience relaxng() method on tree. This is less efficient
3577 than the RelaxNG object, but makes it easier to write quick code.</li>
3578 <li>Make it possible to use XPathEvaluator with elements as well. The
3579 XPathEvaluator in this case will retain the element so multiple
3580 XPath queries can be made against one element efficiently. This
3581 replaces the second argument to the .evaluate() method that existed
3582 previously.</li>
3583 <li>Allow registerNamespace() to be called on an XPathEvaluator, after
3584 creation, to add additional namespaces. Also allow registerNamespaces(),
3585 which does the same for a namespace dictionary.</li>
3586 <li>Add 'prefix' attribute to element to be able to read prefix information.
3587 This is entirely read-only.</li>
3588 <li>It is possible to supply an extra nsmap keyword parameter to
3589 the Element() and SubElement() constructors, which supplies a
3590 prefix to namespace URI mapping. This will create namespace
3591 prefix declarations on these elements and these prefixes will show up
3592 in XML serialization.</li>
3593 </ul>
3594 </div>
3595 <div class="section" id="id418">
3596 <h2>Bugs fixed</h2>
3597 <ul class="simple">
3598 <li>Killed yet another memory management related bug: trees created
3599 using newDoc would not get a libxml2-level dictionary, which caused
3600 problems when deallocating these documents later if they contained a
3601 node that came from a document with a dictionary.</li>
3602 <li>Moving namespaced elements between documents was problematic as
3603 references to the original document would remain. This has been fixed
3604 by applying xmlReconciliateNs() after each move operation.</li>
3605 <li>Can pass None to 'dump()' without segfaults.</li>
3606 <li>tostring() works properly for non-root elements as well.</li>
3607 <li>Cleaned out the tostring() method so it should handle encoding
3608 correctly.</li>
3609 <li>Cleaned out the ElementTree.write() method so it should handle encoding
3610 correctly. Writing directly to a file should also be faster, as there is no
3611 need to go through a Python string in that case. Made sure the test cases
3612 test both serializing to StringIO as well as serializing to a real file.</li>
3613 </ul>
3614 </div>
3615 </div>
3616 <div class="section" id="id419">
3617 <h1>0.6 (2005-05-14)</h1>
3618 <div class="section" id="id420">
3619 <h2>Features added</h2>
3620 <ul class="simple">
3621 <li>Changed setup.py so that library_dirs is also guessed. This should
3622 help with compilation on the Mac OS X platform, where otherwise the
3623 wrong library (shipping with the OS) could be picked up.</li>
3624 <li>Tweaked setup.py so that it picks up the version from version.txt.</li>
3625 </ul>
3626 </div>
3627 <div class="section" id="id421">
3628 <h2>Bugs fixed</h2>
3629 <ul class="simple">
3630 <li>Do the right thing when handling namespaced attributes.</li>
3631 <li>fix bug where tostring() moved nodes into new documents. tostring()
3632 had very nasty side-effects before this fix, sorry!</li>
3633 </ul>
3634 </div>
3635 </div>
3636 <div class="section" id="id422">
3637 <h1>0.5.1 (2005-04-09)</h1>
3638 <ul class="simple">
3639 <li>Python 2.2 compatibility fixes.</li>
3640 <li>unicode fixes in Element() and Comment() as well as XML(); unicode
3641 input wasn't properly being UTF-8 encoded.</li>
3642 </ul>
3643 </div>
3644 <div class="section" id="id423">
3645 <h1>0.5 (2005-04-08)</h1>
3646 <p>Initial public release.</p>
3647 </div>
3648 </div>
3649 <div class="footer">
3650 <hr class="footer" />
3651 Generated on: 2020-07-09.
3652
3653 </div>
3654 </body>
3655 </html>