Imported Upstream version 2.3.4
[platform/upstream/python-lxml.git] / doc / html / changes-2.3.5.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.8.1: http://docutils.sourceforge.net/" />
7 <title>lxml changelog</title>
8
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>2.3.5 (2012-07-31)</h1>
16 <div class="section" id="features-added">
17 <h2>Features added</h2>
18 </div>
19 <div class="section" id="bugs-fixed">
20 <h2>Bugs fixed</h2>
21 <ul class="simple">
22 <li>Crash when merging text nodes in <tt class="docutils literal">element.remove()</tt>.</li>
23 <li>Crash in sax/target parser when reporting empty doctype.</li>
24 </ul>
25 </div>
26 <div class="section" id="other-changes">
27 <h2>Other changes</h2>
28 </div>
29 </div>
30 <div class="section" id="id2">
31 <h1>2.3.4 (2012-03-26)</h1>
32 <div class="section" id="id3">
33 <h2>Features added</h2>
34 </div>
35 <div class="section" id="id4">
36 <h2>Bugs fixed</h2>
37 <ul class="simple">
38 <li>Crash when building an nsmap (Element property) with empty
39 namespace URIs.</li>
40 <li>Crash due to race condition when errors (or user messages) occur
41 during threaded XSLT processing.</li>
42 <li>XSLT stylesheet compilation could ignore compilation errors.</li>
43 </ul>
44 </div>
45 <div class="section" id="id5">
46 <h2>Other changes</h2>
47 </div>
48 </div>
49 <div class="section" id="id6">
50 <h1>2.3.3 (2012-01-04)</h1>
51 <div class="section" id="id7">
52 <h2>Features added</h2>
53 <ul class="simple">
54 <li><tt class="docutils literal">lxml.html.tostring()</tt> gained new serialisation options
55 <tt class="docutils literal">with_tail</tt> and <tt class="docutils literal">doctype</tt>.</li>
56 </ul>
57 </div>
58 <div class="section" id="id8">
59 <h2>Bugs fixed</h2>
60 <ul class="simple">
61 <li>Fixed a crash when using <tt class="docutils literal">iterparse()</tt> for HTML parsing and
62 requesting start events.</li>
63 <li>Fixed parsing of more selectors in cssselect.  Whitespace before
64 pseudo-elements and pseudo-classes is significant as it is a
65 descendant combinator.
66 &quot;E :pseudo&quot; should parse the same as &quot;E *:pseudo&quot;, not &quot;E:pseudo&quot;.
67 Patch by Simon Sapin.</li>
68 <li>lxml.html.diff no longer raises an exception when hitting
69 'img' tags without 'src' attribute.</li>
70 </ul>
71 </div>
72 <div class="section" id="id9">
73 <h2>Other changes</h2>
74 </div>
75 </div>
76 <div class="section" id="id10">
77 <h1>2.3.2 (2011-11-11)</h1>
78 <div class="section" id="id11">
79 <h2>Features added</h2>
80 <ul class="simple">
81 <li><tt class="docutils literal">lxml.objectify.deannotate()</tt> has a new boolean option
82 <tt class="docutils literal">cleanup_namespaces</tt> to remove the objectify namespace
83 declarations (and generally clean up the namespace declarations)
84 after removing the type annotations.</li>
85 <li><tt class="docutils literal">lxml.objectify</tt> gained its own <tt class="docutils literal">SubElement()</tt> function as a
86 copy of <tt class="docutils literal">etree.SubElement</tt> to avoid an otherwise redundant import
87 of <tt class="docutils literal">lxml.etree</tt> on the user side.</li>
88 </ul>
89 </div>
90 <div class="section" id="id12">
91 <h2>Bugs fixed</h2>
92 <ul class="simple">
93 <li>Fixed the &quot;descendant&quot; bug in cssselect a second time (after a first
94 fix in lxml 2.3.1).  The previous change resulted in a serious
95 performance regression for the XPath based evaluation of the
96 translated expression.  Note that this breaks the usage of some of
97 the generated XPath expressions as XSLT location paths that
98 previously worked in 2.3.1.</li>
99 <li>Fixed parsing of some selectors in cssselect. Whitespace after combinators
100 &quot;&gt;&quot;, &quot;+&quot; and &quot;~&quot; is now correctly ignored. Previously is was parsed as
101 a descendant combinator. For example, &quot;div&gt; .foo&quot; was parsed the same as
102 &quot;div&gt;* .foo&quot; instead of &quot;div&gt;.foo&quot;. Patch by Simon Sapin.</li>
103 </ul>
104 </div>
105 <div class="section" id="id13">
106 <h2>Other changes</h2>
107 </div>
108 </div>
109 <div class="section" id="id14">
110 <h1>2.3.1 (2011-09-25)</h1>
111 <div class="section" id="id15">
112 <h2>Features added</h2>
113 <ul class="simple">
114 <li>New option <tt class="docutils literal">kill_tags</tt> in <tt class="docutils literal">lxml.html.clean</tt> to remove specific
115 tags and their content (i.e. their whole subtree).</li>
116 <li><tt class="docutils literal">pi.get()</tt> and <tt class="docutils literal">pi.attrib</tt> on processing instructions to parse
117 pseudo-attributes from the text content of processing instructions.</li>
118 <li><tt class="docutils literal">lxml.get_include()</tt> returns a list of include paths that can be
119 used to compile external C code against lxml.etree.  This is
120 specifically required for statically linked lxml builds when code
121 needs to compile against the exact same header file versions as lxml
122 itself.</li>
123 <li><tt class="docutils literal">Resolver.resolve_file()</tt> takes an additional option
124 <tt class="docutils literal">close_file</tt> that configures if the file(-like) object will be
125 closed after reading or not.  By default, the file will be closed,
126 as the user is not expected to keep a reference to it.</li>
127 </ul>
128 </div>
129 <div class="section" id="id16">
130 <h2>Bugs fixed</h2>
131 <ul class="simple">
132 <li>HTML cleaning didn't remove 'data:' links.</li>
133 <li>The html5lib parser integration now uses the 'official'
134 implementation in html5lib itself, which makes it work with newer
135 releases of the library.</li>
136 <li>In <tt class="docutils literal">lxml.sax</tt>, <tt class="docutils literal">endElementNS()</tt> could incorrectly reject a plain
137 tag name when the corresponding start event inferred the same plain
138 tag name to be in the default namespace.</li>
139 <li>When an open file-like object is passed into <tt class="docutils literal">parse()</tt> or
140 <tt class="docutils literal">iterparse()</tt>, the parser will no longer close it after use.  This
141 reverts a change in lxml 2.3 where all files would be closed.  It is
142 the users responsibility to properly close the file(-like) object,
143 also in error cases.</li>
144 <li>Assertion error in lxml.html.cleaner when discarding top-level elements.</li>
145 <li>In lxml.cssselect, use the xpath 'A//B' (short for
146 'A/descendant-or-self::node()/B') instead of 'A/descendant::B' for
147 the css descendant selector ('A B').  This makes a few edge cases
148 like <tt class="docutils literal">&quot;div <span class="pre">*:last-child&quot;</span></tt> consistent with the selector behavior in
149 WebKit and Firefox, and makes more css expressions valid location
150 paths (for use in xsl:template match).</li>
151 <li>In lxml.html, non-selected <tt class="docutils literal">&lt;option&gt;</tt> tags no longer show up in the
152 collected form values.</li>
153 <li>Adding/removing <tt class="docutils literal">&lt;option&gt;</tt> values to/from a multiple select form
154 field properly selects them and unselects them.</li>
155 </ul>
156 </div>
157 <div class="section" id="id17">
158 <h2>Other changes</h2>
159 <ul class="simple">
160 <li>Static builds can specify the download directory with the
161 <tt class="docutils literal"><span class="pre">--download-dir</span></tt> option.</li>
162 </ul>
163 </div>
164 </div>
165 <div class="section" id="id18">
166 <h1>2.3 (2011-02-06)</h1>
167 <div class="section" id="id19">
168 <h2>Features added</h2>
169 <ul class="simple">
170 <li>When looking for children, <tt class="docutils literal">lxml.objectify</tt> takes '{}tag' as
171 meaning an empty namespace, as opposed to the parent namespace.</li>
172 </ul>
173 </div>
174 <div class="section" id="id20">
175 <h2>Bugs fixed</h2>
176 <ul class="simple">
177 <li>When finished reading from a file-like object, the parser
178 immediately calls its <tt class="docutils literal">.close()</tt> method.</li>
179 <li>When finished parsing, <tt class="docutils literal">iterparse()</tt> immediately closes the input
180 file.</li>
181 <li>Work-around for libxml2 bug that can leave the HTML parser in a
182 non-functional state after parsing a severly broken document (fixed
183 in libxml2 2.7.8).</li>
184 <li><tt class="docutils literal">marque</tt> tag in HTML cleanup code is correctly named <tt class="docutils literal">marquee</tt>.</li>
185 </ul>
186 </div>
187 <div class="section" id="id21">
188 <h2>Other changes</h2>
189 <ul class="simple">
190 <li>Some public functions in the Cython-level C-API have more explicit
191 return types.</li>
192 </ul>
193 </div>
194 </div>
195 <div class="section" id="beta1-2010-09-06">
196 <h1>2.3beta1 (2010-09-06)</h1>
197 <div class="section" id="id22">
198 <h2>Features added</h2>
199 </div>
200 <div class="section" id="id23">
201 <h2>Bugs fixed</h2>
202 <ul class="simple">
203 <li>Crash in newer libxml2 versions when moving elements between
204 documents that had attributes on replaced XInclude nodes.</li>
205 <li><tt class="docutils literal">XMLID()</tt> function was missing the optional <tt class="docutils literal">parser</tt> and
206 <tt class="docutils literal">base_url</tt> parameters.</li>
207 <li>Searching for wildcard tags in <tt class="docutils literal">iterparse()</tt> was broken in Py3.</li>
208 <li><tt class="docutils literal">lxml.html.open_in_browser()</tt> didn't work in Python 3 due to the
209 use of os.tempnam.  It now takes an optional 'encoding' parameter.</li>
210 </ul>
211 </div>
212 <div class="section" id="id24">
213 <h2>Other changes</h2>
214 </div>
215 </div>
216 <div class="section" id="alpha2-2010-07-24">
217 <h1>2.3alpha2 (2010-07-24)</h1>
218 <div class="section" id="id25">
219 <h2>Features added</h2>
220 </div>
221 <div class="section" id="id26">
222 <h2>Bugs fixed</h2>
223 <ul class="simple">
224 <li>Crash in XSLT when generating text-only result documents with a
225 stylesheet created in a different thread.</li>
226 </ul>
227 </div>
228 <div class="section" id="id27">
229 <h2>Other changes</h2>
230 <ul class="simple">
231 <li><tt class="docutils literal">repr()</tt> of Element objects shows the hex ID with leading 0x
232 (following ElementTree 1.3).</li>
233 </ul>
234 </div>
235 </div>
236 <div class="section" id="alpha1-2010-06-19">
237 <h1>2.3alpha1 (2010-06-19)</h1>
238 <div class="section" id="id28">
239 <h2>Features added</h2>
240 <ul class="simple">
241 <li>Keyword argument <tt class="docutils literal">namespaces</tt> in <tt class="docutils literal">lxml.cssselect.CSSSelector()</tt>
242 to pass a prefix-to-namespace mapping for the selector.</li>
243 <li>New function <tt class="docutils literal">lxml.etree.register_namespace(prefix, uri)</tt> that
244 globally registers a namespace prefix for a namespace that newly
245 created Elements in that namespace will use automatically.  Follows
246 ElementTree 1.3.</li>
247 <li>Support 'unicode' string name as encoding parameter in
248 <tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
249 <li>Support 'c14n' serialisation method in <tt class="docutils literal">ElementTree.write()</tt> and
250 <tt class="docutils literal">tostring()</tt>, following ElementTree 1.3.</li>
251 <li>The ElementPath expression syntax (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) was extended to
252 match the upcoming ElementTree 1.3 that will ship in the standard
253 library of Python 3.2/2.7.  This includes extended support for
254 predicates as well as namespace prefixes (as known from XPath).</li>
255 <li>During regular XPath evaluation, various ESXLT functions are
256 available within their namespace when using libxslt 1.1.26 or later.</li>
257 <li>Support passing a readily configured logger instance into
258 <tt class="docutils literal">PyErrorLog</tt>, instead of a logger name.</li>
259 <li>On serialisation, the new <tt class="docutils literal">doctype</tt> parameter can be used to
260 override the DOCTYPE (internal subset) of the document.</li>
261 <li>New parameter <tt class="docutils literal">output_parent</tt> to <tt class="docutils literal">XSLTExtension.apply_templates()</tt>
262 to append the resulting content directly to an output element.</li>
263 <li><tt class="docutils literal">XSLTExtension.process_children()</tt> to process the content of the
264 XSLT extension element itself.</li>
265 <li>ISO-Schematron support based on the de-facto Schematron reference
266 'skeleton implementation'.</li>
267 <li>XSLT objects now take XPath object as <tt class="docutils literal">__call__</tt> stylesheet
268 parameters.</li>
269 <li>Enable path caching in ElementPath (<tt class="docutils literal"><span class="pre">el.find*()</span></tt>) to avoid parsing
270 overhead.</li>
271 <li>Setting the value of a namespaced attribute always uses a prefixed
272 namespace instead of the default namespace even if both declare the
273 same namespace URI.  This avoids serialisation problems when an
274 attribute from a default namespace is set on an element from a
275 different namespace.</li>
276 <li>XSLT extension elements: support for XSLT context nodes other than
277 elements: document root, comments, processing instructions.</li>
278 <li>Support for strings (in addition to Elements) in node-sets returned
279 by extension functions.</li>
280 <li>Forms that lack an <tt class="docutils literal">action</tt> attribute default to the base URL of
281 the document on submit.</li>
282 <li>XPath attribute result strings have an <tt class="docutils literal">attrname</tt> property.</li>
283 <li>Namespace URIs get validated against RFC 3986 at the API level
284 (required by the XML namespace specification).</li>
285 <li>Target parsers show their target object in the <tt class="docutils literal">.target</tt> property
286 (compatible with ElementTree).</li>
287 </ul>
288 </div>
289 <div class="section" id="id29">
290 <h2>Bugs fixed</h2>
291 <ul class="simple">
292 <li>API is hardened against invalid proxy instances to prevent crashes
293 due to incorrectly instantiated Element instances.</li>
294 <li>Prevent crash when instantiating <tt class="docutils literal">CommentBase</tt> and friends.</li>
295 <li>Export ElementTree compatible XML parser class as
296 <tt class="docutils literal">XMLTreeBuilder</tt>, as it is called in ET 1.2.</li>
297 <li>ObjectifiedDataElements in lxml.objectify were not hashable.  They
298 now use the hash value of the underlying Python value (string,
299 number, etc.) to which they compare equal.</li>
300 <li>Parsing broken fragments in lxml.html could fail if the fragment
301 contained an orphaned closing '&lt;/div&gt;' tag.</li>
302 <li>Using XSLT extension elements around the root of the output document
303 crashed.</li>
304 <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
305 <tt class="docutils literal">x <span class="pre">[attr=&quot;val&quot;]</span></tt> (with a space).  The latter now matches the
306 attribute independent of the element.</li>
307 <li>Rewriting multiple links inside of HTML text content could end up
308 replacing unrelated content as replacements could impact the
309 reported position of subsequent matches.  Modifications are now
310 simplified by letting the <tt class="docutils literal">iterlinks()</tt> generator in <tt class="docutils literal">lxml.html</tt>
311 return links in reversed order if they appear inside the same text
312 node.  Thus, replacements and link-internal modifications no longer
313 change the position of links reported afterwards.</li>
314 <li>The <tt class="docutils literal">.value</tt> attribute of <tt class="docutils literal">textarea</tt> elements in lxml.html did
315 not represent the complete raw value (including child tags etc.). It
316 now serialises the complete content on read and replaces the
317 complete content by a string on write.</li>
318 <li>Target parser didn't call <tt class="docutils literal">.close()</tt> on the target object if
319 parsing failed.  Now it is guaranteed that <tt class="docutils literal">.close()</tt> will be
320 called after parsing, regardless of the outcome.</li>
321 </ul>
322 </div>
323 <div class="section" id="id30">
324 <h2>Other changes</h2>
325 <ul class="simple">
326 <li>Official support for Python 3.1.2 and later.</li>
327 <li>Static MS Windows builds can now download their dependencies
328 themselves.</li>
329 <li><tt class="docutils literal">Element.attrib</tt> no longer uses a cyclic reference back to its
330 Element object.  It therefore no longer requires the garbage
331 collector to clean up.</li>
332 <li>Static builds include libiconv, in addition to libxml2 and libxslt.</li>
333 </ul>
334 </div>
335 </div>
336 <div class="section" id="id31">
337 <h1>2.2.8 (2010-09-02)</h1>
338 <div class="section" id="id32">
339 <h2>Bugs fixed</h2>
340 <ul class="simple">
341 <li>Crash in newer libxml2 versions when moving elements between
342 documents that had attributes on replaced XInclude nodes.</li>
343 <li>Import fix for urljoin in Python 3.1+.</li>
344 </ul>
345 </div>
346 </div>
347 <div class="section" id="id33">
348 <h1>2.2.7 (2010-07-24)</h1>
349 <div class="section" id="id34">
350 <h2>Bugs fixed</h2>
351 <ul class="simple">
352 <li>Crash in XSLT when generating text-only result documents with a
353 stylesheet created in a different thread.</li>
354 </ul>
355 </div>
356 </div>
357 <div class="section" id="id35">
358 <h1>2.2.6 (2010-03-02)</h1>
359 <div class="section" id="id36">
360 <h2>Bugs fixed</h2>
361 <ul class="simple">
362 <li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
363 </ul>
364 </div>
365 </div>
366 <div class="section" id="id37">
367 <h1>2.2.5 (2010-02-28)</h1>
368 <div class="section" id="id38">
369 <h2>Features added</h2>
370 <ul class="simple">
371 <li>Support for running XSLT extension elements on the input root node
372 (e.g. in a template matching on &quot;/&quot;).</li>
373 </ul>
374 </div>
375 <div class="section" id="id39">
376 <h2>Bugs fixed</h2>
377 <ul class="simple">
378 <li>Crash in XPath evaluation when reading smart strings from a document
379 other than the original context document.</li>
380 <li>Support recent versions of html5lib by not requiring its
381 <tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
382 <li>Manually instantiating the custom element classes in
383 <tt class="docutils literal">lxml.objectify</tt> could crash.</li>
384 <li>Invalid XML text characters were not rejected by the API when they
385 appeared in unicode strings directly after non-ASCII characters.</li>
386 <li>lxml.html.open_http_urllib() did not work in Python 3.</li>
387 <li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
388 <tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
389 <li>Crash in XSLT extension elements when the XSLT context node is not
390 an element.</li>
391 </ul>
392 </div>
393 </div>
394 <div class="section" id="id40">
395 <h1>2.2.4 (2009-11-11)</h1>
396 <div class="section" id="id41">
397 <h2>Bugs fixed</h2>
398 <ul class="simple">
399 <li>Static build of libxml2/libxslt was broken.</li>
400 </ul>
401 </div>
402 </div>
403 <div class="section" id="id42">
404 <h1>2.2.3 (2009-10-30)</h1>
405 <div class="section" id="id43">
406 <h2>Features added</h2>
407 </div>
408 <div class="section" id="id44">
409 <h2>Bugs fixed</h2>
410 <ul class="simple">
411 <li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
412 parser.</li>
413 <li>Looking up and deleting attributes without a namespace could hit a
414 namespaced attribute of the same name instead.</li>
415 <li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
416 ones) could leave a partially initialised element in the tree.</li>
417 <li>Modifying trees that contain parsed entity references could result
418 in an infinite loop.</li>
419 <li>ObjectifiedElement.__setattr__ created an empty-string child element when the
420 attribute value was rejected as a non-unicode/non-ascii string</li>
421 <li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
422 messages.</li>
423 <li>Invalid syntax in CSS expressions could lead to an infinite loop in
424 the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
425 <li>CSS special character escapes were not properly handled in
426 <tt class="docutils literal">lxml.cssselect</tt>.</li>
427 <li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
428 <li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
429 attribute were not handled correctly.  The HTML standard dictates
430 that their value is defined by their text content.  This is now
431 supported by lxml.html.</li>
432 <li>XPath raised a TypeError when finding CDATA sections.  This is now
433 fully supported.</li>
434 <li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
435 <li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
436 namespaces when annotation is disabled.</li>
437 <li>Feed parser failed to honout the 'recover' option on parse errors.</li>
438 <li>Diverting the error logging to Python's logging system was broken.</li>
439 </ul>
440 </div>
441 <div class="section" id="id45">
442 <h2>Other changes</h2>
443 </div>
444 </div>
445 <div class="section" id="id46">
446 <h1>2.2.2 (2009-06-21)</h1>
447 <div class="section" id="id47">
448 <h2>Features added</h2>
449 <ul class="simple">
450 <li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
451 <tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
452 from a subtree.</li>
453 </ul>
454 </div>
455 <div class="section" id="id48">
456 <h2>Bugs fixed</h2>
457 <ul class="simple">
458 <li>Namespace cleanup on subtree insertions could result in missing
459 namespace declarations (and potentially crashes) if the element
460 defining a namespace was deleted and the namespace was not used by
461 the top element of the inserted subtree but only in deeper subtrees.</li>
462 <li>Raising an exception from a parser target callback didn't always
463 terminate the parser.</li>
464 <li>Only {true, false, 1, 0} are accepted as the lexical representation for
465 BoolElement ({True, False, T, F, t, f} not any more), restoring lxml &lt;= 2.0
466 behaviour.</li>
467 </ul>
468 </div>
469 <div class="section" id="id49">
470 <h2>Other changes</h2>
471 </div>
472 </div>
473 <div class="section" id="id50">
474 <h1>2.2.1 (2009-06-02)</h1>
475 <div class="section" id="id51">
476 <h2>Features added</h2>
477 <ul class="simple">
478 <li>Injecting default attributes into a document during XML Schema
479 validation (also at parse time).</li>
480 <li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
481 restrictions imposed by libxml2 2.7.</li>
482 </ul>
483 </div>
484 <div class="section" id="id52">
485 <h2>Bugs fixed</h2>
486 <ul class="simple">
487 <li>The script for statically building libxml2 and libxslt didn't work
488 in Py3.</li>
489 <li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
490 for parsing (which could lead to a crash before release 2.6.24).</li>
491 </ul>
492 </div>
493 <div class="section" id="id53">
494 <h2>Other changes</h2>
495 </div>
496 </div>
497 <div class="section" id="id54">
498 <h1>2.2 (2009-03-21)</h1>
499 <div class="section" id="id55">
500 <h2>Features added</h2>
501 <ul class="simple">
502 <li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
503 <tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
504 on serialisation.</li>
505 </ul>
506 </div>
507 <div class="section" id="id56">
508 <h2>Bugs fixed</h2>
509 <ul class="simple">
510 <li>Crash when parsing an XML Schema with external imports from a
511 filename.</li>
512 </ul>
513 </div>
514 </div>
515 <div class="section" id="beta4-2009-02-27">
516 <h1>2.2beta4 (2009-02-27)</h1>
517 <div class="section" id="id57">
518 <h2>Features added</h2>
519 <ul class="simple">
520 <li>Support strings and instantiable Element classes as child arguments
521 to the constructor of custom Element classes.</li>
522 <li>GZip compression support for serialisation to files and file-like
523 objects.</li>
524 </ul>
525 </div>
526 <div class="section" id="id58">
527 <h2>Bugs fixed</h2>
528 <ul class="simple">
529 <li>Deep-copying an ElementTree copied neither its sibling PIs and
530 comments nor its internal/external DTD subsets.</li>
531 <li>Soupparser failed on broken attributes without values.</li>
532 <li>Crash in XSLT when overwriting an already defined attribute using
533 <tt class="docutils literal">xsl:attribute</tt>.</li>
534 <li>Crash bug in exception handling code under Python 3.  This was due
535 to a problem in Cython, not lxml itself.</li>
536 <li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
537 <li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
538 was evaluated incorrectly.</li>
539 </ul>
540 </div>
541 <div class="section" id="id59">
542 <h2>Other changes</h2>
543 <ul class="simple">
544 <li>Official support for Python 3.0.1.</li>
545 <li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
546 for Elements without text content.</li>
547 </ul>
548 </div>
549 </div>
550 <div class="section" id="beta3-2009-02-17">
551 <h1>2.2beta3 (2009-02-17)</h1>
552 <div class="section" id="id60">
553 <h2>Features added</h2>
554 <ul class="simple">
555 <li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
556 that require escaping.</li>
557 </ul>
558 </div>
559 <div class="section" id="id61">
560 <h2>Bugs fixed</h2>
561 <ul class="simple">
562 <li>Memory leak in XPath evaluators.</li>
563 <li>Crash when parsing indented XML in one thread and merging it with
564 other documents parsed in another thread.</li>
565 <li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
566 string failed.</li>
567 <li>Fixes following changes in Python 3.0.1.</li>
568 <li>Minor fixes for Python 3.</li>
569 </ul>
570 </div>
571 <div class="section" id="id62">
572 <h2>Other changes</h2>
573 <ul class="simple">
574 <li>The global error log (which is copied into the exception log) is now
575 local to a thread, which fixes some race conditions.</li>
576 <li>More robust error handling on serialisation.</li>
577 </ul>
578 </div>
579 </div>
580 <div class="section" id="beta2-2009-01-25">
581 <h1>2.2beta2 (2009-01-25)</h1>
582 <div class="section" id="id63">
583 <h2>Bugs fixed</h2>
584 <ul class="simple">
585 <li>Potential memory leak on exception handling.  This was due to a
586 problem in Cython, not lxml itself.</li>
587 <li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
588 <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
589 (treating the quotation marks as part of the link).</li>
590 <li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
591 </ul>
592 </div>
593 </div>
594 <div class="section" id="id64">
595 <h1>2.1.5 (2009-01-06)</h1>
596 <div class="section" id="id65">
597 <h2>Bugs fixed</h2>
598 <ul class="simple">
599 <li>Potential memory leak on exception handling.  This was due to a
600 problem in Cython, not lxml itself.</li>
601 <li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
602 </ul>
603 </div>
604 </div>
605 <div class="section" id="beta1-2008-12-12">
606 <h1>2.2beta1 (2008-12-12)</h1>
607 <div class="section" id="id66">
608 <h2>Features added</h2>
609 <ul class="simple">
610 <li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
611 just HTML strings.</li>
612 </ul>
613 </div>
614 <div class="section" id="id67">
615 <h2>Bugs fixed</h2>
616 <ul class="simple">
617 <li>Crash when using an XPath evaluator in multiple threads.</li>
618 <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>
619 </ul>
620 </div>
621 <div class="section" id="id68">
622 <h2>Other changes</h2>
623 <ul class="simple">
624 <li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
625 </ul>
626 </div>
627 </div>
628 <div class="section" id="id69">
629 <h1>2.1.4 (2008-12-12)</h1>
630 <div class="section" id="id70">
631 <h2>Bugs fixed</h2>
632 <ul class="simple">
633 <li>Crash when using an XPath evaluator in multiple threads.</li>
634 </ul>
635 </div>
636 </div>
637 <div class="section" id="id71">
638 <h1>2.0.11 (2008-12-12)</h1>
639 <div class="section" id="id72">
640 <h2>Bugs fixed</h2>
641 <ul class="simple">
642 <li>Crash when using an XPath evaluator in multiple threads.</li>
643 </ul>
644 </div>
645 </div>
646 <div class="section" id="alpha1-2008-11-23">
647 <h1>2.2alpha1 (2008-11-23)</h1>
648 <div class="section" id="id73">
649 <h2>Features added</h2>
650 <ul class="simple">
651 <li>Support for XSLT result tree fragments in XPath/XSLT extension
652 functions.</li>
653 <li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
654 <li>New options for exclusive C14N and C14N without comments.</li>
655 <li>Instantiating a custom Element classes creates a new Element.</li>
656 </ul>
657 </div>
658 <div class="section" id="id74">
659 <h2>Bugs fixed</h2>
660 <ul class="simple">
661 <li>XSLT didn't inherit the parse options of the input document.</li>
662 <li>0-bytes could slip through the API when used inside of Unicode
663 strings.</li>
664 <li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
665 that end in a parenthesis, will be linked in their entirety (typical
666 with Wikipedia links).</li>
667 </ul>
668 </div>
669 <div class="section" id="id75">
670 <h2>Other changes</h2>
671 </div>
672 </div>
673 <div class="section" id="id76">
674 <h1>2.1.3 (2008-11-17)</h1>
675 <div class="section" id="id77">
676 <h2>Features added</h2>
677 </div>
678 <div class="section" id="id78">
679 <h2>Bugs fixed</h2>
680 <ul class="simple">
681 <li>Ref-count leaks when lxml enters a try-except statement while an
682 outside exception lives in sys.exc_*(). This was due to a problem in
683 Cython, not lxml itself.</li>
684 <li>Parser Unicode decoding errors could get swallowed by other
685 exceptions.</li>
686 <li>Name/import errors in some Python modules.</li>
687 <li>Internal DTD subsets that did not specify a system or public ID were
688 not serialised and did not appear in the docinfo property of
689 ElementTrees.</li>
690 <li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
691 <li>Test suite fixes for libxml2 2.7.</li>
692 <li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
693 <li>Resolver.resolve_file() was broken.</li>
694 <li>Overriding the parser encoding didn't work for many encodings.</li>
695 </ul>
696 </div>
697 <div class="section" id="id79">
698 <h2>Other changes</h2>
699 </div>
700 </div>
701 <div class="section" id="id80">
702 <h1>2.0.10 (2008-11-17)</h1>
703 <div class="section" id="id81">
704 <h2>Bugs fixed</h2>
705 <ul class="simple">
706 <li>Ref-count leaks when lxml enters a try-except statement while an
707 outside exception lives in sys.exc_*(). This was due to a problem in
708 Cython, not lxml itself.</li>
709 </ul>
710 </div>
711 </div>
712 <div class="section" id="id82">
713 <h1>2.1.2 (2008-09-05)</h1>
714 <div class="section" id="id83">
715 <h2>Features added</h2>
716 <ul class="simple">
717 <li>lxml.etree now tries to find the absolute path name of files when
718 parsing from a file-like object.  This helps custom resolvers when
719 resolving relative URLs, as lixbml2 can prepend them with the path
720 of the source document.</li>
721 </ul>
722 </div>
723 <div class="section" id="id84">
724 <h2>Bugs fixed</h2>
725 <ul class="simple">
726 <li>Memory problem when passing documents between threads.</li>
727 <li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
728 exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
729 </ul>
730 </div>
731 <div class="section" id="id85">
732 <h2>Other changes</h2>
733 </div>
734 </div>
735 <div class="section" id="id86">
736 <h1>2.0.9 (2008-09-05)</h1>
737 <div class="section" id="id87">
738 <h2>Bugs fixed</h2>
739 <ul class="simple">
740 <li>Memory problem when passing documents between threads.</li>
741 <li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
742 exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
743 </ul>
744 </div>
745 </div>
746 <div class="section" id="id88">
747 <h1>2.1.1 (2008-07-24)</h1>
748 <div class="section" id="id89">
749 <h2>Features added</h2>
750 </div>
751 <div class="section" id="id90">
752 <h2>Bugs fixed</h2>
753 <ul class="simple">
754 <li>Crash when parsing XSLT stylesheets in a thread and using them in
755 another.</li>
756 <li>Encoding problem when including text with ElementInclude under
757 Python 3.</li>
758 </ul>
759 </div>
760 <div class="section" id="id91">
761 <h2>Other changes</h2>
762 </div>
763 </div>
764 <div class="section" id="id92">
765 <h1>2.0.8 (2008-07-24)</h1>
766 <div class="section" id="id93">
767 <h2>Features added</h2>
768 <ul class="simple">
769 <li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
770 with whitespace in URL attributes.</li>
771 </ul>
772 </div>
773 <div class="section" id="id94">
774 <h2>Bugs fixed</h2>
775 <ul class="simple">
776 <li>Crash when parsing XSLT stylesheets in a thread and using them in
777 another.</li>
778 <li>CSS selector parser dropped remaining expression after a function
779 with parameters.</li>
780 </ul>
781 </div>
782 <div class="section" id="id95">
783 <h2>Other changes</h2>
784 </div>
785 </div>
786 <div class="section" id="id96">
787 <h1>2.1 (2008-07-09)</h1>
788 <div class="section" id="id97">
789 <h2>Features added</h2>
790 <ul class="simple">
791 <li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
792 keyword option).</li>
793 <li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
794 with whitespace in URL attributes.</li>
795 </ul>
796 </div>
797 <div class="section" id="id98">
798 <h2>Bugs fixed</h2>
799 <ul class="simple">
800 <li>Custom resolvers were not used for XMLSchema includes/imports and
801 XInclude processing.</li>
802 <li>CSS selector parser dropped remaining expression after a function
803 with parameters.</li>
804 </ul>
805 </div>
806 <div class="section" id="id99">
807 <h2>Other changes</h2>
808 <ul class="simple">
809 <li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
810 <tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
811 <li>Speed-up when running XSLTs on documents from other threads</li>
812 </ul>
813 </div>
814 </div>
815 <div class="section" id="id100">
816 <h1>2.0.7 (2008-06-20)</h1>
817 <div class="section" id="id101">
818 <h2>Features added</h2>
819 <ul class="simple">
820 <li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
821 </ul>
822 </div>
823 <div class="section" id="id102">
824 <h2>Bugs fixed</h2>
825 <ul class="simple">
826 <li>Descending dot-separated classes in CSS selectors were not resolved
827 correctly.</li>
828 <li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
829 <li>Potential threading problem in XInclude.</li>
830 <li>Crash in Element class lookup classes when the __init__() method of
831 the super class is not called from Python subclasses.</li>
832 </ul>
833 </div>
834 <div class="section" id="id103">
835 <h2>Other changes</h2>
836 <ul class="simple">
837 <li>Non-ASCII characters in attribute values are no longer escaped on
838 serialisation.</li>
839 </ul>
840 </div>
841 </div>
842 <div class="section" id="beta3-2008-06-19">
843 <h1>2.1beta3 (2008-06-19)</h1>
844 <div class="section" id="id104">
845 <h2>Features added</h2>
846 <ul class="simple">
847 <li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
848 <li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
849 <li>Support for parsing from file-like objects that return unicode
850 strings.</li>
851 <li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
852 namespace declarations from a (sub)tree (experimental).</li>
853 <li>XSLT results support the buffer protocol in Python 3.</li>
854 <li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
855 a parsable string will return either a UTF-8 encoded byte string, a
856 unicode string or a tree, based on the type of the input.
857 Previously, the result was always a byte string or a tree.</li>
858 <li>Support for Python 2.6 and 3.0 beta.</li>
859 <li>File name handling now uses a heuristic to convert between byte
860 strings (usually filenames) and unicode strings (usually URLs).</li>
861 <li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
862 <li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
863 on reading under Python 2.x.</li>
864 <li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
865 lxml.html (experimental).</li>
866 <li>Most features in lxml.html work for XHTML namespaced tag names
867 (experimental).</li>
868 </ul>
869 </div>
870 <div class="section" id="id105">
871 <h2>Bugs fixed</h2>
872 <ul class="simple">
873 <li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
874 <li>Crash in Element class lookup classes when the __init__() method of
875 the super class is not called from Python subclasses.</li>
876 <li>A number of problems related to unicode/byte string conversion of
877 filenames and error messages were fixed.</li>
878 <li>Building on MacOS-X now passes the &quot;flat_namespace&quot; option to the C
879 compiler, which reportedly prevents build quirks and crashes on this
880 platform.</li>
881 <li>Windows build was broken.</li>
882 <li>Rare crash when serialising to a file object with certain encodings.</li>
883 </ul>
884 </div>
885 <div class="section" id="id106">
886 <h2>Other changes</h2>
887 <ul class="simple">
888 <li>Non-ASCII characters in attribute values are no longer escaped on
889 serialisation.</li>
890 <li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
891 namespaces, etc. will result in a ValueError instead of an
892 AssertionError (just like the tag well-formedness check).</li>
893 <li>Up to several times faster attribute access (i.e. tree traversal) in
894 lxml.objectify.</li>
895 </ul>
896 </div>
897 </div>
898 <div class="section" id="id107">
899 <h1>2.0.6 (2008-05-31)</h1>
900 <div class="section" id="id108">
901 <h2>Features added</h2>
902 </div>
903 <div class="section" id="id109">
904 <h2>Bugs fixed</h2>
905 <ul class="simple">
906 <li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find(&quot;tag[child]&quot;)</span></tt>.</li>
907 <li>Windows build was broken.</li>
908 <li>Moving a subtree from a document created in one thread into a
909 document of another thread could crash when the rest of the source
910 document is deleted while the subtree is still in use.</li>
911 <li>Rare crash when serialising to a file object with certain encodings.</li>
912 </ul>
913 </div>
914 <div class="section" id="id110">
915 <h2>Other changes</h2>
916 <ul class="simple">
917 <li>lxml should now build without problems on MacOS-X.</li>
918 </ul>
919 </div>
920 </div>
921 <div class="section" id="beta2-2008-05-02">
922 <h1>2.1beta2 (2008-05-02)</h1>
923 <div class="section" id="id111">
924 <h2>Features added</h2>
925 <ul class="simple">
926 <li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
927 <li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
928 attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
929 pre-configured for the lxml.html package.</li>
930 </ul>
931 </div>
932 <div class="section" id="id112">
933 <h2>Bugs fixed</h2>
934 <ul class="simple">
935 <li>Moving a subtree from a document created in one thread into a
936 document of another thread could crash when the rest of the source
937 document is deleted while the subtree is still in use.</li>
938 <li>Passing an nsmap when creating an Element will no longer strip
939 redundantly defined namespace URIs.  This prevented the definition
940 of more than one prefix for a namespace on the same Element.</li>
941 </ul>
942 </div>
943 <div class="section" id="id113">
944 <h2>Other changes</h2>
945 <ul class="simple">
946 <li>If the default namespace is redundantly defined with a prefix on the
947 same Element, the prefix will now be preferred for subelements and
948 attributes.  This allows users to work around a problem in libxml2
949 where attributes from the default namespace could serialise without
950 a prefix even when they appear on an Element with a different
951 namespace (i.e. they would end up in the wrong namespace).</li>
952 </ul>
953 </div>
954 </div>
955 <div class="section" id="id114">
956 <h1>2.0.5 (2008-05-01)</h1>
957 <div class="section" id="id115">
958 <h2>Features added</h2>
959 </div>
960 <div class="section" id="id116">
961 <h2>Bugs fixed</h2>
962 <ul class="simple">
963 <li>Resolving to a filename in custom resolvers didn't work.</li>
964 <li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
965 let some XSLT errors pass silently.</li>
966 <li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
967 </ul>
968 </div>
969 <div class="section" id="id117">
970 <h2>Other changes</h2>
971 </div>
972 </div>
973 <div class="section" id="beta1-2008-04-15">
974 <h1>2.1beta1 (2008-04-15)</h1>
975 <div class="section" id="id118">
976 <h2>Features added</h2>
977 <ul class="simple">
978 <li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
979 <li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
980 sections.  Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
981 sections by their text content.</li>
982 <li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
983 </ul>
984 </div>
985 <div class="section" id="id119">
986 <h2>Bugs fixed</h2>
987 <ul class="simple">
988 <li>Resolving to a filename in custom resolvers didn't work.</li>
989 <li>lxml did not honour libxslt's second error state &quot;STOPPED&quot;, which
990 let some XSLT errors pass silently.</li>
991 <li>Memory leak in Schematron with libxml2 &gt;= 2.6.31.</li>
992 <li>lxml.etree accepted non well-formed namespace prefix names.</li>
993 </ul>
994 </div>
995 <div class="section" id="id120">
996 <h2>Other changes</h2>
997 <ul class="simple">
998 <li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
999 takes care of namespace cleanup when moving elements between
1000 different namespace contexts.</li>
1001 <li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
1002 parser or through lxml.html now end up in a new HTML document
1003 (doctype HTML 4.01 Transitional) instead of a generic XML document.
1004 This mostly impacts the serialisation and the availability of a DTD
1005 context.</li>
1006 </ul>
1007 </div>
1008 </div>
1009 <div class="section" id="id121">
1010 <h1>2.0.4 (2008-04-13)</h1>
1011 <div class="section" id="id122">
1012 <h2>Features added</h2>
1013 </div>
1014 <div class="section" id="id123">
1015 <h2>Bugs fixed</h2>
1016 <ul class="simple">
1017 <li>Hanging thread in conjunction with GTK threading.</li>
1018 <li>Crash bug in iterparse when moving elements into other documents.</li>
1019 <li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
1020 <li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
1021 </ul>
1022 </div>
1023 <div class="section" id="id124">
1024 <h2>Other changes</h2>
1025 </div>
1026 </div>
1027 <div class="section" id="alpha1-2008-03-27">
1028 <h1>2.1alpha1 (2008-03-27)</h1>
1029 <div class="section" id="id125">
1030 <h2>Features added</h2>
1031 <ul class="simple">
1032 <li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
1033 <li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
1034 returns a dict of access configuration options.</li>
1035 <li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
1036 <tt class="docutils literal">XSLTAccessControl</tt> class.</li>
1037 <li>Extension elements for XSLT (experimental!)</li>
1038 <li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
1039 an Element.</li>
1040 <li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
1041 </ul>
1042 </div>
1043 <div class="section" id="id126">
1044 <h2>Bugs fixed</h2>
1045 <ul class="simple">
1046 <li>Default encoding for plain text serialisation was different from
1047 that of XML serialisation (UTF-8 instead of ASCII).</li>
1048 </ul>
1049 </div>
1050 <div class="section" id="id127">
1051 <h2>Other changes</h2>
1052 <ul class="simple">
1053 <li>Minor API speed-ups.</li>
1054 <li>The benchmark suite now uses tail text in the trees, which makes the
1055 absolute numbers incomparable to previous results.</li>
1056 <li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
1057 used to enable syntax highlighting for the doctest examples.</li>
1058 </ul>
1059 <p>Most long-time deprecated functions and methods were removed:</p>
1060 <ul>
1061 <li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
1062 </li>
1063 <li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
1064 <tt class="docutils literal">etree.use_global_python_log()</tt></p>
1065 </li>
1066 <li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
1067 <tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
1068 </li>
1069 <li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
1070 </li>
1071 <li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
1072 </li>
1073 <li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
1074 <tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
1075 <p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
1076 yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
1077 instead.</p>
1078 </li>
1079 <li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
1080 <tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
1081 </li>
1082 <li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
1083 <tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
1084 </li>
1085 <li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
1086 <tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
1087 </li>
1088 <li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
1089 <tt class="docutils literal">objectify.set_default_parser()</tt></p>
1090 </li>
1091 </ul>
1092 </div>
1093 </div>
1094 <div class="section" id="id128">
1095 <h1>2.0.3 (2008-03-26)</h1>
1096 <div class="section" id="id129">
1097 <h2>Features added</h2>
1098 <ul class="simple">
1099 <li>soupparser.parse() allows passing keyword arguments on to
1100 BeautifulSoup.</li>
1101 <li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
1102 </ul>
1103 </div>
1104 <div class="section" id="id130">
1105 <h2>Bugs fixed</h2>
1106 <ul class="simple">
1107 <li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
1108 <tt class="docutils literal">&lt;br&gt;</tt>).</li>
1109 <li>Handle entity replacements correctly in target parser.</li>
1110 <li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
1111 <li>The BeautifulSoup parser (soupparser.py) did not replace entities,
1112 which made them turn up in text content.</li>
1113 <li>Attribute assignment of custom PyTypes in objectify could fail to
1114 correctly serialise the value to a string.</li>
1115 </ul>
1116 </div>
1117 <div class="section" id="id131">
1118 <h2>Other changes</h2>
1119 <ul class="simple">
1120 <li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
1121 <tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API.  The old module
1122 remains for compatibility with ElementTree's own ElementSoup module.</li>
1123 <li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
1124 build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
1125 <tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
1126 <li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
1127 override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
1128 compiler options.  The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
1129 option.</li>
1130 </ul>
1131 </div>
1132 </div>
1133 <div class="section" id="id132">
1134 <h1>2.0.2 (2008-02-22)</h1>
1135 <div class="section" id="id133">
1136 <h2>Features added</h2>
1137 <ul class="simple">
1138 <li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
1139 the filename of the file(-like) object.</li>
1140 </ul>
1141 </div>
1142 <div class="section" id="id134">
1143 <h2>Bugs fixed</h2>
1144 <ul class="simple">
1145 <li>The prefix for objectify's pytype namespace was missing from the set
1146 of default prefixes.</li>
1147 <li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
1148 <li>Error type names in RelaxNG were reported incorrectly.</li>
1149 <li>Slice deletion bug fixed in objectify.</li>
1150 </ul>
1151 </div>
1152 <div class="section" id="id135">
1153 <h2>Other changes</h2>
1154 <ul class="simple">
1155 <li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
1156 <li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
1157 (<tt class="docutils literal"><span class="pre">method=&quot;xml&quot;</span></tt> for XHTML output).</li>
1158 <li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
1159 <tt class="docutils literal">base_url</tt> argument.</li>
1160 </ul>
1161 </div>
1162 </div>
1163 <div class="section" id="id136">
1164 <h1>2.0.1 (2008-02-13)</h1>
1165 <div class="section" id="id137">
1166 <h2>Features added</h2>
1167 <ul class="simple">
1168 <li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
1169 <li>Loads of new docstrings reflect the signature of functions and
1170 methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
1171 </ul>
1172 </div>
1173 <div class="section" id="id138">
1174 <h2>Bugs fixed</h2>
1175 <ul class="simple">
1176 <li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
1177 <tt class="docutils literal">lxml.htmlbuilder</tt></li>
1178 <li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
1179 was an unnamed input field.  Now unnamed input fields are completely
1180 ignored.</li>
1181 <li>Setting an element slice in objectify could insert slice-overlapping
1182 elements at the wrong position.</li>
1183 </ul>
1184 </div>
1185 <div class="section" id="id139">
1186 <h2>Other changes</h2>
1187 <ul class="simple">
1188 <li>The generated API documentation was cleaned up and disburdened from
1189 non-public classes etc.</li>
1190 <li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
1191 <tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml.  If
1192 you want to use it, feel free to copy it over to your own source
1193 base.</li>
1194 <li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
1195 override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
1196 compiler options.</li>
1197 </ul>
1198 </div>
1199 </div>
1200 <div class="section" id="id140">
1201 <h1>2.0 (2008-02-01)</h1>
1202 <div class="section" id="id141">
1203 <h2>Features added</h2>
1204 <ul class="simple">
1205 <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
1206 serialise to unicode.  The <tt class="docutils literal">tounicode()</tt> function is now
1207 deprecated.</li>
1208 <li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
1209 <li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
1210 parser with the usual objectify setup.</li>
1211 <li>Plain ASCII XPath string results are no longer forced into unicode
1212 objects as in 2.0beta1, but are returned as plain strings as before.</li>
1213 <li>All XPath string results are 'smart' objects that have a
1214 <tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
1215 <li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
1216 <li>More accurate exception messages in validator creation.</li>
1217 <li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
1218 <li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
1219 selection make their Element container accessible through a
1220 <tt class="docutils literal">getparent()</tt> method.  As a side-effect, they are now always
1221 unicode objects (even ASCII strings).</li>
1222 <li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
1223 copy if they were not created in that thread.</li>
1224 <li>Invalid entity names and character references will be rejected by
1225 the <tt class="docutils literal">Entity()</tt> factory.</li>
1226 <li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
1227 e.g. <tt class="docutils literal">&amp;amp;</tt>.</li>
1228 <li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
1229 in ET 1.3)</li>
1230 <li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
1231 <li>ElementTree compatible TreeBuilder class.</li>
1232 <li>Use default prefixes for some common XML namespaces.</li>
1233 <li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
1234 two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
1235 more general <tt class="docutils literal">allow_element(el)</tt>.</li>
1236 <li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
1237 etree and in objectify</li>
1238 <li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
1239 resolving a document as string data.</li>
1240 <li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
1241 <tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
1242 the special checking for one test.</li>
1243 <li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
1244 The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
1245 <tt class="docutils literal">error_log</tt>.</li>
1246 <li>The normal parsers and the feed parser interface are now separated
1247 and can be used concurrently on the same parser instance.</li>
1248 <li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
1249 ElementTree 1.3</li>
1250 <li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
1251 parsing with the HTML parser (note that this interface may be
1252 subject to change)</li>
1253 <li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
1254 of the parsed documents.</li>
1255 <li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
1256 <li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
1257 types in one step.  Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
1258 <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
1259 argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
1260 serialise as XML, HTML or plain text content.</li>
1261 <li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
1262 <tt class="docutils literal">findall()</tt></li>
1263 <li><tt class="docutils literal">itertext()</tt> method on Elements</li>
1264 <li>Setting a QName object as value of the .text property or as an attribute
1265 will resolve its prefix in the respective context</li>
1266 <li>ElementTree-like parser target interface as described in
1267 <a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
1268 <li>ElementTree-like feed parser interface on XMLParser and HTMLParser
1269 (<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
1270 <li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
1271 integration with objectify.  Provides extended type support based on
1272 registered PyTypes.</li>
1273 <li>XSLT objects now support deep copying</li>
1274 <li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
1275 subelement straight with text, tail and attributes.</li>
1276 <li>XPath extension functions can now access the current context node
1277 (<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
1278 (<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
1279 parameter</li>
1280 <li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
1281 <li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
1282 doctests based on XML/HTML output.  Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
1283 <tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
1284 <li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
1285 selectors.</li>
1286 <li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
1287 treatment.</li>
1288 <li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
1289 instance and no longer global.</li>
1290 <li>Schematron validation (incomplete in libxml2)</li>
1291 <li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
1292 conversion function to strings to support setting text values from arbitrary
1293 types.</li>
1294 <li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes.  XML
1295 parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
1296 False to keep entities in the document.</li>
1297 <li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
1298 <li>Error specific messages in XPath parsing and evaluation
1299 NOTE: for evaluation errors, you will now get an XPathEvalError instead of
1300 an XPathSyntaxError.  To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
1301 <li>The regular expression functions in XPath now support passing a node-set
1302 instead of a string</li>
1303 <li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
1304 <li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
1305 </ul>
1306 </div>
1307 <div class="section" id="id142">
1308 <h2>Bugs fixed</h2>
1309 <ul class="simple">
1310 <li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
1311 <li>Some Python 2.4-isms prevented lxml from building/running under
1312 Python 2.3.</li>
1313 <li>XPath on ElementTrees could crash when selecting the virtual root
1314 node of the ElementTree.</li>
1315 <li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
1316 <li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
1317 <li>Minor bugs in XSLT error message formatting.</li>
1318 <li>Result document memory leak in target parser.</li>
1319 <li>Target parser failed to report comments.</li>
1320 <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>
1321 tags weren't recognized.  (Note: plugin-specific link parameters
1322 still aren't recognized.)  Also, the <tt class="docutils literal">&lt;embed&gt;</tt> tag, though not
1323 standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
1324 <li>Using custom resolvers on XSLT stylesheets parsed from a string
1325 could request ill-formed URLs.</li>
1326 <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
1327 output, it will then be namespace-neutral (before the ellipsis was
1328 treated as a real namespace).</li>
1329 <li>AttributeError in feed parser on parse errors</li>
1330 <li>XML feed parser setup problem</li>
1331 <li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
1332 <li>lxml failed to serialise namespace declarations of elements other than the
1333 root node of a tree</li>
1334 <li>Race condition in XSLT where the resolver context leaked between concurrent
1335 XSLT calls</li>
1336 <li>lxml.etree did not check tag/attribute names</li>
1337 <li>The XML parser did not report undefined entities as error</li>
1338 <li>The text in exceptions raised by XML parsers, validators and XPath
1339 evaluators now reports the first error that occurred instead of the last</li>
1340 <li>Passing '' as XPath namespace prefix did not raise an error</li>
1341 <li>Thread safety in XPath evaluators</li>
1342 </ul>
1343 </div>
1344 <div class="section" id="id143">
1345 <h2>Other changes</h2>
1346 <ul class="simple">
1347 <li>Exceptions carry only the part of the error log that is related to
1348 the operation that caused the error.</li>
1349 <li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
1350 file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
1351 <li>The test suite now skips most doctests under Python 2.3.</li>
1352 <li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
1353 realclean</tt> instead)</li>
1354 <li>Minor performance tweaks for Element instantiation and subelement
1355 creation</li>
1356 <li>Various places in the XPath, XSLT and iteration APIs now require
1357 keyword-only arguments.</li>
1358 <li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
1359 match the order used in all other iteration methods.  The second
1360 argument ('preceding') is now a keyword-only argument.</li>
1361 <li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
1362 reverted to return an iterator as it did in lxml 1.x.  The ET API
1363 specification allows it to return either a sequence or an iterator,
1364 and it traditionally returned a sequence in ET and an iterator in
1365 lxml.  However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
1366 method, which should be used in new code wherever possible.</li>
1367 <li>The 'pretty printed' serialisation of ElementTree objects now
1368 inserts newlines at the root level between processing instructions,
1369 comments and the root tag.</li>
1370 <li>A 'pretty printed' serialisation is now terminated with a newline.</li>
1371 <li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
1372 required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
1373 <li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
1374 <li>The module source files were renamed to &quot;lxml.*.pyx&quot;, such as
1375 &quot;lxml.etree.pyx&quot;.  This was changed for consistency with the way
1376 Pyrex commonly handles package imports.  The main effect is that
1377 classes now know about their fully qualified class name, including
1378 the package name of their module.</li>
1379 <li>Keyword-only arguments in some API functions, especially in the
1380 parsers and serialisers.</li>
1381 <li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
1382 between HTML tags and XML tags based on the parser that was used to
1383 parse or create them.  HTML tags no longer reject any non-ASCII
1384 characters in tag names but only spaces and the special characters
1385 <tt class="docutils literal"><span class="pre">&lt;&gt;&amp;/&quot;'</span></tt>.</li>
1386 <li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
1387 (which can crash on certain XPath errors)</li>
1388 <li>Type annotation in objectify now preserves the already annotated type by
1389 default to prevent loosing type information that is already there.</li>
1390 <li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
1391 an iterator (ElementTree 1.3 compatible behaviour)</li>
1392 <li>objectify.PyType for None is now called &quot;NoneType&quot;</li>
1393 <li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
1394 original name is still available as alias</li>
1395 <li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
1396 generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
1397 <li>Major refactoring in XPath/XSLT extension function code</li>
1398 <li>Network access in parsers disabled by default</li>
1399 </ul>
1400 </div>
1401 </div>
1402 <div class="section" id="id144">
1403 <h1>1.3.6 (2007-10-29)</h1>
1404 <div class="section" id="id145">
1405 <h2>Bugs fixed</h2>
1406 <ul class="simple">
1407 <li>Backported decref crash fix from 2.0</li>
1408 <li>Well hidden free-while-in-use crash bug in ObjectPath</li>
1409 </ul>
1410 </div>
1411 <div class="section" id="id146">
1412 <h2>Other changes</h2>
1413 <ul class="simple">
1414 <li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
1415 methods.  While this makes them take a lot longer to run, it also
1416 makes it easier to link a specific test to garbage collection
1417 problems that would otherwise appear in later tests.</li>
1418 </ul>
1419 </div>
1420 </div>
1421 <div class="section" id="id147">
1422 <h1>1.3.5 (2007-10-22)</h1>
1423 <div class="section" id="id148">
1424 <h2>Features added</h2>
1425 </div>
1426 <div class="section" id="id149">
1427 <h2>Bugs fixed</h2>
1428 <ul class="simple">
1429 <li>lxml.etree could crash when adding more than 10000 namespaces to a
1430 document</li>
1431 <li>lxml failed to serialise namespace declarations of elements other
1432 than the root node of a tree</li>
1433 </ul>
1434 </div>
1435 </div>
1436 <div class="section" id="id150">
1437 <h1>1.3.4 (2007-08-30)</h1>
1438 <div class="section" id="id151">
1439 <h2>Features added</h2>
1440 <ul class="simple">
1441 <li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
1442 <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
1443 creates.</li>
1444 <li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
1445 and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
1446 subset of the document respectively.</li>
1447 <li>Serialising an ElementTree now includes any internal DTD subsets that are
1448 part of the document, as well as comments and PIs that are siblings of the
1449 root node.</li>
1450 </ul>
1451 </div>
1452 <div class="section" id="id152">
1453 <h2>Bugs fixed</h2>
1454 <ul class="simple">
1455 <li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
1456 </ul>
1457 </div>
1458 <div class="section" id="id153">
1459 <h2>Other changes</h2>
1460 <ul class="simple">
1461 <li>lxml now raises a TagNameWarning about tag names containing ':' instead of
1462 an Error as 1.3.3 did.  The reason is that a number of projects currently
1463 misuse the previous lack of tag name validation to generate namespace
1464 prefixes without declaring namespaces.  Apart from the danger of generating
1465 broken XML this way, it also breaks most of the namespace-aware tools in
1466 XML, including XPath, XSLT and validation.  lxml 1.3.x will continue to
1467 support this bug with a Warning, while lxml 2.0 will be strict about
1468 well-formed tag names (not only regarding ':').</li>
1469 <li>Serialising an Element no longer includes its comment and PI siblings (only
1470 ElementTree serialisation includes them).</li>
1471 </ul>
1472 </div>
1473 </div>
1474 <div class="section" id="id154">
1475 <h1>1.3.3 (2007-07-26)</h1>
1476 <div class="section" id="id155">
1477 <h2>Features added</h2>
1478 <ul class="simple">
1479 <li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
1480 instructions and comments while parsing XML</li>
1481 <li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
1482 <li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
1483 the parser you pass.</li>
1484 <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>
1485 </ul>
1486 </div>
1487 <div class="section" id="id156">
1488 <h2>Bugs fixed</h2>
1489 <ul class="simple">
1490 <li>Parsing from Python Unicode strings failed on some platforms</li>
1491 <li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
1492 <li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
1493 <tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
1494 </ul>
1495 </div>
1496 </div>
1497 <div class="section" id="id157">
1498 <h1>1.3.2 (2007-07-03)</h1>
1499 <div class="section" id="id158">
1500 <h2>Features added</h2>
1501 </div>
1502 <div class="section" id="id159">
1503 <h2>Bugs fixed</h2>
1504 <ul class="simple">
1505 <li>&quot;deallocating None&quot; crash bug</li>
1506 </ul>
1507 </div>
1508 </div>
1509 <div class="section" id="id160">
1510 <h1>1.3.1 (2007-07-02)</h1>
1511 <div class="section" id="id161">
1512 <h2>Features added</h2>
1513 <ul class="simple">
1514 <li>objectify.DataElement now supports setting values from existing data
1515 elements (not just plain Python types) and reuses defined namespaces etc.</li>
1516 <li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
1517 </ul>
1518 </div>
1519 <div class="section" id="id162">
1520 <h2>Bugs fixed</h2>
1521 <ul class="simple">
1522 <li>Better way to prevent crashes in Element proxy cleanup code</li>
1523 <li>objectify.DataElement didn't set up None value correctly</li>
1524 <li>objectify.DataElement didn't check the value against the provided type hints</li>
1525 <li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
1526 </ul>
1527 </div>
1528 </div>
1529 <div class="section" id="id163">
1530 <h1>1.3 (2007-06-24)</h1>
1531 <div class="section" id="id164">
1532 <h2>Features added</h2>
1533 <ul class="simple">
1534 <li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
1535 scheme that can access the entire tree in read-only mode to help determining
1536 a suitable Element class</li>
1537 <li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
1538 <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>
1539 <li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
1540 adding processing instructions and comments around the root node</li>
1541 <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>
1542 <li>Extended type annotation in objectify: cleaner annotation namespace setup
1543 plus new <tt class="docutils literal">deannotate()</tt> function</li>
1544 <li>Support for custom Element class instantiation in lxml.sax: passing a
1545 <tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
1546 lookup context of that function</li>
1547 <li>'.' represents empty ObjectPath (identity)</li>
1548 <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>
1549 <li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
1550 keys/values/items for a libxml2 node</li>
1551 <li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
1552 <li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
1553 <li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
1554 <li>Support for pickeling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
1555 <li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
1556 <li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
1557 a better handling of namespaces when moving elements between documents.</li>
1558 </ul>
1559 </div>
1560 <div class="section" id="id165">
1561 <h2>Bugs fixed</h2>
1562 <ul class="simple">
1563 <li>Removing Elements from a tree could make them loose their namespace
1564 declarations</li>
1565 <li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
1566 <li>Replacing the children slice of an Element would cut off the tails of the
1567 original children</li>
1568 <li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
1569 <tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
1570 <li>API functions now check incoming strings for XML conformity.  Zero bytes or
1571 low ASCII characters are no longer accepted (AssertionError).</li>
1572 <li>XSLT parsing failed to pass resolver context on to imported documents</li>
1573 <li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
1574 <li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
1575 <li>More ET compatible behaviour when writing out XML declarations or not</li>
1576 <li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
1577 <li>Documents lost their top-level PIs and comments on serialisation</li>
1578 <li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
1579 PIs are copied.</li>
1580 <li>Possible memory leaks in namespace handling when moving elements between
1581 documents</li>
1582 </ul>
1583 </div>
1584 <div class="section" id="id166">
1585 <h2>Other changes</h2>
1586 <ul class="simple">
1587 <li>major restructuring in the documentation</li>
1588 </ul>
1589 </div>
1590 </div>
1591 <div class="section" id="id167">
1592 <h1>1.2.1 (2007-02-27)</h1>
1593 <div class="section" id="id168">
1594 <h2>Bugs fixed</h2>
1595 <ul class="simple">
1596 <li>Build fixes for MS compiler</li>
1597 <li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element[&quot;text&quot;]</span></tt> failed</li>
1598 <li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
1599 to access</li>
1600 <li>The pattern for attribute names in ObjectPath was too restrictive</li>
1601 </ul>
1602 </div>
1603 </div>
1604 <div class="section" id="id169">
1605 <h1>1.2 (2007-02-20)</h1>
1606 <div class="section" id="id170">
1607 <h2>Features added</h2>
1608 <ul class="simple">
1609 <li>Rich comparison of QName objects</li>
1610 <li>Support for regular expressions in benchmark selection</li>
1611 <li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
1612 <li>ElementInclude Python module for ElementTree compatible XInclude processing
1613 that honours custom resolvers registered with the source document</li>
1614 <li>ElementTree.parser property holds the parser used to parse the document</li>
1615 <li>setup.py has been refactored for greater readability and flexibility</li>
1616 <li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
1617 runtime search paths has been renamed to --auto-rpath. This makes it
1618 possible to pass an --rpath directly to distutils; previously this was being
1619 shadowed.</li>
1620 </ul>
1621 </div>
1622 <div class="section" id="id171">
1623 <h2>Bugs fixed</h2>
1624 <ul class="simple">
1625 <li>Element instantiation now uses locks to prevent race conditions with threads</li>
1626 <li>ElementTree.write() did not raise an exception when the file was not writable</li>
1627 <li>Error handling could crash under Python &lt;= 2.4.1 - fixed by disabling thread
1628 support in these environments</li>
1629 <li>Element.find*() did not accept QName objects as path</li>
1630 </ul>
1631 </div>
1632 <div class="section" id="id172">
1633 <h2>Other changes</h2>
1634 <ul class="simple">
1635 <li>code cleanup: redundant _NodeBase super class merged into _Element class
1636 Note: although the impact should be zero in most cases, this change breaks
1637 the compatibiliy of the public C-API</li>
1638 </ul>
1639 </div>
1640 </div>
1641 <div class="section" id="id173">
1642 <h1>1.1.2 (2006-10-30)</h1>
1643 <div class="section" id="id174">
1644 <h2>Features added</h2>
1645 <ul class="simple">
1646 <li>Data elements in objectify support repr(), which is now used by dump()</li>
1647 <li>Source distribution now ships with a patched Pyrex</li>
1648 <li>New C-API function makeElement() to create new elements with text,
1649 tail, attributes and namespaces</li>
1650 <li>Reuse original parser flags for XInclude</li>
1651 <li>Simplified support for handling XSLT processing instructions</li>
1652 </ul>
1653 </div>
1654 <div class="section" id="id175">
1655 <h2>Bugs fixed</h2>
1656 <ul class="simple">
1657 <li>Parser resources were not freed before the next parser run</li>
1658 <li>Open files and XML strings returned by Python resolvers were not
1659 closed/freed</li>
1660 <li>Crash in the IDDict returned by XMLDTDID</li>
1661 <li>Copying Comments and ProcessingInstructions failed</li>
1662 <li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
1663 <li>Memory leak when garbage collecting tailed root elements</li>
1664 <li>HTML script/style content was not propagated to .text</li>
1665 <li>Show text xincluded between text nodes correctly in .text and .tail</li>
1666 <li>'integer * objectify.StringElement' operation was not supported</li>
1667 </ul>
1668 </div>
1669 </div>
1670 <div class="section" id="id176">
1671 <h1>1.1.1 (2006-09-21)</h1>
1672 <div class="section" id="id177">
1673 <h2>Features added</h2>
1674 <ul class="simple">
1675 <li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
1676 <li>countchildren() method on objectify.ObjectifiedElement</li>
1677 <li>Support custom elements for tree nodes in lxml.objectify</li>
1678 </ul>
1679 </div>
1680 <div class="section" id="id178">
1681 <h2>Bugs fixed</h2>
1682 <ul class="simple">
1683 <li>lxml.objectify failed to support long data values (e.g., &quot;123L&quot;)</li>
1684 <li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
1685 <li>Factories objectify.Element() and objectify.DataElement() were missing
1686 <tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
1687 <li>Changing the default parser in lxml.objectify did not update the factories
1688 Element() and DataElement()</li>
1689 <li>Let lxml.objectify.Element() always generate tree elements (not data
1690 elements)</li>
1691 <li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
1692 </ul>
1693 </div>
1694 </div>
1695 <div class="section" id="id179">
1696 <h1>1.1 (2006-09-13)</h1>
1697 <div class="section" id="id180">
1698 <h2>Features added</h2>
1699 <ul class="simple">
1700 <li>Comments and processing instructions return '&lt;!-- coment --&gt;' and
1701 '&lt;?pi-target content?&gt;' for repr()</li>
1702 <li>Parsers are now the preferred (and default) place where element class lookup
1703 schemes should be registered.  Namespace lookup is no longer supported by
1704 default.</li>
1705 <li>Support for Python 2.5 beta</li>
1706 <li>Unlock the GIL for deep copying documents and for XPath()</li>
1707 <li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
1708 <li>Support for parser options in iterparse()</li>
1709 <li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
1710 tuples</li>
1711 <li>The XPath expression &quot;/&quot; now returns an empty list instead of raising an
1712 exception</li>
1713 <li>XML-Object API on top of lxml (lxml.objectify)</li>
1714 <li>Customizable Element class lookup:<ul>
1715 <li>different pre-implemented lookup mechanisms</li>
1716 <li>support for externally provided lookup functions</li>
1717 </ul>
1718 </li>
1719 <li>Support for processing instructions (ET-like, not compatible)</li>
1720 <li>Public C-level API for independent extension modules</li>
1721 <li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
1722 <li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
1723 documentation for differences)</li>
1724 <li>Element.nsmap property returns a mapping of all namespace prefixes known at
1725 the Element to their namespace URI</li>
1726 <li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
1727 <li>Threading support in parsers and serializers:<ul>
1728 <li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
1729 <li>File operations (on file names) free the GIL</li>
1730 <li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
1731 <li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
1732 </ul>
1733 </li>
1734 <li>Element iteration over XPath axes:<ul>
1735 <li>Element.iterdescendants() iterates over the descendants of an element</li>
1736 <li>Element.iterancestors() iterates over the ancestors of an element (from
1737 parent to parent)</li>
1738 <li>Element.itersiblings() iterates over either the following or preceding
1739 siblings of an element</li>
1740 <li>Element.iterchildren() iterates over the children of an element in either
1741 direction</li>
1742 <li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
1743 generated elements</li>
1744 </ul>
1745 </li>
1746 <li>Element.getnext() and Element.getprevious() return the direct siblings of an
1747 element</li>
1748 </ul>
1749 </div>
1750 <div class="section" id="id181">
1751 <h2>Bugs fixed</h2>
1752 <ul class="simple">
1753 <li>filenames with local 8-bit encoding were not supported</li>
1754 <li>1.1beta did not compile under Python 2.3</li>
1755 <li>ignore unknown 'pyval' attribute values in objectify</li>
1756 <li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
1757 <li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
1758 <li>XPathSyntaxError now inherits from XPathError</li>
1759 <li>Threading race conditions in RelaxNG and XMLSchema</li>
1760 <li>Crash when mixing elements from XSLT results into other trees, concurrent
1761 XSLT is only allowed when the stylesheet was parsed in the main thread</li>
1762 <li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
1763 differences in the regular expression syntax)</li>
1764 <li>Setting element.text to '' returned None on request, not the empty string</li>
1765 <li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
1766 <li>Creating documents no longer copies the parser for later URL resolving.  For
1767 performance reasons, only a reference is kept.  Resolver updates on the
1768 parser will now be reflected by documents that were parsed before the
1769 change.  Although this should rarely become visible, it is a behavioral
1770 change from 1.0.</li>
1771 </ul>
1772 </div>
1773 </div>
1774 <div class="section" id="id182">
1775 <h1>1.0.4 (2006-09-09)</h1>
1776 <div class="section" id="id183">
1777 <h2>Features added</h2>
1778 <ul class="simple">
1779 <li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
1780 </ul>
1781 </div>
1782 <div class="section" id="id184">
1783 <h2>Bugs fixed</h2>
1784 <ul class="simple">
1785 <li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
1786 </ul>
1787 </div>
1788 </div>
1789 <div class="section" id="id185">
1790 <h1>1.0.3 (2006-08-08)</h1>
1791 <div class="section" id="id186">
1792 <h2>Features added</h2>
1793 <ul class="simple">
1794 <li>Element.replace(old, new) method to replace a subelement by another one</li>
1795 </ul>
1796 </div>
1797 <div class="section" id="id187">
1798 <h2>Bugs fixed</h2>
1799 <ul class="simple">
1800 <li>Crash when mixing elements from XSLT results into other trees</li>
1801 <li>Copying/deepcopying did not work for ElementTree objects</li>
1802 <li>Setting an attribute to a non-string value did not raise an exception</li>
1803 <li>Element.remove() deleted the tail text from the removed Element</li>
1804 </ul>
1805 </div>
1806 </div>
1807 <div class="section" id="id188">
1808 <h1>1.0.2 (2006-06-27)</h1>
1809 <div class="section" id="id189">
1810 <h2>Features added</h2>
1811 <ul class="simple">
1812 <li>Support for setting a custom default Element class as opposed to namespace
1813 specific classes (which still override the default class)</li>
1814 </ul>
1815 </div>
1816 <div class="section" id="id190">
1817 <h2>Bugs fixed</h2>
1818 <ul class="simple">
1819 <li>Rare exceptions in Python list functions were not handled</li>
1820 <li>Parsing accepted unicode strings with XML encoding declaration in certain
1821 cases</li>
1822 <li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
1823 <li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
1824 <li>XSLT and parser exception messages include the error line number</li>
1825 </ul>
1826 </div>
1827 </div>
1828 <div class="section" id="id191">
1829 <h1>1.0.1 (2006-06-09)</h1>
1830 <div class="section" id="id192">
1831 <h2>Features added</h2>
1832 <ul class="simple">
1833 <li>Repeated calls to Element.attrib now efficiently return the same instance</li>
1834 </ul>
1835 </div>
1836 <div class="section" id="id193">
1837 <h2>Bugs fixed</h2>
1838 <ul class="simple">
1839 <li>Document deallocation could crash in certain garbage collection scenarios</li>
1840 <li>Extension function calls in XSLT variable declarations could break the
1841 stylesheet and crash on repeated calls</li>
1842 <li>Deep copying Elements could loose namespaces declared in parents</li>
1843 <li>Deep copying Elements did not copy tail</li>
1844 <li>Parsing file(-like) objects failed to load external entities</li>
1845 <li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
1846 <li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
1847 <li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
1848 <li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
1849 </ul>
1850 </div>
1851 </div>
1852 <div class="section" id="id194">
1853 <h1>1.0 (2006-06-01)</h1>
1854 <div class="section" id="id195">
1855 <h2>Features added</h2>
1856 <ul class="simple">
1857 <li>Element.getiterator() and the findall() methods support finding arbitrary
1858 elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
1859 <li>Another speedup in tree iteration code</li>
1860 <li>General speedup of Python Element object creation and deallocation</li>
1861 <li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
1862 <li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
1863 <li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
1864 document that contains the element.</li>
1865 <li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
1866 find the element in the tree structure</li>
1867 <li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
1868 <li>Comment texts can be changed through the API</li>
1869 <li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
1870 <li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
1871 <li>ElementTree.write() no longer serializes in memory (reduced memory
1872 footprint)</li>
1873 <li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
1874 <li>Support for writing the XML representation of Elements and ElementTrees to
1875 Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
1876 <li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
1877 <li>Parsing a unicode string no longer copies the string (reduced memory
1878 footprint)</li>
1879 <li>Parsing file-like objects reads chunks rather than the whole file (reduced
1880 memory footprint)</li>
1881 <li>Parsing StringIO objects from the start avoids copying the string (reduced
1882 memory footprint)</li>
1883 <li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
1884 information, original encoding and XML version as seen by the parser</li>
1885 <li>etree module can be compiled without libxslt by commenting out the line
1886 <tt class="docutils literal">include &quot;xslt.pxi&quot;</tt> near the end of the etree.pyx source file</li>
1887 <li>Better error messages in parser exceptions</li>
1888 <li>Error reporting also works in XSLT</li>
1889 <li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
1890 resolvers are registered at parser level</li>
1891 <li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
1892 enabled by default, can be switched off with 'regexp=False' keyword argument</li>
1893 <li>Support for exslt extensions (libexslt) and libxslt extra functions
1894 (node-set, document, write, output)</li>
1895 <li>Substantial speedup in XPath.evaluate()</li>
1896 <li>HTMLParser for parsing (broken) HTML</li>
1897 <li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
1898 implementation of libxml2 (as opposed to ET compatible XMLID)</li>
1899 </ul>
1900 </div>
1901 <div class="section" id="id196">
1902 <h2>Bugs fixed</h2>
1903 <ul class="simple">
1904 <li>Memory leak in Element.__setitem__</li>
1905 <li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
1906 <li>Memory leak in XPath extension functions</li>
1907 <li>Memory leak in unicode related setup code</li>
1908 <li>Element now raises ValueError on empty tag names</li>
1909 <li>Namespace fixing after moving elements between documents could fail if the
1910 source document was freed too early</li>
1911 <li>Setting namespace-less tag names on namespaced elements ('{ns}t' -&gt; 't')
1912 didn't reset the namespace</li>
1913 <li>Unknown constants from newer libxml2 versions could raise exceptions in the
1914 error handlers</li>
1915 <li>lxml.etree compiles much faster</li>
1916 <li>On libxml2 &lt;= 2.6.22, parsing strings with encoding declaration could fail
1917 in certain cases</li>
1918 <li>Document reference in ElementTree objects was not updated when the root
1919 element was moved to a different document</li>
1920 <li>Running absolute XPath expressions on an Element now evaluates against the
1921 root tree</li>
1922 <li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
1923 <li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
1924 objects</li>
1925 <li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
1926 <tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
1927 <li>Memory leak when using iconv encoders in tostring/write</li>
1928 <li>Deep copying Elements and ElementTrees maintains the document information</li>
1929 <li>Serialization functions raise LookupError for unknown encodings</li>
1930 <li>Memory deallocation crash resulting from deep copying elements</li>
1931 <li>Some ElementTree methods could crash if the root node was not initialized
1932 (neither file nor element passed to the constructor)</li>
1933 <li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
1934 dictionary</li>
1935 <li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
1936 <li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
1937 <li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
1938 ElementTree root node as reference point</li>
1939 <li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
1940 </ul>
1941 </div>
1942 </div>
1943 <div class="section" id="id197">
1944 <h1>0.9.2 (2006-05-10)</h1>
1945 <div class="section" id="id198">
1946 <h2>Features added</h2>
1947 <ul class="simple">
1948 <li>Speedup for Element.makeelement(): the new element reuses the original
1949 libxml2 document instead of creating a new empty one</li>
1950 <li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
1951 <li>ElementTree compatible QName class</li>
1952 <li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
1953 </ul>
1954 </div>
1955 <div class="section" id="id199">
1956 <h2>Bugs fixed</h2>
1957 <ul class="simple">
1958 <li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
1959 <li>Memory leak if write_c14n fails to write the file after conversion</li>
1960 <li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
1961 <li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
1962 </ul>
1963 </div>
1964 </div>
1965 <div class="section" id="id200">
1966 <h1>0.9.1 (2006-03-30)</h1>
1967 <div class="section" id="id201">
1968 <h2>Features added</h2>
1969 <ul class="simple">
1970 <li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
1971 SaxError on mismatch</li>
1972 <li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
1973 (startElement, endElement) and defaults to empty attributes (keyword
1974 argument)</li>
1975 <li>Speedup for repeatedly accessing element tag names</li>
1976 <li>Minor API performance improvements</li>
1977 </ul>
1978 </div>
1979 <div class="section" id="id202">
1980 <h2>Bugs fixed</h2>
1981 <ul class="simple">
1982 <li>Memory deallocation bug when using XSLT output method &quot;html&quot;</li>
1983 <li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
1984 <li>lxml.tests package will no longer be installed (is still in source tar)</li>
1985 </ul>
1986 </div>
1987 </div>
1988 <div class="section" id="id203">
1989 <h1>0.9 (2006-03-20)</h1>
1990 <div class="section" id="id204">
1991 <h2>Features added</h2>
1992 <ul class="simple">
1993 <li>Error logging API for libxml2 error messages</li>
1994 <li>Various performance improvements</li>
1995 <li>Benchmark script for lxml, ElementTree and cElementTree</li>
1996 <li>Support for registering extension functions through new FunctionNamespace
1997 class (see doc/extensions.txt)</li>
1998 <li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
1999 <li>Support for variables in XPath expressions (also in XPath class)</li>
2000 <li>XPath class for compiled XPath expressions</li>
2001 <li>XMLID module level function (ElementTree compatible)</li>
2002 <li>XMLParser API for customized libxml2 parser configuration</li>
2003 <li>Support for custom Element classes through new Namespace API (see
2004 doc/namespace_extensions.txt)</li>
2005 <li>Common exception base class LxmlError for module exceptions</li>
2006 <li>real iterator support in iter(Element), Element.getiterator()</li>
2007 <li>XSLT objects are callable, result trees support str()</li>
2008 <li>Added MANIFEST.in for easier creation of RPM files.</li>
2009 <li>'getparent' method on elements allows navigation to an element's
2010 parent element.</li>
2011 <li>Python core compatible SAX tree builder and SAX event generator. See
2012 doc/sax.txt for more information.</li>
2013 </ul>
2014 </div>
2015 <div class="section" id="id205">
2016 <h2>Bugs fixed</h2>
2017 <ul class="simple">
2018 <li>Segfaults and memory leaks in various API functions of Element</li>
2019 <li>Segfault in XSLT.tostring()</li>
2020 <li>ElementTree objects no longer interfere, Elements can be root of different
2021 ElementTrees at the same time</li>
2022 <li>document('') works in XSLT documents read from files (in-memory documents
2023 cannot support this due to libxslt deficiencies)</li>
2024 </ul>
2025 </div>
2026 </div>
2027 <div class="section" id="id206">
2028 <h1>0.8 (2005-11-03)</h1>
2029 <div class="section" id="id207">
2030 <h2>Features added</h2>
2031 <ul class="simple">
2032 <li>Support for copy.deepcopy() on elements. copy.copy() works also, but
2033 does the same thing, and does <em>not</em> create a shallow copy, as that
2034 makes no sense in the context of libxml2 trees. This means a
2035 potential incompatibility with ElementTree, but there's more chance
2036 that it works than if copy.copy() isn't supported at all.</li>
2037 <li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
2038 supported and parsing of gzipped XML files works.</li>
2039 <li>implemented index() on elements, allowing one to find the index of a
2040 SubElement.</li>
2041 </ul>
2042 </div>
2043 <div class="section" id="id208">
2044 <h2>Bugs fixed</h2>
2045 <ul class="simple">
2046 <li>Use xslt-config instead of xml2-config to find out libxml2
2047 directories to take into account a case where libxslt is installed
2048 in a different directory than libxslt.</li>
2049 <li>Eliminate crash condition in iteration when text nodes are changed.</li>
2050 <li>Passing 'None' to tostring() does not result in a segfault anymore,
2051 but an AssertionError.</li>
2052 <li>Some test fixes for Windows.</li>
2053 <li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
2054 syntax errors. This should be less confusing.</li>
2055 <li>Fixed error with uncaught exception in Pyrex code.</li>
2056 <li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
2057 segfault.</li>
2058 <li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
2059 <li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
2060 libxml2 version, as it should.</li>
2061 <li>Passing a UTF-8 encoded string to the XML() function would fail;
2062 fixed.</li>
2063 </ul>
2064 </div>
2065 </div>
2066 <div class="section" id="id209">
2067 <h1>0.7 (2005-06-15)</h1>
2068 <div class="section" id="id210">
2069 <h2>Features added</h2>
2070 <ul class="simple">
2071 <li>parameters (XPath expressions) can be passed to XSLT using keyword
2072 parameters.</li>
2073 <li>Simple XInclude support. Calling the xinclude() method on a tree
2074 will process any XInclude statements in the document.</li>
2075 <li>XMLSchema support. Use the XMLSchema class or the convenience
2076 xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
2077 <li>Added convenience xslt() method on tree. This is less efficient
2078 than the XSLT object, but makes it easier to write quick code.</li>
2079 <li>Added convenience relaxng() method on tree. This is less efficient
2080 than the RelaxNG object, but makes it easier to write quick code.</li>
2081 <li>Make it possible to use XPathEvaluator with elements as well. The
2082 XPathEvaluator in this case will retain the element so multiple
2083 XPath queries can be made against one element efficiently. This
2084 replaces the second argument to the .evaluate() method that existed
2085 previously.</li>
2086 <li>Allow registerNamespace() to be called on an XPathEvaluator, after
2087 creation, to add additional namespaces. Also allow registerNamespaces(),
2088 which does the same for a namespace dictionary.</li>
2089 <li>Add 'prefix' attribute to element to be able to read prefix information.
2090 This is entirely read-only.</li>
2091 <li>It is possible to supply an extra nsmap keyword parameter to
2092 the Element() and SubElement() constructors, which supplies a
2093 prefix to namespace URI mapping. This will create namespace
2094 prefix declarations on these elements and these prefixes will show up
2095 in XML serialization.</li>
2096 </ul>
2097 </div>
2098 <div class="section" id="id211">
2099 <h2>Bugs fixed</h2>
2100 <ul class="simple">
2101 <li>Killed yet another memory management related bug: trees created
2102 using newDoc would not get a libxml2-level dictionary, which caused
2103 problems when deallocating these documents later if they contained a
2104 node that came from a document with a dictionary.</li>
2105 <li>Moving namespaced elements between documents was problematic as
2106 references to the original document would remain. This has been fixed
2107 by applying xmlReconciliateNs() after each move operation.</li>
2108 <li>Can pass None to 'dump()' without segfaults.</li>
2109 <li>tostring() works properly for non-root elements as well.</li>
2110 <li>Cleaned out the tostring() method so it should handle encoding
2111 correctly.</li>
2112 <li>Cleaned out the ElementTree.write() method so it should handle encoding
2113 correctly. Writing directly to a file should also be faster, as there is no
2114 need to go through a Python string in that case. Made sure the test cases
2115 test both serializing to StringIO as well as serializing to a real file.</li>
2116 </ul>
2117 </div>
2118 </div>
2119 <div class="section" id="id212">
2120 <h1>0.6 (2005-05-14)</h1>
2121 <div class="section" id="id213">
2122 <h2>Features added</h2>
2123 <ul class="simple">
2124 <li>Changed setup.py so that library_dirs is also guessed. This should
2125 help with compilation on the Mac OS X platform, where otherwise the
2126 wrong library (shipping with the OS) could be picked up.</li>
2127 <li>Tweaked setup.py so that it picks up the version from version.txt.</li>
2128 </ul>
2129 </div>
2130 <div class="section" id="id214">
2131 <h2>Bugs fixed</h2>
2132 <ul class="simple">
2133 <li>Do the right thing when handling namespaced attributes.</li>
2134 <li>fix bug where tostring() moved nodes into new documents. tostring()
2135 had very nasty side-effects before this fix, sorry!</li>
2136 </ul>
2137 </div>
2138 </div>
2139 <div class="section" id="id215">
2140 <h1>0.5.1 (2005-04-09)</h1>
2141 <ul class="simple">
2142 <li>Python 2.2 compatibility fixes.</li>
2143 <li>unicode fixes in Element() and Comment() as well as XML(); unicode
2144 input wasn't properly being UTF-8 encoded.</li>
2145 </ul>
2146 </div>
2147 <div class="section" id="id216">
2148 <h1>0.5 (2005-04-08)</h1>
2149 <p>Initial public release.</p>
2150 </div>
2151 </div>
2152 <div class="footer">
2153 <hr class="footer" />
2154 Generated on: 2012-07-31.
2155
2156 </div>
2157 </body>
2158 </html>