1 Introduction
2 ------------
3
4 The libxml2dom package provides a traditional DOM wrapper around the Python
5 bindings for libxml2 providing basic support for XML and HTML processing.
6 Experimental support is also provided for a number of XML technologies
7 including SOAP, SVG, XML-RPC and XMPP.
8
9 Compatibility Warnings
10 ----------------------
11
12 From libxml2dom 0.4, nodeValue now returns different results in some cases.
13 Previously, it was possible to get the textual contents of an element using
14 the nodeValue property, although this is incompatible with the DOM
15 specifications. Instead, you should now use the textContent property to get
16 such data.
17
18 From libxml2dom 0.5, some XML-RPC nodes employ different properties.
19
20 From libxml2dom 0.5, the send method of libxml2dom.xmpp.Session instances no
21 longer return responses. Such instances can also no longer be configured with
22 an internal timeout value.
23
24 Contact, Copyright and Licence Information
25 ------------------------------------------
26
27 The current Web page for libxml2dom at the time of release is:
28
29 http://www.boddie.org.uk/python/libxml2dom.html
30
31 Copyright and licence information can be found in the docs directory - see
32 docs/COPYING.txt, docs/lgpl-3.0.txt and docs/gpl-3.0.txt for more information.
33
34 Dependencies
35 ------------
36
37 libxml2 Tested with libxml2 2.6.17.
38 Use --with-python=<path to python executable> if building from
39 source. Previous releases of libxml2 in the 2.6 series may work,
40 but releases before 2.6.16 are not recommended.
41
42 For Windows users, see also the packages for libxml2, available
43 from the following site:
44
45 http://users.skynet.be/sbi/libxml-python/
46
47 Python Tested with Python 2.4.
48 Python releases from 2.2 onwards should be compatible with
49 libxml2dom. The principal requirement from such releases is the
50 new-style class support which permits the use of properties in
51 the libxml2dom implementation.
52
53 Testing
54 -------
55
56 Some of the tests require libxml2macro.py to be run on the test source code
57 first. Read the docstrings for the various test files before attempting to run
58 any of them. See also docs/NOTES_libxml2macro.txt for more information. Note
59 that such tests are retained for historical purposes and/or curiosity since
60 libxml2macro.py is no longer supported.
61
62 Issues
63 ------
64
65 The presence of xmlns attributes in serialised documents was called into
66 question, and the tests/namespace*.py files attempt to show the current
67 behaviour of libxml2dom.
68
69 Use of importNode seems to cause some kind of memory issue, probably related
70 to nodes being shared across documents. This was observed in libxml2 2.6.0 but
71 appears to be fixed in libxml2 2.6.16.
72
73 Even compared to minidom, importNode may seem very slow (even the
74 libxml2dom.macrolib implementation, too). A way is needed to get libxml2 to do
75 the node copying itself.
76
77 Testing the XMPP support can be awkward, particularly when trying to get user
78 registration to work. If testing with ejabberd, it can be useful to run the
79 'ejabberdctl register' command in order to register a user that can then be
80 used with the test_xmpp.py program. Alternatively, edit the ejabberd.conf file
81 (found in /etc/ejabberd on Debian, for example) changing...
82
83 {access, register, [{deny, all}]}.
84
85 ...to...
86
87 {access, register, [{allow, all}]}.
88
89 ...to permit in-band registration.
90
91 New in libxml2dom 0.5.1 (Changes since libxml2dom 0.5)
92 ------------------------------------------------------
93
94 * Fixed the document encoding for HTML documents retrieved using parseURI.
95
96 New in libxml2dom 0.5 (Changes since libxml2dom 0.4.7)
97 ------------------------------------------------------
98
99 * Fixed text node handling to work around the libxml2 tendency to merge text
100 nodes in its own functions.
101 * Changed some XML-RPC node properties in order to retain underlying DOM
102 properties such as data.
103 * Added convenience methods to the XML-RPC implementation providing combined
104 node creation and insertion. Introduced similar conveniences into the SOAP
105 implementation. These methods are similar to those found in the XMPP
106 implementation.
107 * Enabled prettyprinting support, finally.
108 * Added the hasChildNodes method, requested by Nick Galbreath.
109 * Fixed the Debian packaging to use python-central.
110 * Changed the XMPP API to only return document fragments from receive method
111 calls; added support for failure elements; removed the internal timeout
112 interval; added a disconnect method.
113
114 New in libxml2dom 0.4.7 (Changes since libxml2dom 0.4.6)
115 --------------------------------------------------------
116
117 * Fixed the ownerElement of attributes created by XPath queries, and in all
118 other situations involving the implementation's get_node method.
119 * Fixed SVG matrix operations which should have involved matrix
120 post-multiplication.
121 * Replaced the getElementById implementation with one based on libxml2's
122 own support for finding attributes declared as identifiers.
123 * Introduced support for validation, together with the libxml2dom.errors
124 module. Relax-NG, XML Schema and Schematron are supported, depending on
125 libxml2 support.
126 * Improved error messages related to parsing.
127 * Added DOMConfiguration support to documents.
128
129 New in libxml2dom 0.4.6 (Changes since libxml2dom 0.4.5)
130 --------------------------------------------------------
131
132 * Exposed the libxml2 support for processing XInclude declarations.
133
134 New in libxml2dom 0.4.5 (Changes since libxml2dom 0.4.4)
135 --------------------------------------------------------
136
137 * Fixed crashes when parsing empty documents.
138 * Fixed operations involving the standard XML_NAMESPACE value, particularly
139 setAttributeNS.
140 * Introduced deletion of conflicting attributes in setAttributeNS.
141 * Added slightly nicer errors for parsing and serialising.
142 * Added some support for SOAP and XML-RPC message processing.
143
144 New in libxml2dom 0.4.4 (Changes since libxml2dom 0.4.3)
145 --------------------------------------------------------
146
147 * Relicensed under the LGPL version 3 or later (fixing PKG-INFO file).
148 * Improved XMPP support for messages, presence and events.
149 * Added Ubuntu Feisty (7.04) package support.
150
151 New in libxml2dom 0.4.3 (Changes since libxml2dom 0.4.2)
152 --------------------------------------------------------
153
154 * Enforced well-formedness in parse operations unless otherwise requested.
155 * Fixed access to null doctype properties.
156 * Added getElementById, firstChild and lastChild to the Node class.
157 * Added a __hash__ method to the Node class.
158 * Moved document checking into the Node class.
159 * Added an iterator for the NamedNodeMap class.
160 * Expanded the svg and events modules, including a test of SVG events.
161 * Split the debian-stable packages into debian-sarge and debian-etch.
162
163 New in libxml2dom 0.4.2 (Changes since libxml2dom 0.4.1)
164 --------------------------------------------------------
165
166 * Added missing impl attribute to NamedNodeMap, fixing attribute retrieval.
167 * Added documentElement to Document.
168 * Fixed and expanded the events module.
169 * Added lots of functionality to the svg module.
170
171 New in libxml2dom 0.4.1 (Changes since libxml2dom 0.4)
172 ------------------------------------------------------
173
174 * Fixed the absence of CDATA node creation and importing.
175
176 New in libxml2dom 0.4 (Changes since libxml2dom 0.3.6)
177 ------------------------------------------------------
178
179 * Changed the nodeValue property to return None for various node types, as
180 specified in the DOM specification (Level 3).
181 * Fixed various "not supported" exceptions and added tests which can raise
182 "wrong document" exceptions.
183 * Introduced an Implementation class, permitting specialised node creation.
184 * Added SVG-specific document support.
185 * Made parseURI work for HTML documents.
186 * Fixed getElementsByTagName(NS), as reported by Christian Seiler.
187 * Fixed previousSibling, nextSibling and parentNode crashes using
188 suggestions from Christian Seiler.
189 * Reintroduced node comparisons using suggestions from Christian Seiler.
190 * Fixed the absence of the CDATA node type.
191 * Added the textContent property to nodes.
192 * Added a getDOMImplementation function.
193 * Added an experimental events module.
194 * Added an htmlencoding parameter to the parse functions, as requested by
195 Iliyan Peychev.
196
197 New in libxml2dom 0.3.6 (Changes since libxml2dom 0.3.5)
198 --------------------------------------------------------
199
200 * Added cloneNode almost as a synonym for importNode (which, unlike in the
201 DOM specification, is present on all nodes).
202 * Introduced Debian stable package details - suggested by Robert Siemer.
203 * Changed libxml2mod import details to try libxmlmods - suggested by Lucian
204 Wischik.
205
206 New in libxml2dom 0.3.5 (Changes since libxml2dom 0.3.4)
207 --------------------------------------------------------
208
209 * Fixed nodeType for HTML document elements - reported by Robert Siemer.
210 * Fixed string results from XPath expressions - reported by Robert Siemer.
211
212 New in libxml2dom 0.3.4 (Changes since libxml2dom 0.3.3)
213 --------------------------------------------------------
214
215 * Attempted to introduce generated prefixes for attributes having namespaces
216 but whose names are unprefixed.
217 * Added support for xmlns attribute retrieval (getAttributeNS) and detection
218 (hasAttributeNS).
219 * Added the length attribute to NamedNodeMap; renamed the length method on
220 NodeList, adding a length attribute.
221
222 New in libxml2dom 0.3.3 (Changes since libxml2dom 0.3.2)
223 --------------------------------------------------------
224
225 * Removed redundant weakref usage.
226 * Added explicit copyright and licensing information to source files.
227
228 New in libxml2dom 0.3.2 (Changes since libxml2dom 0.3.1)
229 --------------------------------------------------------
230
231 * Improved the xmlns attribute creation controls.
232
233 New in libxml2dom 0.3.1 (Changes since libxml2dom 0.3)
234 ------------------------------------------------------
235
236 * Fixed empty namespace declarations on elements created with namespaceURI
237 set to None. Previously, such declarations were missing.
238 * Fixed attribute creation and introduced stricter controls over the
239 construction of xmlns attributes.
240
241 New in libxml2dom 0.3 (Changes since libxml2dom 0.2.4)
242 ------------------------------------------------------
243
244 * Imposed much stricter tests on strings used with the libxml2dom API.
245 Strings given as arguments to methods and functions must now only contain
246 ASCII characters; any other character data must be provided as Unicode
247 objects. This change fixes various issues with XPath expressions, and
248 quite probably various other things.
249 * Fixed parentNode on Document objects (which caused xml.dom.ext.PrettyPrint
250 to crash).
251 * Added some support for the doctype attribute and related information.
252 * libxml2dom is now licensed under the LGPL - see docs/COPYING.txt for
253 details.
254
255 New in libxml2dom 0.2.4 (Changes since libxml2dom 0.2.3)
256 --------------------------------------------------------
257
258 * Fixed Unicode conversions in the Node's xpath method.
259
260 New in libxml2dom 0.2.3 (Changes since libxml2dom 0.2.2)
261 --------------------------------------------------------
262
263 * Fixed the parse function's docstring.
264 * Added the owner element to obtained attribute nodes.
265 * Fixed Debian package changelog distribution identifiers.
266
267 New in libxml2dom 0.2.2 (Changes since libxml2dom 0.2.1)
268 --------------------------------------------------------
269
270 * Fixed exception raising in parseURI, adding a docstring to explain the
271 current limitations around HTML parsing.
272
273 New in libxml2dom 0.2.1 (Changes since libxml2dom 0.2)
274 ------------------------------------------------------
275
276 * Moved libxml2macro script to the tools directory.
277 * Added getElementsByTagNameNS.
278 * Added a normalize implementation.
279 * Added HTML parsing support.
280 * Added prettyprinting support.
281 * Fixed parseURI.
282 * Introduced better testing for Unicode objects, especially since things
283 like rdflib like to subclass the unicode type, and it might be more
284 convenient to detect such subclasses and convert their values
285 automatically.
286 * Improved some of the API documentation.
287 * Introduced better suppression of warnings, network access, and other
288 potentially intrusive libxml2 features.
289 * Reorganised the documentation, expanding the README.txt file at the
290 expense of the HTML documentation, but removing older, less relevant
291 information.
292 * Added Debian package support.
293
294 New in libxml2dom 0.2 (Changes since libxml2dom 0.1.3)
295 ------------------------------------------------------
296
297 * Adopted libxml2macro code within the libxml2dom classes, removing any
298 dependencies on the libxml2 module - this makes everything much faster
299 and virtually removes any necessity to use libxml2macro.
300 * Improved attribute and document node handling.
301 * Introduced document reference management.
302 * Introduced NodeList wrapper objects.
303
304 New in libxml2dom 0.1.3 (Changes since libxml2dom 0.1.2)
305 --------------------------------------------------------
306
307 * Fixed createElement.
308 * Introduced experimental libxml2macro tools, tests and libraries.
309
310 New in libxml2dom 0.1.2 (Changes since libxml2dom 0.1.1)
311 --------------------------------------------------------
312
313 * Fixed getAttributeNode and getAttributeNodeNS.
314 * Added comment node creation.
315 * Fixed empty namespace usage with elements and attributes.
316 * Introduced usage of the libxml2 file and memory parsing features.
317 * Introduced suppression of DTD retrieval and validation as the default
318 behaviour.
319 * Added experimental XPath method support.
320
321 New in libxml2dom 0.1.1
322 -----------------------
323
324 * Fixed text node creation.
325 * Fixed setAttributeNS.
326 * Added encoding parameters to convenience methods.
327 * Added the missing previousSibling property.
328 * Added release number to the package.
329
330 Release Procedures
331 ------------------
332
333 Update the libxml2dom/__init__.py and libxml2dom/macrolib/__init__.py
334 __version__ attributes.
335 Change the version number and package filename/directory in the documentation.
336 Update the version number in setup.py.
337 Check the setup.py file and ensure that all package directories are mentioned.
338 Change code examples in the documentation if appropriate.
339 Update the release notes (see above).
340 Update the package release notes (in the packages directory).
341 Check the release information in the PKG-INFO file.
342 Tag, export.
343 Archive, upload.
344 Make packages (see below).
345 Update PyPI, PythonInfo Wiki entries.
346
347 Making Packages
348 ---------------
349
350 To make Debian-based packages:
351
352 1. Create new package directories under packages if necessary.
353 2. Make a symbolic link in the distribution's root directory to keep the
354 Debian tools happy; choose one of the following:
355
356 ln -s packages/ubuntu-hoary/python2.4-libxml2dom/debian/
357 ln -s packages/ubuntu-feisty/python-libxml2dom/debian/
358 ln -s packages/ubuntu-gutsy/python-libxml2dom/debian/
359 ln -s packages/debian-sarge/python2.3-libxml2dom/debian/
360 ln -s packages/debian-etch/python-libxml2dom/debian/
361 ln -s packages/debian-lenny/python-libxml2dom/debian/
362
363 3. Run the package builder:
364
365 dpkg-buildpackage -rfakeroot
366
367 4. Locate and tidy up the packages in the parent directory of the
368 distribution's root directory.