source: exist/trunk/python/elementtree-1.3/CHANGES @ 3150

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/trunk/python/elementtree-1.3/CHANGES@3150
Revision 3150, 10.5 KB checked in by lawrence, 12 years ago (diff)

woops, we didn't include elementtree itself.

Line 
1The ElementTree Library
2$Id: CHANGES 3276 2007-09-12 06:52:30Z fredrik $
3
4*** Changes from release 1.2 to 1.3 ***
5
6(1.3a3 released)
7
8- Added new path engine, for "find", "findall", and "findtext".  The
9  new engine is a bit faster, and supports a number of predicates
10  forms: [@attr], [@attr='value'], and [tag] (in the last case, only
11  single tag names are supported).  The engine also provides limited
12  support for the ".." parent operator; you can use it inside the
13  subtree, but it cannot go above the target element (the element
14  you called "find" on).
15
16- Added "extend" method to Element.
17
18- Added "iter" method to Element and ElementTree.  This replaces
19  "getiterator" (the old name is still available for compatibility).
20  Both "iter" and "getiterator" are now true generators; to get the
21  old ET behaviour, use list() to convert the generator to a list:
22
23     for elem in list(root.iter()):
24        ...
25
26- (experimental) Added "itertext" method to Element and ElementTree.
27  This returns a generated sequence of all character data sections
28  inside the given element.  Use "".join(elem.itertext()) to quickly
29  get all text inside an element.
30
31- (experimental) Added "method" option to the "write" method, and
32  added support for "xml" (standard serialization) "html", and
33  "text".
34
35  The "xml" method is the standard ElementTree serializer.
36
37  The "html" method omits end tags for empty HTML elements, handles
38  "script" and "style" tags correctly, etc.  Note that the HTML
39  serializer is experimental, and the output may be improved in
40  future versions.
41
42  The "text" method only includes "text" and "tail" content, encoded
43  in the given encoding, and without any escaping.
44
45- Added "default_namespace" option to the "write" method.  This option
46  adds an "xmlns" attribute to the root element, and disables prefix
47  generation for the given default namespace.
48
49  Note that all element names in the tree must be qualified if this
50  option is used; the serializer doesn't support undeclaring of prefixes.
51
52- Fixed Comment serialization; the serialization no longer inserts
53  extra spaces around the comment text.
54
55- Fixed "NameError" exception in the 'register_namespace' helper.
56
57(1.3a2 released)
58
59- Raise "ET.ParseError" for XML errors found by the parser, no matter
60  that the error actually was.  "ParseError" is a subclass of Syntax-
61  Error, so code written for cElementTree still works.
62
63- Changed serializer to place all namespace declarations on the
64  root element.
65
66- Changed serializer to omits start and end tags for elements that
67  have the "tag" attribute set to None.
68
69- Fixed serialization of newlines in attribute values.
70
71- Added "target" and "version" attributes to the XMLParser class.
72
73- Added support for optional "doctype" hook to XMLParser.
74
75- Added future warnings for "if e" (use explicit len(e) or is None
76  test) and "e.getchildren()" (use list(e) or iteration).
77
78- Added future warnings for tree.find("/tag") and similar searches,
79  which are broken in 1.3 and earlier.
80
81- Removed old SgmlopXMLTreeBuilder.py, SimpleXMLTreeBuilder.py, and
82  XMLTreeBuilder.py modules.
83
84(1.3a1 released)
85
86- Added 'tostringlist' and 'fromstringlist' helper functions.  These
87  are similar to 'tostring' and 'fromstring', but work on sequences of
88  string fragments, rather than entire strings.
89
90- Added xml_declaration option to serializer.  If set to a true
91  value, the xml declaration is always written.  If set to a false
92  value (except None), it's never written.  If omitted, it's written
93  only if the file is using a non-default encoding (i.e. not utf-8
94  or us-ascii).
95
96- (experimental) Added 'register_namespace' helper.  This can be used
97  to register well-known prefixes for given namespace URI:s, for use
98  when serializing.  Note that the namespace mapping is a global
99  setting.
100
101- Renamed XMLTreeBuilder to XMLParser, as a first step in sorting
102  out the TreeBuilder vs. TreeBuilder mess.  The old name is still
103  available, of course.
104
105- Change Element to be the reference implementation, rather than a
106  factory function.  Removed the _ElementInterface class.
107
108*** Changes from release 1.1 to 1.2 ***
109
110(1.2.6 released)
111
112- Fixed handling of entities defined in internal DTD's (reported
113  by Greg Wilson).
114
115- Fixed serialization under non-standard default encodings (but
116  using non-standard default encodings is still a lousy idea ;-)
117
118(1.2.5 released)
119
120- Added 'iterparse' implementation.  This is similar to 'parse', but
121  returns a stream of events while it builds the tree.  By default,
122  the parser only returns "end" events (for completed elements):
123
124        for event, elem in iterparse(source):
125            ...
126
127  To get other events, use the "events" option to pass in a tuple
128  containing the events you want:
129
130        for event, elem in iterparse(source, events=(...)):
131            ...
132
133  The event tuple can contain one or more of:
134
135  "start"
136    generated for start tags, after the element has been created
137    (but before the current element has been fully populated)
138  "end"
139    generated for end tags, after all element children has been
140    created.
141  "start-ns"
142    generated when a new namespace scope is opened.  for this event,
143    the elem value is a (prefix, url) tuple.
144  "end-ns"
145    generated when the current namespace scope is closed.  elem
146    is None.
147
148  Events arrive asynchronously; the tree is usually more complete
149  than the events indicate, but this is nothing you can rely on.
150
151  The iterable itself contains context information.  In the current
152  release, the only public context attribute is "root", which is set
153  to the root element when parsing is finished.  To access the con-
154  text, assign the iterable to a variable before looping over it:
155
156        context = iterparse(source)
157        for event, elem in context:
158            ...
159        root = context.root
160
161(1.2.4 released)
162
163- Fixed another FancyTreeBuilder bug on Python 2.3.
164
165(1.2.3 released)
166
167- Fixed the FancyTreeBuilder class, which was broken in 1.2.1
168  and 1.2.2 (broken for some Python versions, at least).
169
170(1.2.2 released)
171
172- Fixed some ASCII/Unicode issues in the HTML parser.  You can now
173  use the parser on documents that mixes encoded 8-bit data with
174  character references outside the ASCII range. (backported from 1.3)
175
176(1.2.1 released)
177
178- Changed XMLTreeBuilder to take advantage of new expat features, if
179  present.  This speeds up parsing quite a bit. (backported from 1.3)
180
181(1.2c1 released; 1.2 final released)
182
183- Added 'docs' directory, with PythonDoc documentation for the
184  ElementTree library.  See docs/index.html for an overview.
185
186(1.2b4 released)
187
188- Fixed encoding of Unicode element names and attribute names
189  (reported by Ken Rimey).
190
191(1.2b3 released)
192
193- Added default argument to 'findtext'.  Note that 'findtext' now
194  always returns an empty string if a matching element is found, but
195  has no text content.  None is only returned if no element is found,
196  and no default value is specified.
197
198- Make sure 'dump' adds a trailing linefeed.
199
200(1.2b2 released)
201
202- Added optional tree builder argument to the HTMLTreeBuilder class.
203
204(1.2b1 released)
205
206- Added XMLID() helper.  This is similar to XML(), but returns both
207  the root element and a dictionary mapping ID attributes to elements.
208
209- Added simple SgmlopXMLTreeBuilder module.  This is a very fast
210  parser, but it doesn't yet support namespaces.  To use this parser,
211  you need the sgmlop driver:
212
213      http://effbot.org/zone/sgmlop-index.htm
214
215- Fixed exception in test suite; the TidyHTMLTreeBuilder class
216  now raises a RuntimeError exception if the _elementidy module
217  is not available.
218
219(1.2a5 released)
220
221- Fixed problem that could result in repeated use of the same
222  namespace prefix in the same element (!).
223
224- Fixed import error in ElementInclude, when using the default
225  loader (Gustavo Niemeyer).
226
227(1.2a4 released)
228
229- Fixed exception when .//tag fails to find matching elements
230  (reported by Mike Kent) (@XMLTOOLKIT28)
231
232- Fall back on pre-1.2 find/findtext/findall behaviour if the
233  ElementPath module is not installed.  If you don't need path
234  support, you can simply copy the ElementTree module to your
235  own project.
236
237(1.2a3 released)
238
239- Added experimental support for XInclude-style preprocessing.  The
240  ElementInclude module expands xi:include elements, using a custom
241  resolver.  The current release ignores xi:fallback elements.
242
243- Fixed typo in ElementTree.findtext (reported by Thomas Dartsch)
244  (@XMLTOOLKIT25)
245
246- Fixed parsing of periods in element names (reported by Brian
247  Vicente) (@XMLTOOLKIT27)
248
249(1.2a2 released)
250
251- Fixed serialization of elements and attributes in the XML default
252  namespace (http://www.w3.org/XML/1998/namespace).  Added "rdf" to
253  the set of "well-known" namespace prefixes.
254
255- Added 'makeelement' factory method.  Added 'target' argument to
256  XMLTreeBuilder class.
257
258(1.2a1 released)
259
260- Added support for a very limited subset of the abbreviated XPath
261  syntax.  The following location paths are supported:
262
263        tag -- select all subelements with the given tag
264        . -- select this element
265        * -- select all subelements
266        // (empty path) -- select all subelements, on all levels
267
268  Examples:
269
270        p -- select all p subelements
271        .//a -- select all a sublements, at all sublevels
272        */img -- select all img grandchildren
273        ul/li -- select all li elements that are children of ul elements
274        .//ul/li -- same, but select elements anywhere in the subtree
275
276  Absolute paths (paths starting with a slash) can only be used on
277  ElementTree instances.  To use // on an Element instance, add a
278  leading period (.).
279
280*** Changes from release 1.0 to 1.1 ***
281
282(1.1 final released)
283
284- Added 'fromstring' and 'tostring' helpers.  The 'XML' function is
285  an alias for 'fromstring', and provides a convenient way to add XML
286  literals to source code:
287
288        from elementtree.ElementTree import XML
289
290        element = XML('<element>content</element>')
291
292- Moved XMLTreeBuilder functionality into the ElementTree module.  If
293  all you need is basic XML support, you can simply copy the ElementTree
294  module to your own project.
295
296- Added SimpleXMLWriter module.
297
298(1.1b2 released)
299
300- Changed default encoding to US-ASCII.  Use tree.write(file, "utf-8")
301  to get the old behaviour.  If the tree contains text that cannot be
302  encoded using the given encoding, the writer uses numerical entities
303  for all non-ASCII characters in that text segment.
304
305(1.1b1 released)
306
307- Map tags and attribute names having the same value to the same
308  object.  This saves space when reading large XML trees, and also
309  gives a small speedup (less than 10%).
310
311- Added benchmark script.  This script takes a filename argument, and
312  loads the given file into memory using the XML and SimpleXML tree
313  builders.  For each parser, it reports the document size and the
314  time needed to parse the document.
Note: See TracBrowser for help on using the repository browser.