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