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">
5
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
<meta name="generator" content="Docutils 0.6: http://docutils.sourceforge.net/" />
7
<title>lxml changelog</title>
11
<div class="document" id="lxml-changelog">
12
<h1 class="title">lxml changelog</h1>
14
<div class="section" id="id1">
15
<h1>2.2.6 (2010-03-02)</h1>
16
<div class="section" id="bugs-fixed">
19
<li>Fixed several Python 3 regressions by building with Cython 0.11.3.</li>
23
<div class="section" id="id2">
24
<h1>2.2.5 (2010-02-28)</h1>
25
<div class="section" id="features-added">
26
<h2>Features added</h2>
28
<li>Support for running XSLT extension elements on the input root node
29
(e.g. in a template matching on "/").</li>
32
<div class="section" id="id3">
35
<li>Crash in XPath evaluation when reading smart strings from a document
36
other than the original context document.</li>
37
<li>Support recent versions of html5lib by not requiring its
38
<tt class="docutils literal">XHTMLParser</tt> in <tt class="docutils literal">htmlparser.py</tt> anymore.</li>
39
<li>Manually instantiating the custom element classes in
40
<tt class="docutils literal">lxml.objectify</tt> could crash.</li>
41
<li>Invalid XML text characters were not rejected by the API when they
42
appeared in unicode strings directly after non-ASCII characters.</li>
43
<li>lxml.html.open_http_urllib() did not work in Python 3.</li>
44
<li>The functions <tt class="docutils literal">strip_tags()</tt> and <tt class="docutils literal">strip_elements()</tt> in
45
<tt class="docutils literal">lxml.etree</tt> did not remove all occurrences of a tag in all cases.</li>
46
<li>Crash in XSLT extension elements when the XSLT context node is not
51
<div class="section" id="id4">
52
<h1>2.2.4 (2009-11-11)</h1>
53
<div class="section" id="id5">
56
<li>Static build of libxml2/libxslt was broken.</li>
60
<div class="section" id="id6">
61
<h1>2.2.3 (2009-10-30)</h1>
62
<div class="section" id="id7">
63
<h2>Features added</h2>
65
<div class="section" id="id8">
68
<li>The <tt class="docutils literal">resolve_entities</tt> option did not work in the incremental feed
70
<li>Looking up and deleting attributes without a namespace could hit a
71
namespaced attribute of the same name instead.</li>
72
<li>Late errors during calls to <tt class="docutils literal">SubElement()</tt> (e.g. attribute related
73
ones) could leave a partially initialised element in the tree.</li>
74
<li>Modifying trees that contain parsed entity references could result
75
in an infinite loop.</li>
76
<li><tt class="docutils literal">ObjectifiedElement.__setattr__</tt> created an empty-string child
77
element when the attribute value was rejected as a
78
non-unicode/non-ascii string</li>
79
<li>Syntax errors in <tt class="docutils literal">lxml.cssselect</tt> could result in misleading error
81
<li>Invalid syntax in CSS expressions could lead to an infinite loop in
82
the parser of <tt class="docutils literal">lxml.cssselect</tt>.</li>
83
<li>CSS special character escapes were not properly handled in
84
<tt class="docutils literal">lxml.cssselect</tt>.</li>
85
<li>CSS Unicode escapes were not properly decoded in <tt class="docutils literal">lxml.cssselect</tt>.</li>
86
<li>Select options in HTML forms that had no explicit <tt class="docutils literal">value</tt>
87
attribute were not handled correctly. The HTML standard dictates
88
that their value is defined by their text content. This is now
89
supported by lxml.html.</li>
90
<li>XPath raised a TypeError when finding CDATA sections. This is now
92
<li>Calling <tt class="docutils literal">help(lxml.objectify)</tt> didn't work at the prompt.</li>
93
<li>The <tt class="docutils literal">ElementMaker</tt> in lxml.objectify no longer defines the default
94
namespaces when annotation is disabled.</li>
95
<li>Feed parser failed to honour the 'recover' option on parse errors.</li>
96
<li>Diverting the error logging to Python's logging system was broken.</li>
99
<div class="section" id="other-changes">
100
<h2>Other changes</h2>
103
<div class="section" id="id9">
104
<h1>2.2.2 (2009-06-21)</h1>
105
<div class="section" id="id10">
106
<h2>Features added</h2>
108
<li>New helper functions <tt class="docutils literal">strip_attributes()</tt>, <tt class="docutils literal">strip_elements()</tt>,
109
<tt class="docutils literal">strip_tags()</tt> in lxml.etree to remove attributes/subtrees/tags
113
<div class="section" id="id11">
116
<li>Namespace cleanup on subtree insertions could result in missing
117
namespace declarations (and potentially crashes) if the element
118
defining a namespace was deleted and the namespace was not used by
119
the top element of the inserted subtree but only in deeper subtrees.</li>
120
<li>Raising an exception from a parser target callback didn't always
121
terminate the parser.</li>
122
<li>Only {true, false, 1, 0} are accepted as the lexical representation for
123
BoolElement ({True, False, T, F, t, f} not any more), restoring lxml <= 2.0
127
<div class="section" id="id12">
128
<h2>Other changes</h2>
131
<div class="section" id="id13">
132
<h1>2.2.1 (2009-06-02)</h1>
133
<div class="section" id="id14">
134
<h2>Features added</h2>
136
<li>Injecting default attributes into a document during XML Schema
137
validation (also at parse time).</li>
138
<li>Pass <tt class="docutils literal">huge_tree</tt> parser option to disable parser security
139
restrictions imposed by libxml2 2.7.</li>
142
<div class="section" id="id15">
145
<li>The script for statically building libxml2 and libxslt didn't work
147
<li><tt class="docutils literal">XMLSchema()</tt> also passes invalid schema documents on to libxml2
148
for parsing (which could lead to a crash before release 2.6.24).</li>
151
<div class="section" id="id16">
152
<h2>Other changes</h2>
155
<div class="section" id="id17">
156
<h1>2.2 (2009-03-21)</h1>
157
<div class="section" id="id18">
158
<h2>Features added</h2>
160
<li>Support for <tt class="docutils literal">standalone</tt> flag in XML declaration through
161
<tt class="docutils literal">tree.docinfo.standalone</tt> and by passing <tt class="docutils literal">standalone=True/False</tt>
162
on serialisation.</li>
165
<div class="section" id="id19">
168
<li>Crash when parsing an XML Schema with external imports from a
173
<div class="section" id="beta4-2009-02-27">
174
<h1>2.2beta4 (2009-02-27)</h1>
175
<div class="section" id="id20">
176
<h2>Features added</h2>
178
<li>Support strings and instantiable Element classes as child arguments
179
to the constructor of custom Element classes.</li>
180
<li>GZip compression support for serialisation to files and file-like
184
<div class="section" id="id21">
187
<li>Deep-copying an ElementTree copied neither its sibling PIs and
188
comments nor its internal/external DTD subsets.</li>
189
<li>Soupparser failed on broken attributes without values.</li>
190
<li>Crash in XSLT when overwriting an already defined attribute using
191
<tt class="docutils literal">xsl:attribute</tt>.</li>
192
<li>Crash bug in exception handling code under Python 3. This was due
193
to a problem in Cython, not lxml itself.</li>
194
<li><tt class="docutils literal">lxml.html.FormElement._name()</tt> failed for non top-level forms.</li>
195
<li><tt class="docutils literal">TAG</tt> special attribute in constructor of custom Element classes
196
was evaluated incorrectly.</li>
199
<div class="section" id="id22">
200
<h2>Other changes</h2>
202
<li>Official support for Python 3.0.1.</li>
203
<li><tt class="docutils literal">Element.findtext()</tt> now returns an empty string instead of None
204
for Elements without text content.</li>
208
<div class="section" id="beta3-2009-02-17">
209
<h1>2.2beta3 (2009-02-17)</h1>
210
<div class="section" id="id23">
211
<h2>Features added</h2>
213
<li><tt class="docutils literal">XSLT.strparam()</tt> class method to wrap quoted string parameters
214
that require escaping.</li>
217
<div class="section" id="id24">
220
<li>Memory leak in XPath evaluators.</li>
221
<li>Crash when parsing indented XML in one thread and merging it with
222
other documents parsed in another thread.</li>
223
<li>Setting the <tt class="docutils literal">base</tt> attribute in <tt class="docutils literal">lxml.objectify</tt> from a unicode
225
<li>Fixes following changes in Python 3.0.1.</li>
226
<li>Minor fixes for Python 3.</li>
229
<div class="section" id="id25">
230
<h2>Other changes</h2>
232
<li>The global error log (which is copied into the exception log) is now
233
local to a thread, which fixes some race conditions.</li>
234
<li>More robust error handling on serialisation.</li>
238
<div class="section" id="beta2-2009-01-25">
239
<h1>2.2beta2 (2009-01-25)</h1>
240
<div class="section" id="id26">
243
<li>Potential memory leak on exception handling. This was due to a
244
problem in Cython, not lxml itself.</li>
245
<li><tt class="docutils literal">iter_links</tt> (and related link-rewriting functions) in
246
<tt class="docutils literal">lxml.html</tt> would interpret CSS like <tt class="docutils literal"><span class="pre">url("link")</span></tt> incorrectly
247
(treating the quotation marks as part of the link).</li>
248
<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
252
<div class="section" id="id27">
253
<h1>2.1.5 (2009-01-06)</h1>
254
<div class="section" id="id28">
257
<li>Potential memory leak on exception handling. This was due to a
258
problem in Cython, not lxml itself.</li>
259
<li>Failing import on systems that have an <tt class="docutils literal">io</tt> module.</li>
263
<div class="section" id="beta1-2008-12-12">
264
<h1>2.2beta1 (2008-12-12)</h1>
265
<div class="section" id="id29">
266
<h2>Features added</h2>
268
<li>Allow <tt class="docutils literal">lxml.html.diff.htmldiff</tt> to accept Element objects, not
269
just HTML strings.</li>
272
<div class="section" id="id30">
275
<li>Crash when using an XPath evaluator in multiple threads.</li>
276
<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>
279
<div class="section" id="id31">
280
<h2>Other changes</h2>
282
<li>Export <tt class="docutils literal">lxml.html.parse</tt>.</li>
286
<div class="section" id="id32">
287
<h1>2.1.4 (2008-12-12)</h1>
288
<div class="section" id="id33">
291
<li>Crash when using an XPath evaluator in multiple threads.</li>
295
<div class="section" id="id34">
296
<h1>2.0.11 (2008-12-12)</h1>
297
<div class="section" id="id35">
300
<li>Crash when using an XPath evaluator in multiple threads.</li>
304
<div class="section" id="alpha1-2008-11-23">
305
<h1>2.2alpha1 (2008-11-23)</h1>
306
<div class="section" id="id36">
307
<h2>Features added</h2>
309
<li>Support for XSLT result tree fragments in XPath/XSLT extension
311
<li>QName objects have new properties <tt class="docutils literal">namespace</tt> and <tt class="docutils literal">localname</tt>.</li>
312
<li>New options for exclusive C14N and C14N without comments.</li>
313
<li>Instantiating a custom Element classes creates a new Element.</li>
316
<div class="section" id="id37">
319
<li>XSLT didn't inherit the parse options of the input document.</li>
320
<li>0-bytes could slip through the API when used inside of Unicode
322
<li>With <tt class="docutils literal">lxml.html.clean.autolink</tt>, links with balanced parenthesis,
323
that end in a parenthesis, will be linked in their entirety (typical
324
with Wikipedia links).</li>
327
<div class="section" id="id38">
328
<h2>Other changes</h2>
331
<div class="section" id="id39">
332
<h1>2.1.3 (2008-11-17)</h1>
333
<div class="section" id="id40">
334
<h2>Features added</h2>
336
<div class="section" id="id41">
339
<li>Ref-count leaks when lxml enters a try-except statement while an
340
outside exception lives in sys.exc_*(). This was due to a problem in
341
Cython, not lxml itself.</li>
342
<li>Parser Unicode decoding errors could get swallowed by other
344
<li>Name/import errors in some Python modules.</li>
345
<li>Internal DTD subsets that did not specify a system or public ID were
346
not serialised and did not appear in the docinfo property of
348
<li>Fix a pre-Py3k warning when parsing from a gzip file in Py2.6.</li>
349
<li>Test suite fixes for libxml2 2.7.</li>
350
<li>Resolver.resolve_string() did not work for non-ASCII byte strings.</li>
351
<li>Resolver.resolve_file() was broken.</li>
352
<li>Overriding the parser encoding didn't work for many encodings.</li>
355
<div class="section" id="id42">
356
<h2>Other changes</h2>
359
<div class="section" id="id43">
360
<h1>2.0.10 (2008-11-17)</h1>
361
<div class="section" id="id44">
364
<li>Ref-count leaks when lxml enters a try-except statement while an
365
outside exception lives in sys.exc_*(). This was due to a problem in
366
Cython, not lxml itself.</li>
370
<div class="section" id="id45">
371
<h1>2.1.2 (2008-09-05)</h1>
372
<div class="section" id="id46">
373
<h2>Features added</h2>
375
<li>lxml.etree now tries to find the absolute path name of files when
376
parsing from a file-like object. This helps custom resolvers when
377
resolving relative URLs, as lixbml2 can prepend them with the path
378
of the source document.</li>
381
<div class="section" id="id47">
384
<li>Memory problem when passing documents between threads.</li>
385
<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
386
exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
389
<div class="section" id="id48">
390
<h2>Other changes</h2>
393
<div class="section" id="id49">
394
<h1>2.0.9 (2008-09-05)</h1>
395
<div class="section" id="id50">
398
<li>Memory problem when passing documents between threads.</li>
399
<li>Target parser did not honour the <tt class="docutils literal">recover</tt> option and raised an
400
exception instead of calling <tt class="docutils literal">.close()</tt> on the target.</li>
404
<div class="section" id="id51">
405
<h1>2.1.1 (2008-07-24)</h1>
406
<div class="section" id="id52">
407
<h2>Features added</h2>
409
<div class="section" id="id53">
412
<li>Crash when parsing XSLT stylesheets in a thread and using them in
414
<li>Encoding problem when including text with ElementInclude under
418
<div class="section" id="id54">
419
<h2>Other changes</h2>
422
<div class="section" id="id55">
423
<h1>2.0.8 (2008-07-24)</h1>
424
<div class="section" id="id56">
425
<h2>Features added</h2>
427
<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
428
with whitespace in URL attributes.</li>
431
<div class="section" id="id57">
434
<li>Crash when parsing XSLT stylesheets in a thread and using them in
436
<li>CSS selector parser dropped remaining expression after a function
437
with parameters.</li>
440
<div class="section" id="id58">
441
<h2>Other changes</h2>
444
<div class="section" id="id59">
445
<h1>2.1 (2008-07-09)</h1>
446
<div class="section" id="id60">
447
<h2>Features added</h2>
449
<li>Smart strings can be switched off in XPath (<tt class="docutils literal">smart_strings</tt>
450
keyword option).</li>
451
<li><tt class="docutils literal">lxml.html.rewrite_links()</tt> strips links to work around documents
452
with whitespace in URL attributes.</li>
455
<div class="section" id="id61">
458
<li>Custom resolvers were not used for XMLSchema includes/imports and
459
XInclude processing.</li>
460
<li>CSS selector parser dropped remaining expression after a function
461
with parameters.</li>
464
<div class="section" id="id62">
465
<h2>Other changes</h2>
467
<li><tt class="docutils literal">objectify.enableRecursiveStr()</tt> was removed, use
468
<tt class="docutils literal">objectify.enable_recursive_str()</tt> instead</li>
469
<li>Speed-up when running XSLTs on documents from other threads</li>
473
<div class="section" id="id63">
474
<h1>2.0.7 (2008-06-20)</h1>
475
<div class="section" id="id64">
476
<h2>Features added</h2>
478
<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
481
<div class="section" id="id65">
484
<li>Descending dot-separated classes in CSS selectors were not resolved
486
<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
487
<li>Potential threading problem in XInclude.</li>
488
<li>Crash in Element class lookup classes when the __init__() method of
489
the super class is not called from Python subclasses.</li>
492
<div class="section" id="id66">
493
<h2>Other changes</h2>
495
<li>Non-ASCII characters in attribute values are no longer escaped on
500
<div class="section" id="beta3-2008-06-19">
501
<h1>2.1beta3 (2008-06-19)</h1>
502
<div class="section" id="id67">
503
<h2>Features added</h2>
505
<li>Major overhaul of <tt class="docutils literal">tools/xpathgrep.py</tt> script.</li>
506
<li>Pickling <tt class="docutils literal">ElementTree</tt> objects in lxml.objectify.</li>
507
<li>Support for parsing from file-like objects that return unicode
509
<li>New function <tt class="docutils literal">etree.cleanup_namespaces(el)</tt> that removes unused
510
namespace declarations from a (sub)tree (experimental).</li>
511
<li>XSLT results support the buffer protocol in Python 3.</li>
512
<li>Polymorphic functions in <tt class="docutils literal">lxml.html</tt> that accept either a tree or
513
a parsable string will return either a UTF-8 encoded byte string, a
514
unicode string or a tree, based on the type of the input.
515
Previously, the result was always a byte string or a tree.</li>
516
<li>Support for Python 2.6 and 3.0 beta.</li>
517
<li>File name handling now uses a heuristic to convert between byte
518
strings (usually filenames) and unicode strings (usually URLs).</li>
519
<li>Parsing from a plain file object frees the GIL under Python 2.x.</li>
520
<li>Running <tt class="docutils literal">iterparse()</tt> on a plain file (or filename) frees the GIL
521
on reading under Python 2.x.</li>
522
<li>Conversion functions <tt class="docutils literal">html_to_xhtml()</tt> and <tt class="docutils literal">xhtml_to_html()</tt> in
523
lxml.html (experimental).</li>
524
<li>Most features in lxml.html work for XHTML namespaced tag names
528
<div class="section" id="id68">
531
<li><tt class="docutils literal">ElementTree.parse()</tt> didn't handle target parser result.</li>
532
<li>Crash in Element class lookup classes when the __init__() method of
533
the super class is not called from Python subclasses.</li>
534
<li>A number of problems related to unicode/byte string conversion of
535
filenames and error messages were fixed.</li>
536
<li>Building on MacOS-X now passes the "flat_namespace" option to the C
537
compiler, which reportedly prevents build quirks and crashes on this
539
<li>Windows build was broken.</li>
540
<li>Rare crash when serialising to a file object with certain encodings.</li>
543
<div class="section" id="id69">
544
<h2>Other changes</h2>
546
<li>Non-ASCII characters in attribute values are no longer escaped on
548
<li>Passing non-ASCII byte strings or invalid unicode strings as .tag,
549
namespaces, etc. will result in a ValueError instead of an
550
AssertionError (just like the tag well-formedness check).</li>
551
<li>Up to several times faster attribute access (i.e. tree traversal) in
556
<div class="section" id="id70">
557
<h1>2.0.6 (2008-05-31)</h1>
558
<div class="section" id="id71">
559
<h2>Features added</h2>
561
<div class="section" id="id72">
564
<li>Incorrect evaluation of <tt class="docutils literal"><span class="pre">el.find("tag[child]")</span></tt>.</li>
565
<li>Windows build was broken.</li>
566
<li>Moving a subtree from a document created in one thread into a
567
document of another thread could crash when the rest of the source
568
document is deleted while the subtree is still in use.</li>
569
<li>Rare crash when serialising to a file object with certain encodings.</li>
572
<div class="section" id="id73">
573
<h2>Other changes</h2>
575
<li>lxml should now build without problems on MacOS-X.</li>
579
<div class="section" id="beta2-2008-05-02">
580
<h1>2.1beta2 (2008-05-02)</h1>
581
<div class="section" id="id74">
582
<h2>Features added</h2>
584
<li>All parse functions in lxml.html take a <tt class="docutils literal">parser</tt> keyword argument.</li>
585
<li>lxml.html has a new parser class <tt class="docutils literal">XHTMLParser</tt> and a module
586
attribute <tt class="docutils literal">xhtml_parser</tt> that provide XML parsers that are
587
pre-configured for the lxml.html package.</li>
590
<div class="section" id="id75">
593
<li>Moving a subtree from a document created in one thread into a
594
document of another thread could crash when the rest of the source
595
document is deleted while the subtree is still in use.</li>
596
<li>Passing an nsmap when creating an Element will no longer strip
597
redundantly defined namespace URIs. This prevented the definition
598
of more than one prefix for a namespace on the same Element.</li>
601
<div class="section" id="id76">
602
<h2>Other changes</h2>
604
<li>If the default namespace is redundantly defined with a prefix on the
605
same Element, the prefix will now be preferred for subelements and
606
attributes. This allows users to work around a problem in libxml2
607
where attributes from the default namespace could serialise without
608
a prefix even when they appear on an Element with a different
609
namespace (i.e. they would end up in the wrong namespace).</li>
613
<div class="section" id="id77">
614
<h1>2.0.5 (2008-05-01)</h1>
615
<div class="section" id="id78">
616
<h2>Features added</h2>
618
<div class="section" id="id79">
621
<li>Resolving to a filename in custom resolvers didn't work.</li>
622
<li>lxml did not honour libxslt's second error state "STOPPED", which
623
let some XSLT errors pass silently.</li>
624
<li>Memory leak in Schematron with libxml2 >= 2.6.31.</li>
627
<div class="section" id="id80">
628
<h2>Other changes</h2>
631
<div class="section" id="beta1-2008-04-15">
632
<h1>2.1beta1 (2008-04-15)</h1>
633
<div class="section" id="id81">
634
<h2>Features added</h2>
636
<li>Error logging in Schematron (requires libxml2 2.6.32 or later).</li>
637
<li>Parser option <tt class="docutils literal">strip_cdata</tt> for normalising or keeping CDATA
638
sections. Defaults to <tt class="docutils literal">True</tt> as before, thus replacing CDATA
639
sections by their text content.</li>
640
<li><tt class="docutils literal">CDATA()</tt> factory to wrap string content as CDATA section.</li>
643
<div class="section" id="id82">
646
<li>Resolving to a filename in custom resolvers didn't work.</li>
647
<li>lxml did not honour libxslt's second error state "STOPPED", which
648
let some XSLT errors pass silently.</li>
649
<li>Memory leak in Schematron with libxml2 >= 2.6.31.</li>
650
<li>lxml.etree accepted non well-formed namespace prefix names.</li>
653
<div class="section" id="id83">
654
<h2>Other changes</h2>
656
<li>Major cleanup in internal <tt class="docutils literal">moveNodeToDocument()</tt> function, which
657
takes care of namespace cleanup when moving elements between
658
different namespace contexts.</li>
659
<li>New Elements created through the <tt class="docutils literal">makeelement()</tt> method of an HTML
660
parser or through lxml.html now end up in a new HTML document
661
(doctype HTML 4.01 Transitional) instead of a generic XML document.
662
This mostly impacts the serialisation and the availability of a DTD
667
<div class="section" id="id84">
668
<h1>2.0.4 (2008-04-13)</h1>
669
<div class="section" id="id85">
670
<h2>Features added</h2>
672
<div class="section" id="id86">
675
<li>Hanging thread in conjunction with GTK threading.</li>
676
<li>Crash bug in iterparse when moving elements into other documents.</li>
677
<li>HTML elements' <tt class="docutils literal">.cssselect()</tt> method was broken.</li>
678
<li><tt class="docutils literal"><span class="pre">ElementTree.find*()</span></tt> didn't accept QName objects.</li>
681
<div class="section" id="id87">
682
<h2>Other changes</h2>
685
<div class="section" id="alpha1-2008-03-27">
686
<h1>2.1alpha1 (2008-03-27)</h1>
687
<div class="section" id="id88">
688
<h2>Features added</h2>
690
<li>New event types 'comment' and 'pi' in <tt class="docutils literal">iterparse()</tt>.</li>
691
<li><tt class="docutils literal">XSLTAccessControl</tt> instances have a property <tt class="docutils literal">options</tt> that
692
returns a dict of access configuration options.</li>
693
<li>Constant instances <tt class="docutils literal">DENY_ALL</tt> and <tt class="docutils literal">DENY_WRITE</tt> on
694
<tt class="docutils literal">XSLTAccessControl</tt> class.</li>
695
<li>Extension elements for XSLT (experimental!)</li>
696
<li><tt class="docutils literal">Element.base</tt> property returns the xml:base or HTML base URL of
698
<li><tt class="docutils literal">docinfo.URL</tt> property is writable.</li>
701
<div class="section" id="id89">
704
<li>Default encoding for plain text serialisation was different from
705
that of XML serialisation (UTF-8 instead of ASCII).</li>
708
<div class="section" id="id90">
709
<h2>Other changes</h2>
711
<li>Minor API speed-ups.</li>
712
<li>The benchmark suite now uses tail text in the trees, which makes the
713
absolute numbers incomparable to previous results.</li>
714
<li>Generating the HTML documentation now requires <a class="reference external" href="http://pygments.org/">Pygments</a>, which is
715
used to enable syntax highlighting for the doctest examples.</li>
717
<p>Most long-time deprecated functions and methods were removed:</p>
719
<li><p class="first"><tt class="docutils literal">etree.clearErrorLog()</tt>, use <tt class="docutils literal">etree.clear_error_log()</tt></p>
721
<li><p class="first"><tt class="docutils literal">etree.useGlobalPythonLog()</tt>, use
722
<tt class="docutils literal">etree.use_global_python_log()</tt></p>
724
<li><p class="first"><tt class="docutils literal">etree.ElementClassLookup.setFallback()</tt>, use
725
<tt class="docutils literal">etree.ElementClassLookup.set_fallback()</tt></p>
727
<li><p class="first"><tt class="docutils literal">etree.getDefaultParser()</tt>, use <tt class="docutils literal">etree.get_default_parser()</tt></p>
729
<li><p class="first"><tt class="docutils literal">etree.setDefaultParser()</tt>, use <tt class="docutils literal">etree.set_default_parser()</tt></p>
731
<li><p class="first"><tt class="docutils literal">etree.setElementClassLookup()</tt>, use
732
<tt class="docutils literal">etree.set_element_class_lookup()</tt></p>
733
<p>Note that <tt class="docutils literal">parser.setElementClassLookup()</tt> has not been removed
734
yet, although <tt class="docutils literal">parser.set_element_class_lookup()</tt> should be used
737
<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespace()</tt>, use
738
<tt class="docutils literal">xpath_evaluator.register_namespace()</tt></p>
740
<li><p class="first"><tt class="docutils literal">xpath_evaluator.registerNamespaces()</tt>, use
741
<tt class="docutils literal">xpath_evaluator.register_namespaces()</tt></p>
743
<li><p class="first"><tt class="docutils literal">objectify.setPytypeAttributeTag</tt>, use
744
<tt class="docutils literal">objectify.set_pytype_attribute_tag</tt></p>
746
<li><p class="first"><tt class="docutils literal">objectify.setDefaultParser()</tt>, use
747
<tt class="docutils literal">objectify.set_default_parser()</tt></p>
752
<div class="section" id="id91">
753
<h1>2.0.3 (2008-03-26)</h1>
754
<div class="section" id="id92">
755
<h2>Features added</h2>
757
<li>soupparser.parse() allows passing keyword arguments on to
759
<li><tt class="docutils literal">fromstring()</tt> method in <tt class="docutils literal">lxml.html.soupparser</tt>.</li>
762
<div class="section" id="id93">
765
<li><tt class="docutils literal">lxml.html.diff</tt> didn't treat empty tags properly (e.g.,
766
<tt class="docutils literal"><br></tt>).</li>
767
<li>Handle entity replacements correctly in target parser.</li>
768
<li>Crash when using <tt class="docutils literal">iterparse()</tt> with XML Schema validation.</li>
769
<li>The BeautifulSoup parser (soupparser.py) did not replace entities,
770
which made them turn up in text content.</li>
771
<li>Attribute assignment of custom PyTypes in objectify could fail to
772
correctly serialise the value to a string.</li>
775
<div class="section" id="id94">
776
<h2>Other changes</h2>
778
<li><tt class="docutils literal">lxml.html.ElementSoup</tt> was replaced by a new module
779
<tt class="docutils literal">lxml.html.soupparser</tt> with a more consistent API. The old module
780
remains for compatibility with ElementTree's own ElementSoup module.</li>
781
<li>Setting the XSLT_CONFIG and XML2_CONFIG environment variables at
782
build time will let setup.py pick up the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> and
783
<tt class="docutils literal"><span class="pre">xslt-config</span></tt> scripts from the supplied path name.</li>
784
<li>Passing <tt class="docutils literal"><span class="pre">--with-xml2-config=/path/to/xml2-config</span></tt> to setup.py will
785
override the <tt class="docutils literal"><span class="pre">xml2-config</span></tt> script that is used to determine the C
786
compiler options. The same applies for the <tt class="docutils literal"><span class="pre">--with-xslt-config</span></tt>
791
<div class="section" id="id95">
792
<h1>2.0.2 (2008-02-22)</h1>
793
<div class="section" id="id96">
794
<h2>Features added</h2>
796
<li>Support passing <tt class="docutils literal">base_url</tt> to file parser functions to override
797
the filename of the file(-like) object.</li>
800
<div class="section" id="id97">
803
<li>The prefix for objectify's pytype namespace was missing from the set
804
of default prefixes.</li>
805
<li>Memory leak in Schematron (fixed only for libxml2 2.6.31+).</li>
806
<li>Error type names in RelaxNG were reported incorrectly.</li>
807
<li>Slice deletion bug fixed in objectify.</li>
810
<div class="section" id="id98">
811
<h2>Other changes</h2>
813
<li>Enabled doctests for some Python modules (especially <tt class="docutils literal">lxml.html</tt>).</li>
814
<li>Add a <tt class="docutils literal">method</tt> argument to <tt class="docutils literal">lxml.html.tostring()</tt>
815
(<tt class="docutils literal"><span class="pre">method="xml"</span></tt> for XHTML output).</li>
816
<li>Make it clearer that methods like <tt class="docutils literal">lxml.html.fromstring()</tt> take a
817
<tt class="docutils literal">base_url</tt> argument.</li>
821
<div class="section" id="id99">
822
<h1>2.0.1 (2008-02-13)</h1>
823
<div class="section" id="id100">
824
<h2>Features added</h2>
826
<li>Child iteration in <tt class="docutils literal">lxml.pyclasslookup</tt>.</li>
827
<li>Loads of new docstrings reflect the signature of functions and
828
methods to make them visible in API docs and <tt class="docutils literal">help()</tt></li>
831
<div class="section" id="id101">
834
<li>The module <tt class="docutils literal">lxml.html.builder</tt> was duplicated as
835
<tt class="docutils literal">lxml.htmlbuilder</tt></li>
836
<li>Form elements would return None for <tt class="docutils literal">form.fields.keys()</tt> if there
837
was an unnamed input field. Now unnamed input fields are completely
839
<li>Setting an element slice in objectify could insert slice-overlapping
840
elements at the wrong position.</li>
843
<div class="section" id="id102">
844
<h2>Other changes</h2>
846
<li>The generated API documentation was cleaned up and disburdened from
847
non-public classes etc.</li>
848
<li>The previously public module <tt class="docutils literal">lxml.html.setmixin</tt> was renamed to
849
<tt class="docutils literal">lxml.html._setmixin</tt> as it is not an official part of lxml. If
850
you want to use it, feel free to copy it over to your own source
852
<li>Passing <tt class="docutils literal"><span class="pre">--with-xslt-config=/path/to/xslt-config</span></tt> to setup.py will
853
override the <tt class="docutils literal"><span class="pre">xslt-config</span></tt> script that is used to determine the C
854
compiler options.</li>
858
<div class="section" id="id103">
859
<h1>2.0 (2008-02-01)</h1>
860
<div class="section" id="id104">
861
<h2>Features added</h2>
863
<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
864
serialise to unicode. The <tt class="docutils literal">tounicode()</tt> function is now
866
<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> can parse from StringIO.</li>
867
<li><tt class="docutils literal">makeparser()</tt> function in <tt class="docutils literal">lxml.objectify</tt> to create a new
868
parser with the usual objectify setup.</li>
869
<li>Plain ASCII XPath string results are no longer forced into unicode
870
objects as in 2.0beta1, but are returned as plain strings as before.</li>
871
<li>All XPath string results are 'smart' objects that have a
872
<tt class="docutils literal">getparent()</tt> method to retrieve their parent Element.</li>
873
<li><tt class="docutils literal">with_tail</tt> option in serialiser functions.</li>
874
<li>More accurate exception messages in validator creation.</li>
875
<li>Parse-time XML schema validation (<tt class="docutils literal">schema</tt> parser keyword).</li>
876
<li>XPath string results of the <tt class="docutils literal">text()</tt> function and attribute
877
selection make their Element container accessible through a
878
<tt class="docutils literal">getparent()</tt> method. As a side-effect, they are now always
879
unicode objects (even ASCII strings).</li>
880
<li><tt class="docutils literal">XSLT</tt> objects are usable in any thread - at the cost of a deep
881
copy if they were not created in that thread.</li>
882
<li>Invalid entity names and character references will be rejected by
883
the <tt class="docutils literal">Entity()</tt> factory.</li>
884
<li><tt class="docutils literal">entity.text</tt> returns the textual representation of the entity,
885
e.g. <tt class="docutils literal">&amp;</tt>.</li>
886
<li>New properties <tt class="docutils literal">position</tt> and <tt class="docutils literal">code</tt> on ParseError exception (as
888
<li>Rich comparison of <tt class="docutils literal">element.attrib</tt> proxies.</li>
889
<li>ElementTree compatible TreeBuilder class.</li>
890
<li>Use default prefixes for some common XML namespaces.</li>
891
<li><tt class="docutils literal">lxml.html.clean.Cleaner</tt> now allows for a <tt class="docutils literal">host_whitelist</tt>, and
892
two overridable methods: <tt class="docutils literal">allow_embedded_url(el, url)</tt> and the
893
more general <tt class="docutils literal">allow_element(el)</tt>.</li>
894
<li>Extended slicing of Elements as in <tt class="docutils literal"><span class="pre">element[1:-1:2]</span></tt>, both in
895
etree and in objectify</li>
896
<li>Resolvers can now provide a <tt class="docutils literal">base_url</tt> keyword argument when
897
resolving a document as string data.</li>
898
<li>When using <tt class="docutils literal">lxml.doctestcompare</tt> you can give the doctest option
899
<tt class="docutils literal">NOPARSE_MARKUP</tt> (like <tt class="docutils literal"># doctest: +NOPARSE_MARKUP</tt>) to suppress
900
the special checking for one test.</li>
901
<li>Separate <tt class="docutils literal">feed_error_log</tt> property for the feed parser interface.
902
The normal parser interface and <tt class="docutils literal">iterparse</tt> continue to use
903
<tt class="docutils literal">error_log</tt>.</li>
904
<li>The normal parsers and the feed parser interface are now separated
905
and can be used concurrently on the same parser instance.</li>
906
<li><tt class="docutils literal">fromstringlist()</tt> and <tt class="docutils literal">tostringlist()</tt> functions as in
908
<li><tt class="docutils literal">iterparse()</tt> accepts an <tt class="docutils literal">html</tt> boolean keyword argument for
909
parsing with the HTML parser (note that this interface may be
910
subject to change)</li>
911
<li>Parsers accept an <tt class="docutils literal">encoding</tt> keyword argument that overrides the encoding
912
of the parsed documents.</li>
913
<li>New C-API function <tt class="docutils literal">hasChild()</tt> to test for children</li>
914
<li><tt class="docutils literal">annotate()</tt> function in objectify can annotate with Python types and XSI
915
types in one step. Accompanied by <tt class="docutils literal">xsiannotate()</tt> and <tt class="docutils literal">pyannotate()</tt>.</li>
916
<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
917
argument <tt class="docutils literal">method</tt> that can be one of 'xml' (or None), 'html' or 'text' to
918
serialise as XML, HTML or plain text content.</li>
919
<li><tt class="docutils literal">iterfind()</tt> method on Elements returns an iterator equivalent to
920
<tt class="docutils literal">findall()</tt></li>
921
<li><tt class="docutils literal">itertext()</tt> method on Elements</li>
922
<li>Setting a QName object as value of the .text property or as an attribute
923
will resolve its prefix in the respective context</li>
924
<li>ElementTree-like parser target interface as described in
925
<a class="reference external" href="http://effbot.org/elementtree/elementtree-xmlparser.htm">http://effbot.org/elementtree/elementtree-xmlparser.htm</a></li>
926
<li>ElementTree-like feed parser interface on XMLParser and HTMLParser
927
(<tt class="docutils literal">feed()</tt> and <tt class="docutils literal">close()</tt> methods)</li>
928
<li>Reimplemented <tt class="docutils literal">objectify.E</tt> for better performance and improved
929
integration with objectify. Provides extended type support based on
930
registered PyTypes.</li>
931
<li>XSLT objects now support deep copying</li>
932
<li>New <tt class="docutils literal">makeSubElement()</tt> C-API function that allows creating a new
933
subelement straight with text, tail and attributes.</li>
934
<li>XPath extension functions can now access the current context node
935
(<tt class="docutils literal">context.context_node</tt>) and use a context dictionary
936
(<tt class="docutils literal">context.eval_context</tt>) from the context provided in their first
938
<li>HTML tag soup parser based on BeautifulSoup in <tt class="docutils literal">lxml.html.ElementSoup</tt></li>
939
<li>New module <tt class="docutils literal">lxml.doctestcompare</tt> by Ian Bicking for writing simplified
940
doctests based on XML/HTML output. Use by importing <tt class="docutils literal">lxml.usedoctest</tt> or
941
<tt class="docutils literal">lxml.html.usedoctest</tt> from within a doctest.</li>
942
<li>New module <tt class="docutils literal">lxml.cssselect</tt> by Ian Bicking for selecting Elements with CSS
944
<li>New package <tt class="docutils literal">lxml.html</tt> written by Ian Bicking for advanced HTML
946
<li>Namespace class setup is now local to the <tt class="docutils literal">ElementNamespaceClassLookup</tt>
947
instance and no longer global.</li>
948
<li>Schematron validation (incomplete in libxml2)</li>
949
<li>Additional <tt class="docutils literal">stringify</tt> argument to <tt class="docutils literal">objectify.PyType()</tt> takes a
950
conversion function to strings to support setting text values from arbitrary
952
<li>Entity support through an <tt class="docutils literal">Entity</tt> factory and element classes. XML
953
parsers now have a <tt class="docutils literal">resolve_entities</tt> keyword argument that can be set to
954
False to keep entities in the document.</li>
955
<li><tt class="docutils literal">column</tt> field on error log entries to accompany the <tt class="docutils literal">line</tt> field</li>
956
<li>Error specific messages in XPath parsing and evaluation
957
NOTE: for evaluation errors, you will now get an XPathEvalError instead of
958
an XPathSyntaxError. To catch both, you can except on <tt class="docutils literal">XPathError</tt></li>
959
<li>The regular expression functions in XPath now support passing a node-set
960
instead of a string</li>
961
<li>Extended type annotation in objectify: new <tt class="docutils literal">xsiannotate()</tt> function</li>
962
<li>EXSLT RegExp support in standard XPath (not only XSLT)</li>
965
<div class="section" id="id105">
968
<li>Missing import in <tt class="docutils literal">lxml.html.clean</tt>.</li>
969
<li>Some Python 2.4-isms prevented lxml from building/running under
971
<li>XPath on ElementTrees could crash when selecting the virtual root
972
node of the ElementTree.</li>
973
<li>Compilation <tt class="docutils literal"><span class="pre">--without-threading</span></tt> was buggy in alpha5/6.</li>
974
<li>Memory leak in the <tt class="docutils literal">parse()</tt> function.</li>
975
<li>Minor bugs in XSLT error message formatting.</li>
976
<li>Result document memory leak in target parser.</li>
977
<li>Target parser failed to report comments.</li>
978
<li>In the <tt class="docutils literal">lxml.html</tt> <tt class="docutils literal">iter_links</tt> method, links in <tt class="docutils literal"><object></tt>
979
tags weren't recognized. (Note: plugin-specific link parameters
980
still aren't recognized.) Also, the <tt class="docutils literal"><embed></tt> tag, though not
981
standard, is now included in <tt class="docutils literal">lxml.html.defs.special_inline_tags</tt>.</li>
982
<li>Using custom resolvers on XSLT stylesheets parsed from a string
983
could request ill-formed URLs.</li>
984
<li>With <tt class="docutils literal">lxml.doctestcompare</tt> if you do <tt class="docutils literal"><tag <span class="pre">xmlns="..."></span></tt> in your
985
output, it will then be namespace-neutral (before the ellipsis was
986
treated as a real namespace).</li>
987
<li>AttributeError in feed parser on parse errors</li>
988
<li>XML feed parser setup problem</li>
989
<li>Type annotation for unicode strings in <tt class="docutils literal">DataElement()</tt></li>
990
<li>lxml failed to serialise namespace declarations of elements other than the
991
root node of a tree</li>
992
<li>Race condition in XSLT where the resolver context leaked between concurrent
994
<li>lxml.etree did not check tag/attribute names</li>
995
<li>The XML parser did not report undefined entities as error</li>
996
<li>The text in exceptions raised by XML parsers, validators and XPath
997
evaluators now reports the first error that occurred instead of the last</li>
998
<li>Passing '' as XPath namespace prefix did not raise an error</li>
999
<li>Thread safety in XPath evaluators</li>
1002
<div class="section" id="id106">
1003
<h2>Other changes</h2>
1005
<li>Exceptions carry only the part of the error log that is related to
1006
the operation that caused the error.</li>
1007
<li><tt class="docutils literal">XMLSchema()</tt> and <tt class="docutils literal">RelaxNG()</tt> now enforce passing the source
1008
file/filename through the <tt class="docutils literal">file</tt> keyword argument.</li>
1009
<li>The test suite now skips most doctests under Python 2.3.</li>
1010
<li><tt class="docutils literal">make clean</tt> no longer removes the .c files (use <tt class="docutils literal">make
1011
realclean</tt> instead)</li>
1012
<li>Minor performance tweaks for Element instantiation and subelement
1014
<li>Various places in the XPath, XSLT and iteration APIs now require
1015
keyword-only arguments.</li>
1016
<li>The argument order in <tt class="docutils literal">element.itersiblings()</tt> was changed to
1017
match the order used in all other iteration methods. The second
1018
argument ('preceding') is now a keyword-only argument.</li>
1019
<li>The <tt class="docutils literal">getiterator()</tt> method on Elements and ElementTrees was
1020
reverted to return an iterator as it did in lxml 1.x. The ET API
1021
specification allows it to return either a sequence or an iterator,
1022
and it traditionally returned a sequence in ET and an iterator in
1023
lxml. However, it is now deprecated in favour of the <tt class="docutils literal">iter()</tt>
1024
method, which should be used in new code wherever possible.</li>
1025
<li>The 'pretty printed' serialisation of ElementTree objects now
1026
inserts newlines at the root level between processing instructions,
1027
comments and the root tag.</li>
1028
<li>A 'pretty printed' serialisation is now terminated with a newline.</li>
1029
<li>Second argument to <tt class="docutils literal">lxml.etree.Extension()</tt> helper is no longer
1030
required, third argument is now a keyword-only argument <tt class="docutils literal">ns</tt>.</li>
1031
<li><tt class="docutils literal">lxml.html.tostring</tt> takes an <tt class="docutils literal">encoding</tt> argument.</li>
1032
<li>The module source files were renamed to "lxml.*.pyx", such as
1033
"lxml.etree.pyx". This was changed for consistency with the way
1034
Pyrex commonly handles package imports. The main effect is that
1035
classes now know about their fully qualified class name, including
1036
the package name of their module.</li>
1037
<li>Keyword-only arguments in some API functions, especially in the
1038
parsers and serialisers.</li>
1039
<li>Tag name validation in lxml.etree (and lxml.html) now distinguishes
1040
between HTML tags and XML tags based on the parser that was used to
1041
parse or create them. HTML tags no longer reject any non-ASCII
1042
characters in tag names but only spaces and the special characters
1043
<tt class="docutils literal"><span class="pre"><>&/"'</span></tt>.</li>
1044
<li>lxml.etree now emits a warning if you use XPath with libxml2 2.6.27
1045
(which can crash on certain XPath errors)</li>
1046
<li>Type annotation in objectify now preserves the already annotated type by
1047
default to prevent loosing type information that is already there.</li>
1048
<li><tt class="docutils literal">element.getiterator()</tt> returns a list, use <tt class="docutils literal">element.iter()</tt> to retrieve
1049
an iterator (ElementTree 1.3 compatible behaviour)</li>
1050
<li>objectify.PyType for None is now called "NoneType"</li>
1051
<li><tt class="docutils literal">el.getiterator()</tt> renamed to <tt class="docutils literal">el.iter()</tt>, following ElementTree 1.3 -
1052
original name is still available as alias</li>
1053
<li>In the public C-API, <tt class="docutils literal">findOrBuildNodeNs()</tt> was replaced by the more
1054
generic <tt class="docutils literal">findOrBuildNodeNsPrefix</tt></li>
1055
<li>Major refactoring in XPath/XSLT extension function code</li>
1056
<li>Network access in parsers disabled by default</li>
1060
<div class="section" id="id107">
1061
<h1>1.3.6 (2007-10-29)</h1>
1062
<div class="section" id="id108">
1065
<li>Backported decref crash fix from 2.0</li>
1066
<li>Well hidden free-while-in-use crash bug in ObjectPath</li>
1069
<div class="section" id="id109">
1070
<h2>Other changes</h2>
1072
<li>The test suites now run <tt class="docutils literal">gc.collect()</tt> in the <tt class="docutils literal">tearDown()</tt>
1073
methods. While this makes them take a lot longer to run, it also
1074
makes it easier to link a specific test to garbage collection
1075
problems that would otherwise appear in later tests.</li>
1079
<div class="section" id="id110">
1080
<h1>1.3.5 (2007-10-22)</h1>
1081
<div class="section" id="id111">
1082
<h2>Features added</h2>
1084
<div class="section" id="id112">
1087
<li>lxml.etree could crash when adding more than 10000 namespaces to a
1089
<li>lxml failed to serialise namespace declarations of elements other
1090
than the root node of a tree</li>
1094
<div class="section" id="id113">
1095
<h1>1.3.4 (2007-08-30)</h1>
1096
<div class="section" id="id114">
1097
<h2>Features added</h2>
1099
<li>The <tt class="docutils literal">ElementMaker</tt> in <tt class="docutils literal">lxml.builder</tt> now accepts the keyword arguments
1100
<tt class="docutils literal">namespace</tt> and <tt class="docutils literal">nsmap</tt> to set a namespace and nsmap for the Elements it
1102
<li>The <tt class="docutils literal">docinfo</tt> on ElementTree objects has new properties <tt class="docutils literal">internalDTD</tt>
1103
and <tt class="docutils literal">externalDTD</tt> that return a DTD object for the internal or external
1104
subset of the document respectively.</li>
1105
<li>Serialising an ElementTree now includes any internal DTD subsets that are
1106
part of the document, as well as comments and PIs that are siblings of the
1110
<div class="section" id="id115">
1113
<li>Parsing with the <tt class="docutils literal">no_network</tt> option could fail</li>
1116
<div class="section" id="id116">
1117
<h2>Other changes</h2>
1119
<li>lxml now raises a TagNameWarning about tag names containing ':' instead of
1120
an Error as 1.3.3 did. The reason is that a number of projects currently
1121
misuse the previous lack of tag name validation to generate namespace
1122
prefixes without declaring namespaces. Apart from the danger of generating
1123
broken XML this way, it also breaks most of the namespace-aware tools in
1124
XML, including XPath, XSLT and validation. lxml 1.3.x will continue to
1125
support this bug with a Warning, while lxml 2.0 will be strict about
1126
well-formed tag names (not only regarding ':').</li>
1127
<li>Serialising an Element no longer includes its comment and PI siblings (only
1128
ElementTree serialisation includes them).</li>
1132
<div class="section" id="id117">
1133
<h1>1.3.3 (2007-07-26)</h1>
1134
<div class="section" id="id118">
1135
<h2>Features added</h2>
1137
<li>ElementTree compatible parser <tt class="docutils literal">ETCompatXMLParser</tt> strips processing
1138
instructions and comments while parsing XML</li>
1139
<li>Parsers now support stripping PIs (keyword argument 'remove_pis')</li>
1140
<li><tt class="docutils literal">etree.fromstring()</tt> now supports parsing both HTML and XML, depending on
1141
the parser you pass.</li>
1142
<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>
1145
<div class="section" id="id119">
1148
<li>Parsing from Python Unicode strings failed on some platforms</li>
1149
<li><tt class="docutils literal">Element()</tt> did not raise an exception on tag names containing ':'</li>
1150
<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
1151
<tt class="docutils literal">ProcessingInstruction</tt> as tags. It also accepts <tt class="docutils literal">Element</tt> now.</li>
1155
<div class="section" id="id120">
1156
<h1>1.3.2 (2007-07-03)</h1>
1157
<div class="section" id="id121">
1158
<h2>Features added</h2>
1160
<div class="section" id="id122">
1163
<li>"deallocating None" crash bug</li>
1167
<div class="section" id="id123">
1168
<h1>1.3.1 (2007-07-02)</h1>
1169
<div class="section" id="id124">
1170
<h2>Features added</h2>
1172
<li>objectify.DataElement now supports setting values from existing data
1173
elements (not just plain Python types) and reuses defined namespaces etc.</li>
1174
<li>E-factory support for lxml.objectify (<tt class="docutils literal">objectify.E</tt>)</li>
1177
<div class="section" id="id125">
1180
<li>Better way to prevent crashes in Element proxy cleanup code</li>
1181
<li>objectify.DataElement didn't set up None value correctly</li>
1182
<li>objectify.DataElement didn't check the value against the provided type hints</li>
1183
<li>Reference-counting bug in <tt class="docutils literal">Element.attrib.pop()</tt></li>
1187
<div class="section" id="id126">
1188
<h1>1.3 (2007-06-24)</h1>
1189
<div class="section" id="id127">
1190
<h2>Features added</h2>
1192
<li>Module <tt class="docutils literal">lxml.pyclasslookup</tt> module implements an Element class lookup
1193
scheme that can access the entire tree in read-only mode to help determining
1194
a suitable Element class</li>
1195
<li>Parsers take a <tt class="docutils literal">remove_comments</tt> keyword argument that skips over comments</li>
1196
<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>
1197
<li><tt class="docutils literal">Element.addnext(el)</tt> and <tt class="docutils literal">Element.addprevious(el)</tt> methods to support
1198
adding processing instructions and comments around the root node</li>
1199
<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>
1200
<li>Extended type annotation in objectify: cleaner annotation namespace setup
1201
plus new <tt class="docutils literal">deannotate()</tt> function</li>
1202
<li>Support for custom Element class instantiation in lxml.sax: passing a
1203
<tt class="docutils literal">makeelement</tt> function to the ElementTreeContentHandler will reuse the
1204
lookup context of that function</li>
1205
<li>'.' represents empty ObjectPath (identity)</li>
1206
<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>
1207
<li><tt class="docutils literal">collectAttributes()</tt> C-function to build a list of attribute
1208
keys/values/items for a libxml2 node</li>
1209
<li><tt class="docutils literal">DTD</tt> validator class (like <tt class="docutils literal">RelaxNG</tt> and <tt class="docutils literal">XMLSchema</tt>)</li>
1210
<li>HTML generator helpers by Fredrik Lundh in <tt class="docutils literal">lxml.htmlbuilder</tt></li>
1211
<li><tt class="docutils literal">ElementMaker</tt> XML generator by Fredrik Lundh in <tt class="docutils literal">lxml.builder.E</tt></li>
1212
<li>Support for pickeling <tt class="docutils literal">objectify.ObjectifiedElement</tt> objects to XML</li>
1213
<li><tt class="docutils literal">update()</tt> method on Element.attrib</li>
1214
<li>Optimised replacement for libxml2's _xmlReconsiliateNs(). This allows lxml
1215
a better handling of namespaces when moving elements between documents.</li>
1218
<div class="section" id="id128">
1221
<li>Removing Elements from a tree could make them loose their namespace
1223
<li><tt class="docutils literal">ElementInclude</tt> didn't honour base URL of original document</li>
1224
<li>Replacing the children slice of an Element would cut off the tails of the
1225
original children</li>
1226
<li><tt class="docutils literal">Element.getiterator(tag)</tt> did not accept <tt class="docutils literal">Comment</tt> and
1227
<tt class="docutils literal">ProcessingInstruction</tt> as tags</li>
1228
<li>API functions now check incoming strings for XML conformity. Zero bytes or
1229
low ASCII characters are no longer accepted (AssertionError).</li>
1230
<li>XSLT parsing failed to pass resolver context on to imported documents</li>
1231
<li>passing '' as namespace prefix in nsmap could be passed through to libxml2</li>
1232
<li>Objectify couldn't handle prefixed XSD type names in <tt class="docutils literal">xsi:type</tt></li>
1233
<li>More ET compatible behaviour when writing out XML declarations or not</li>
1234
<li>More robust error handling in <tt class="docutils literal">iterparse()</tt></li>
1235
<li>Documents lost their top-level PIs and comments on serialisation</li>
1236
<li>lxml.sax failed on comments and PIs. Comments are now properly ignored and
1237
PIs are copied.</li>
1238
<li>Possible memory leaks in namespace handling when moving elements between
1242
<div class="section" id="id129">
1243
<h2>Other changes</h2>
1245
<li>major restructuring in the documentation</li>
1249
<div class="section" id="id130">
1250
<h1>1.2.1 (2007-02-27)</h1>
1251
<div class="section" id="id131">
1254
<li>Build fixes for MS compiler</li>
1255
<li>Item assignments to special names like <tt class="docutils literal"><span class="pre">element["text"]</span></tt> failed</li>
1256
<li>Renamed ObjectifiedDataElement.__setText() to _setText() to make it easier
1258
<li>The pattern for attribute names in ObjectPath was too restrictive</li>
1262
<div class="section" id="id132">
1263
<h1>1.2 (2007-02-20)</h1>
1264
<div class="section" id="id133">
1265
<h2>Features added</h2>
1267
<li>Rich comparison of QName objects</li>
1268
<li>Support for regular expressions in benchmark selection</li>
1269
<li>get/set emulation (not .attrib!) for attributes on processing instructions</li>
1270
<li>ElementInclude Python module for ElementTree compatible XInclude processing
1271
that honours custom resolvers registered with the source document</li>
1272
<li>ElementTree.parser property holds the parser used to parse the document</li>
1273
<li>setup.py has been refactored for greater readability and flexibility</li>
1274
<li>--rpath flag to setup.py to induce automatic linking-in of dynamic library
1275
runtime search paths has been renamed to --auto-rpath. This makes it
1276
possible to pass an --rpath directly to distutils; previously this was being
1280
<div class="section" id="id134">
1283
<li>Element instantiation now uses locks to prevent race conditions with threads</li>
1284
<li>ElementTree.write() did not raise an exception when the file was not writable</li>
1285
<li>Error handling could crash under Python <= 2.4.1 - fixed by disabling thread
1286
support in these environments</li>
1287
<li>Element.find*() did not accept QName objects as path</li>
1290
<div class="section" id="id135">
1291
<h2>Other changes</h2>
1293
<li>code cleanup: redundant _NodeBase super class merged into _Element class
1294
Note: although the impact should be zero in most cases, this change breaks
1295
the compatibiliy of the public C-API</li>
1299
<div class="section" id="id136">
1300
<h1>1.1.2 (2006-10-30)</h1>
1301
<div class="section" id="id137">
1302
<h2>Features added</h2>
1304
<li>Data elements in objectify support repr(), which is now used by dump()</li>
1305
<li>Source distribution now ships with a patched Pyrex</li>
1306
<li>New C-API function makeElement() to create new elements with text,
1307
tail, attributes and namespaces</li>
1308
<li>Reuse original parser flags for XInclude</li>
1309
<li>Simplified support for handling XSLT processing instructions</li>
1312
<div class="section" id="id138">
1315
<li>Parser resources were not freed before the next parser run</li>
1316
<li>Open files and XML strings returned by Python resolvers were not
1318
<li>Crash in the IDDict returned by XMLDTDID</li>
1319
<li>Copying Comments and ProcessingInstructions failed</li>
1320
<li>Memory leak for external URLs in _XSLTProcessingInstruction.parseXSL()</li>
1321
<li>Memory leak when garbage collecting tailed root elements</li>
1322
<li>HTML script/style content was not propagated to .text</li>
1323
<li>Show text xincluded between text nodes correctly in .text and .tail</li>
1324
<li>'integer * objectify.StringElement' operation was not supported</li>
1328
<div class="section" id="id139">
1329
<h1>1.1.1 (2006-09-21)</h1>
1330
<div class="section" id="id140">
1331
<h2>Features added</h2>
1333
<li>XSLT profiling support (<tt class="docutils literal">profile_run</tt> keyword)</li>
1334
<li>countchildren() method on objectify.ObjectifiedElement</li>
1335
<li>Support custom elements for tree nodes in lxml.objectify</li>
1338
<div class="section" id="id141">
1341
<li>lxml.objectify failed to support long data values (e.g., "123L")</li>
1342
<li>Error messages from XSLT did not reach <tt class="docutils literal">XSLT.error_log</tt></li>
1343
<li>Factories objectify.Element() and objectify.DataElement() were missing
1344
<tt class="docutils literal">attrib</tt> and <tt class="docutils literal">nsmap</tt> keyword arguments</li>
1345
<li>Changing the default parser in lxml.objectify did not update the factories
1346
Element() and DataElement()</li>
1347
<li>Let lxml.objectify.Element() always generate tree elements (not data
1349
<li>Build under Windows failed ('0' bug in patched Pyrex version)</li>
1353
<div class="section" id="id142">
1354
<h1>1.1 (2006-09-13)</h1>
1355
<div class="section" id="id143">
1356
<h2>Features added</h2>
1358
<li>Comments and processing instructions return '<!-- coment -->' and
1359
'<?pi-target content?>' for repr()</li>
1360
<li>Parsers are now the preferred (and default) place where element class lookup
1361
schemes should be registered. Namespace lookup is no longer supported by
1363
<li>Support for Python 2.5 beta</li>
1364
<li>Unlock the GIL for deep copying documents and for XPath()</li>
1365
<li>New <tt class="docutils literal">compact</tt> keyword argument for parsing read-only documents</li>
1366
<li>Support for parser options in iterparse()</li>
1367
<li>The <tt class="docutils literal">namespace</tt> axis is supported in XPath and returns (prefix, URI)
1369
<li>The XPath expression "/" now returns an empty list instead of raising an
1371
<li>XML-Object API on top of lxml (lxml.objectify)</li>
1372
<li>Customizable Element class lookup:<ul>
1373
<li>different pre-implemented lookup mechanisms</li>
1374
<li>support for externally provided lookup functions</li>
1377
<li>Support for processing instructions (ET-like, not compatible)</li>
1378
<li>Public C-level API for independent extension modules</li>
1379
<li>Module level <tt class="docutils literal">iterwalk()</tt> function as 'iterparse' for trees</li>
1380
<li>Module level <tt class="docutils literal">iterparse()</tt> function similar to ElementTree (see
1381
documentation for differences)</li>
1382
<li>Element.nsmap property returns a mapping of all namespace prefixes known at
1383
the Element to their namespace URI</li>
1384
<li>Reentrant threading support in RelaxNG, XMLSchema and XSLT</li>
1385
<li>Threading support in parsers and serializers:<ul>
1386
<li>All in-memory operations (tostring, parse(StringIO), etc.) free the GIL</li>
1387
<li>File operations (on file names) free the GIL</li>
1388
<li>Reading from file-like objects frees the GIL and reacquires it for reading</li>
1389
<li>Serialisation to file-like objects is single-threaded (high lock overhead)</li>
1392
<li>Element iteration over XPath axes:<ul>
1393
<li>Element.iterdescendants() iterates over the descendants of an element</li>
1394
<li>Element.iterancestors() iterates over the ancestors of an element (from
1395
parent to parent)</li>
1396
<li>Element.itersiblings() iterates over either the following or preceding
1397
siblings of an element</li>
1398
<li>Element.iterchildren() iterates over the children of an element in either
1400
<li>All iterators support the <tt class="docutils literal">tag</tt> keyword argument to restrict the
1401
generated elements</li>
1404
<li>Element.getnext() and Element.getprevious() return the direct siblings of an
1408
<div class="section" id="id144">
1411
<li>filenames with local 8-bit encoding were not supported</li>
1412
<li>1.1beta did not compile under Python 2.3</li>
1413
<li>ignore unknown 'pyval' attribute values in objectify</li>
1414
<li>objectify.ObjectifiedElement.addattr() failed to accept Elements and Lists</li>
1415
<li>objectify.ObjectPath.setattr() failed to accept Elements and Lists</li>
1416
<li>XPathSyntaxError now inherits from XPathError</li>
1417
<li>Threading race conditions in RelaxNG and XMLSchema</li>
1418
<li>Crash when mixing elements from XSLT results into other trees, concurrent
1419
XSLT is only allowed when the stylesheet was parsed in the main thread</li>
1420
<li>The EXSLT <tt class="docutils literal">regexp:match</tt> function now works as defined (except for some
1421
differences in the regular expression syntax)</li>
1422
<li>Setting element.text to '' returned None on request, not the empty string</li>
1423
<li><tt class="docutils literal">iterparse()</tt> could crash on long XML files</li>
1424
<li>Creating documents no longer copies the parser for later URL resolving. For
1425
performance reasons, only a reference is kept. Resolver updates on the
1426
parser will now be reflected by documents that were parsed before the
1427
change. Although this should rarely become visible, it is a behavioral
1428
change from 1.0.</li>
1432
<div class="section" id="id145">
1433
<h1>1.0.4 (2006-09-09)</h1>
1434
<div class="section" id="id146">
1435
<h2>Features added</h2>
1437
<li>List-like <tt class="docutils literal">Element.extend()</tt> method</li>
1440
<div class="section" id="id147">
1443
<li>Crash in tail handling in <tt class="docutils literal">Element.replace()</tt></li>
1447
<div class="section" id="id148">
1448
<h1>1.0.3 (2006-08-08)</h1>
1449
<div class="section" id="id149">
1450
<h2>Features added</h2>
1452
<li>Element.replace(old, new) method to replace a subelement by another one</li>
1455
<div class="section" id="id150">
1458
<li>Crash when mixing elements from XSLT results into other trees</li>
1459
<li>Copying/deepcopying did not work for ElementTree objects</li>
1460
<li>Setting an attribute to a non-string value did not raise an exception</li>
1461
<li>Element.remove() deleted the tail text from the removed Element</li>
1465
<div class="section" id="id151">
1466
<h1>1.0.2 (2006-06-27)</h1>
1467
<div class="section" id="id152">
1468
<h2>Features added</h2>
1470
<li>Support for setting a custom default Element class as opposed to namespace
1471
specific classes (which still override the default class)</li>
1474
<div class="section" id="id153">
1477
<li>Rare exceptions in Python list functions were not handled</li>
1478
<li>Parsing accepted unicode strings with XML encoding declaration in certain
1480
<li>Parsing 8-bit encoded strings from StringIO objects raised an exception</li>
1481
<li>Module function <tt class="docutils literal">initThread()</tt> was removed - useless (and never worked)</li>
1482
<li>XSLT and parser exception messages include the error line number</li>
1486
<div class="section" id="id154">
1487
<h1>1.0.1 (2006-06-09)</h1>
1488
<div class="section" id="id155">
1489
<h2>Features added</h2>
1491
<li>Repeated calls to Element.attrib now efficiently return the same instance</li>
1494
<div class="section" id="id156">
1497
<li>Document deallocation could crash in certain garbage collection scenarios</li>
1498
<li>Extension function calls in XSLT variable declarations could break the
1499
stylesheet and crash on repeated calls</li>
1500
<li>Deep copying Elements could loose namespaces declared in parents</li>
1501
<li>Deep copying Elements did not copy tail</li>
1502
<li>Parsing file(-like) objects failed to load external entities</li>
1503
<li>Parsing 8-bit strings from file(-like) objects raised an exception</li>
1504
<li>xsl:include failed when the stylesheet was parsed from a file-like object</li>
1505
<li>lxml.sax.ElementTreeProducer did not call startDocument() / endDocument()</li>
1506
<li>MSVC compiler complained about long strings (supports only 2048 bytes)</li>
1510
<div class="section" id="id157">
1511
<h1>1.0 (2006-06-01)</h1>
1512
<div class="section" id="id158">
1513
<h2>Features added</h2>
1515
<li>Element.getiterator() and the findall() methods support finding arbitrary
1516
elements from a namespace (pattern <tt class="docutils literal">{namespace}*</tt>)</li>
1517
<li>Another speedup in tree iteration code</li>
1518
<li>General speedup of Python Element object creation and deallocation</li>
1519
<li>Writing C14N no longer serializes in memory (reduced memory footprint)</li>
1520
<li>PyErrorLog for error logging through the Python <tt class="docutils literal">logging</tt> module</li>
1521
<li><tt class="docutils literal">Element.getroottree()</tt> returns an ElementTree for the root node of the
1522
document that contains the element.</li>
1523
<li>ElementTree.getpath(element) returns a simple, absolute XPath expression to
1524
find the element in the tree structure</li>
1525
<li>Error logs have a <tt class="docutils literal">last_error</tt> attribute for convenience</li>
1526
<li>Comment texts can be changed through the API</li>
1527
<li>Formatted output via <tt class="docutils literal">pretty_print</tt> keyword in serialization functions</li>
1528
<li>XSLT can block access to file system and network via <tt class="docutils literal">XSLTAccessControl</tt></li>
1529
<li>ElementTree.write() no longer serializes in memory (reduced memory
1531
<li>Speedup of Element.findall(tag) and Element.getiterator(tag)</li>
1532
<li>Support for writing the XML representation of Elements and ElementTrees to
1533
Python unicode strings via <tt class="docutils literal">etree.tounicode()</tt></li>
1534
<li>Support for writing XSLT results to Python unicode strings via <tt class="docutils literal">unicode()</tt></li>
1535
<li>Parsing a unicode string no longer copies the string (reduced memory
1537
<li>Parsing file-like objects reads chunks rather than the whole file (reduced
1538
memory footprint)</li>
1539
<li>Parsing StringIO objects from the start avoids copying the string (reduced
1540
memory footprint)</li>
1541
<li>Read-only 'docinfo' attribute in ElementTree class holds DOCTYPE
1542
information, original encoding and XML version as seen by the parser</li>
1543
<li>etree module can be compiled without libxslt by commenting out the line
1544
<tt class="docutils literal">include "xslt.pxi"</tt> near the end of the etree.pyx source file</li>
1545
<li>Better error messages in parser exceptions</li>
1546
<li>Error reporting also works in XSLT</li>
1547
<li>Support for custom document loaders (URI resolvers) in parsers and XSLT,
1548
resolvers are registered at parser level</li>
1549
<li>Implementation of exslt:regexp for XSLT based on the Python 're' module,
1550
enabled by default, can be switched off with 'regexp=False' keyword argument</li>
1551
<li>Support for exslt extensions (libexslt) and libxslt extra functions
1552
(node-set, document, write, output)</li>
1553
<li>Substantial speedup in XPath.evaluate()</li>
1554
<li>HTMLParser for parsing (broken) HTML</li>
1555
<li>XMLDTDID function parses XML into tuple (root node, ID dict) based on xml:id
1556
implementation of libxml2 (as opposed to ET compatible XMLID)</li>
1559
<div class="section" id="id159">
1562
<li>Memory leak in Element.__setitem__</li>
1563
<li>Memory leak in Element.attrib.items() and Element.attrib.values()</li>
1564
<li>Memory leak in XPath extension functions</li>
1565
<li>Memory leak in unicode related setup code</li>
1566
<li>Element now raises ValueError on empty tag names</li>
1567
<li>Namespace fixing after moving elements between documents could fail if the
1568
source document was freed too early</li>
1569
<li>Setting namespace-less tag names on namespaced elements ('{ns}t' -> 't')
1570
didn't reset the namespace</li>
1571
<li>Unknown constants from newer libxml2 versions could raise exceptions in the
1573
<li>lxml.etree compiles much faster</li>
1574
<li>On libxml2 <= 2.6.22, parsing strings with encoding declaration could fail
1575
in certain cases</li>
1576
<li>Document reference in ElementTree objects was not updated when the root
1577
element was moved to a different document</li>
1578
<li>Running absolute XPath expressions on an Element now evaluates against the
1580
<li>Evaluating absolute XPath expressions (<tt class="docutils literal">/*</tt>) on an ElementTree could fail</li>
1581
<li>Crashes when calling XSLT, RelaxNG, etc. with uninitialized ElementTree
1583
<li>Removed public function <tt class="docutils literal">initThreadLogging()</tt>, replaced by more general
1584
<tt class="docutils literal">initThread()</tt> which fixes a number of setup problems in threads</li>
1585
<li>Memory leak when using iconv encoders in tostring/write</li>
1586
<li>Deep copying Elements and ElementTrees maintains the document information</li>
1587
<li>Serialization functions raise LookupError for unknown encodings</li>
1588
<li>Memory deallocation crash resulting from deep copying elements</li>
1589
<li>Some ElementTree methods could crash if the root node was not initialized
1590
(neither file nor element passed to the constructor)</li>
1591
<li>Element/SubElement failed to set attribute namespaces from passed <tt class="docutils literal">attrib</tt>
1593
<li><tt class="docutils literal">tostring()</tt> adds an XML declaration for non-ASCII encodings</li>
1594
<li><tt class="docutils literal">tostring()</tt> failed to serialize encodings that contain 0-bytes</li>
1595
<li>ElementTree.xpath() and XPathDocumentEvaluator were not using the
1596
ElementTree root node as reference point</li>
1597
<li>Calling <tt class="docutils literal"><span class="pre">document('')</span></tt> in XSLT failed to return the stylesheet</li>
1601
<div class="section" id="id160">
1602
<h1>0.9.2 (2006-05-10)</h1>
1603
<div class="section" id="id161">
1604
<h2>Features added</h2>
1606
<li>Speedup for Element.makeelement(): the new element reuses the original
1607
libxml2 document instead of creating a new empty one</li>
1608
<li>Speedup for reversed() iteration over element children (Py2.4+ only)</li>
1609
<li>ElementTree compatible QName class</li>
1610
<li>RelaxNG and XMLSchema accept any Element, not only ElementTrees</li>
1613
<div class="section" id="id162">
1616
<li>str(xslt_result) was broken for XSLT output other than UTF-8</li>
1617
<li>Memory leak if write_c14n fails to write the file after conversion</li>
1618
<li>Crash in XMLSchema and RelaxNG when passing non-schema documents</li>
1619
<li>Memory leak in RelaxNG() when RelaxNGParseError is raised</li>
1623
<div class="section" id="id163">
1624
<h1>0.9.1 (2006-03-30)</h1>
1625
<div class="section" id="id164">
1626
<h2>Features added</h2>
1628
<li>lxml.sax.ElementTreeContentHandler checks closing elements and raises
1629
SaxError on mismatch</li>
1630
<li>lxml.sax.ElementTreeContentHandler supports namespace-less SAX events
1631
(startElement, endElement) and defaults to empty attributes (keyword
1633
<li>Speedup for repeatedly accessing element tag names</li>
1634
<li>Minor API performance improvements</li>
1637
<div class="section" id="id165">
1640
<li>Memory deallocation bug when using XSLT output method "html"</li>
1641
<li>sax.py was handling UTF-8 encoded tag names where it shouldn't</li>
1642
<li>lxml.tests package will no longer be installed (is still in source tar)</li>
1646
<div class="section" id="id166">
1647
<h1>0.9 (2006-03-20)</h1>
1648
<div class="section" id="id167">
1649
<h2>Features added</h2>
1651
<li>Error logging API for libxml2 error messages</li>
1652
<li>Various performance improvements</li>
1653
<li>Benchmark script for lxml, ElementTree and cElementTree</li>
1654
<li>Support for registering extension functions through new FunctionNamespace
1655
class (see doc/extensions.txt)</li>
1656
<li>ETXPath class for XPath expressions in ElementTree notation ('//{ns}tag')</li>
1657
<li>Support for variables in XPath expressions (also in XPath class)</li>
1658
<li>XPath class for compiled XPath expressions</li>
1659
<li>XMLID module level function (ElementTree compatible)</li>
1660
<li>XMLParser API for customized libxml2 parser configuration</li>
1661
<li>Support for custom Element classes through new Namespace API (see
1662
doc/namespace_extensions.txt)</li>
1663
<li>Common exception base class LxmlError for module exceptions</li>
1664
<li>real iterator support in iter(Element), Element.getiterator()</li>
1665
<li>XSLT objects are callable, result trees support str()</li>
1666
<li>Added MANIFEST.in for easier creation of RPM files.</li>
1667
<li>'getparent' method on elements allows navigation to an element's
1668
parent element.</li>
1669
<li>Python core compatible SAX tree builder and SAX event generator. See
1670
doc/sax.txt for more information.</li>
1673
<div class="section" id="id168">
1676
<li>Segfaults and memory leaks in various API functions of Element</li>
1677
<li>Segfault in XSLT.tostring()</li>
1678
<li>ElementTree objects no longer interfere, Elements can be root of different
1679
ElementTrees at the same time</li>
1680
<li>document('') works in XSLT documents read from files (in-memory documents
1681
cannot support this due to libxslt deficiencies)</li>
1685
<div class="section" id="id169">
1686
<h1>0.8 (2005-11-03)</h1>
1687
<div class="section" id="id170">
1688
<h2>Features added</h2>
1690
<li>Support for copy.deepcopy() on elements. copy.copy() works also, but
1691
does the same thing, and does <em>not</em> create a shallow copy, as that
1692
makes no sense in the context of libxml2 trees. This means a
1693
potential incompatibility with ElementTree, but there's more chance
1694
that it works than if copy.copy() isn't supported at all.</li>
1695
<li>Increased compatibility with (c)ElementTree; .parse() on ElementTree is
1696
supported and parsing of gzipped XML files works.</li>
1697
<li>implemented index() on elements, allowing one to find the index of a
1701
<div class="section" id="id171">
1704
<li>Use xslt-config instead of xml2-config to find out libxml2
1705
directories to take into account a case where libxslt is installed
1706
in a different directory than libxslt.</li>
1707
<li>Eliminate crash condition in iteration when text nodes are changed.</li>
1708
<li>Passing 'None' to tostring() does not result in a segfault anymore,
1709
but an AssertionError.</li>
1710
<li>Some test fixes for Windows.</li>
1711
<li>Raise XMLSyntaxError and XPathSyntaxError instead of plain python
1712
syntax errors. This should be less confusing.</li>
1713
<li>Fixed error with uncaught exception in Pyrex code.</li>
1714
<li>Calling lxml.etree.fromstring('') throws XMLSyntaxError instead of a
1716
<li>has_key() works on attrib. 'in' tests also work correctly on attrib.</li>
1717
<li>INSTALL.txt was saying 2.2.16 instead of 2.6.16 as a supported
1718
libxml2 version, as it should.</li>
1719
<li>Passing a UTF-8 encoded string to the XML() function would fail;
1724
<div class="section" id="id172">
1725
<h1>0.7 (2005-06-15)</h1>
1726
<div class="section" id="id173">
1727
<h2>Features added</h2>
1729
<li>parameters (XPath expressions) can be passed to XSLT using keyword
1731
<li>Simple XInclude support. Calling the xinclude() method on a tree
1732
will process any XInclude statements in the document.</li>
1733
<li>XMLSchema support. Use the XMLSchema class or the convenience
1734
xmlschema() method on a tree to do XML Schema (XSD) validation.</li>
1735
<li>Added convenience xslt() method on tree. This is less efficient
1736
than the XSLT object, but makes it easier to write quick code.</li>
1737
<li>Added convenience relaxng() method on tree. This is less efficient
1738
than the RelaxNG object, but makes it easier to write quick code.</li>
1739
<li>Make it possible to use XPathEvaluator with elements as well. The
1740
XPathEvaluator in this case will retain the element so multiple
1741
XPath queries can be made against one element efficiently. This
1742
replaces the second argument to the .evaluate() method that existed
1744
<li>Allow registerNamespace() to be called on an XPathEvaluator, after
1745
creation, to add additional namespaces. Also allow registerNamespaces(),
1746
which does the same for a namespace dictionary.</li>
1747
<li>Add 'prefix' attribute to element to be able to read prefix information.
1748
This is entirely read-only.</li>
1749
<li>It is possible to supply an extra nsmap keyword parameter to
1750
the Element() and SubElement() constructors, which supplies a
1751
prefix to namespace URI mapping. This will create namespace
1752
prefix declarations on these elements and these prefixes will show up
1753
in XML serialization.</li>
1756
<div class="section" id="id174">
1759
<li>Killed yet another memory management related bug: trees created
1760
using newDoc would not get a libxml2-level dictionary, which caused
1761
problems when deallocating these documents later if they contained a
1762
node that came from a document with a dictionary.</li>
1763
<li>Moving namespaced elements between documents was problematic as
1764
references to the original document would remain. This has been fixed
1765
by applying xmlReconciliateNs() after each move operation.</li>
1766
<li>Can pass None to 'dump()' without segfaults.</li>
1767
<li>tostring() works properly for non-root elements as well.</li>
1768
<li>Cleaned out the tostring() method so it should handle encoding
1770
<li>Cleaned out the ElementTree.write() method so it should handle encoding
1771
correctly. Writing directly to a file should also be faster, as there is no
1772
need to go through a Python string in that case. Made sure the test cases
1773
test both serializing to StringIO as well as serializing to a real file.</li>
1777
<div class="section" id="id175">
1778
<h1>0.6 (2005-05-14)</h1>
1779
<div class="section" id="id176">
1780
<h2>Features added</h2>
1782
<li>Changed setup.py so that library_dirs is also guessed. This should
1783
help with compilation on the Mac OS X platform, where otherwise the
1784
wrong library (shipping with the OS) could be picked up.</li>
1785
<li>Tweaked setup.py so that it picks up the version from version.txt.</li>
1788
<div class="section" id="id177">
1791
<li>Do the right thing when handling namespaced attributes.</li>
1792
<li>fix bug where tostring() moved nodes into new documents. tostring()
1793
had very nasty side-effects before this fix, sorry!</li>
1797
<div class="section" id="id178">
1798
<h1>0.5.1 (2005-04-09)</h1>
1800
<li>Python 2.2 compatibility fixes.</li>
1801
<li>unicode fixes in Element() and Comment() as well as XML(); unicode
1802
input wasn't properly being UTF-8 encoded.</li>
1805
<div class="section" id="id179">
1806
<h1>0.5 (2005-04-08)</h1>
1807
<p>Initial public release.</p>
1810
<div class="footer">
1811
<hr class="footer" />
1812
Generated on: 2010-03-02.