source: exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3b1-20080615-badc/CHANGES @ 4886

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/exist/branches/proglue_production_rev4605_xquery4884/python/elementtree-1.3b1-20080615-badc/CHANGES@4886
Revision 4886, 14.0 KB checked in by sdonegan, 10 years ago (diff)

Creating operational branch for ndgUtils as used on proglue

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