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 (Changes since libxml2dom 0.4.7)
92 ------------------------------------------------------
93
94 * Fixed text node handling to work around the libxml2 tendency to merge text
95 nodes in its own functions.
96 * Changed some XML-RPC node properties in order to retain underlying DOM
97 properties such as data.
98 * Added convenience methods to the XML-RPC implementation providing combined
99 node creation and insertion. Introduced similar conveniences into the SOAP
100 implementation. These methods are similar to those found in the XMPP
101 implementation.
102 * Enabled prettyprinting support, finally.
103 * Added the hasChildNodes method, requested by Nick Galbreath.
104 * Fixed the Debian packaging to use python-central.
105 * Changed the XMPP API to only return document fragments from receive method
106 calls; added support for failure elements; removed the internal timeout
107 interval; added a disconnect method.
108
109 New in libxml2dom 0.4.7 (Changes since libxml2dom 0.4.6)
110 --------------------------------------------------------
111
112 * Fixed the ownerElement of attributes created by XPath queries, and in all
113 other situations involving the implementation's get_node method.
114 * Fixed SVG matrix operations which should have involved matrix
115 post-multiplication.
116 * Replaced the getElementById implementation with one based on libxml2's
117 own support for finding attributes declared as identifiers.
118 * Introduced support for validation, together with the libxml2dom.errors
119 module. Relax-NG, XML Schema and Schematron are supported, depending on
120 libxml2 support.
121 * Improved error messages related to parsing.
122 * Added DOMConfiguration support to documents.
123
124 New in libxml2dom 0.4.6 (Changes since libxml2dom 0.4.5)
125 --------------------------------------------------------
126
127 * Exposed the libxml2 support for processing XInclude declarations.
128
129 New in libxml2dom 0.4.5 (Changes since libxml2dom 0.4.4)
130 --------------------------------------------------------
131
132 * Fixed crashes when parsing empty documents.
133 * Fixed operations involving the standard XML_NAMESPACE value, particularly
134 setAttributeNS.
135 * Introduced deletion of conflicting attributes in setAttributeNS.
136 * Added slightly nicer errors for parsing and serialising.
137 * Added some support for SOAP and XML-RPC message processing.
138
139 New in libxml2dom 0.4.4 (Changes since libxml2dom 0.4.3)
140 --------------------------------------------------------
141
142 * Relicensed under the LGPL version 3 or later (fixing PKG-INFO file).
143 * Improved XMPP support for messages, presence and events.
144 * Added Ubuntu Feisty (7.04) package support.
145
146 New in libxml2dom 0.4.3 (Changes since libxml2dom 0.4.2)
147 --------------------------------------------------------
148
149 * Enforced well-formedness in parse operations unless otherwise requested.
150 * Fixed access to null doctype properties.
151 * Added getElementById, firstChild and lastChild to the Node class.
152 * Added a __hash__ method to the Node class.
153 * Moved document checking into the Node class.
154 * Added an iterator for the NamedNodeMap class.
155 * Expanded the svg and events modules, including a test of SVG events.
156 * Split the debian-stable packages into debian-sarge and debian-etch.
157
158 New in libxml2dom 0.4.2 (Changes since libxml2dom 0.4.1)
159 --------------------------------------------------------
160
161 * Added missing impl attribute to NamedNodeMap, fixing attribute retrieval.
162 * Added documentElement to Document.
163 * Fixed and expanded the events module.
164 * Added lots of functionality to the svg module.
165
166 New in libxml2dom 0.4.1 (Changes since libxml2dom 0.4)
167 ------------------------------------------------------
168
169 * Fixed the absence of CDATA node creation and importing.
170
171 New in libxml2dom 0.4 (Changes since libxml2dom 0.3.6)
172 ------------------------------------------------------
173
174 * Changed the nodeValue property to return None for various node types, as
175 specified in the DOM specification (Level 3).
176 * Fixed various "not supported" exceptions and added tests which can raise
177 "wrong document" exceptions.
178 * Introduced an Implementation class, permitting specialised node creation.
179 * Added SVG-specific document support.
180 * Made parseURI work for HTML documents.
181 * Fixed getElementsByTagName(NS), as reported by Christian Seiler.
182 * Fixed previousSibling, nextSibling and parentNode crashes using
183 suggestions from Christian Seiler.
184 * Reintroduced node comparisons using suggestions from Christian Seiler.
185 * Fixed the absence of the CDATA node type.
186 * Added the textContent property to nodes.
187 * Added a getDOMImplementation function.
188 * Added an experimental events module.
189 * Added an htmlencoding parameter to the parse functions, as requested by
190 Iliyan Peychev.
191
192 New in libxml2dom 0.3.6 (Changes since libxml2dom 0.3.5)
193 --------------------------------------------------------
194
195 * Added cloneNode almost as a synonym for importNode (which, unlike in the
196 DOM specification, is present on all nodes).
197 * Introduced Debian stable package details - suggested by Robert Siemer.
198 * Changed libxml2mod import details to try libxmlmods - suggested by Lucian
199 Wischik.
200
201 New in libxml2dom 0.3.5 (Changes since libxml2dom 0.3.4)
202 --------------------------------------------------------
203
204 * Fixed nodeType for HTML document elements - reported by Robert Siemer.
205 * Fixed string results from XPath expressions - reported by Robert Siemer.
206
207 New in libxml2dom 0.3.4 (Changes since libxml2dom 0.3.3)
208 --------------------------------------------------------
209
210 * Attempted to introduce generated prefixes for attributes having namespaces
211 but whose names are unprefixed.
212 * Added support for xmlns attribute retrieval (getAttributeNS) and detection
213 (hasAttributeNS).
214 * Added the length attribute to NamedNodeMap; renamed the length method on
215 NodeList, adding a length attribute.
216
217 New in libxml2dom 0.3.3 (Changes since libxml2dom 0.3.2)
218 --------------------------------------------------------
219
220 * Removed redundant weakref usage.
221 * Added explicit copyright and licensing information to source files.
222
223 New in libxml2dom 0.3.2 (Changes since libxml2dom 0.3.1)
224 --------------------------------------------------------
225
226 * Improved the xmlns attribute creation controls.
227
228 New in libxml2dom 0.3.1 (Changes since libxml2dom 0.3)
229 ------------------------------------------------------
230
231 * Fixed empty namespace declarations on elements created with namespaceURI
232 set to None. Previously, such declarations were missing.
233 * Fixed attribute creation and introduced stricter controls over the
234 construction of xmlns attributes.
235
236 New in libxml2dom 0.3 (Changes since libxml2dom 0.2.4)
237 ------------------------------------------------------
238
239 * Imposed much stricter tests on strings used with the libxml2dom API.
240 Strings given as arguments to methods and functions must now only contain
241 ASCII characters; any other character data must be provided as Unicode
242 objects. This change fixes various issues with XPath expressions, and
243 quite probably various other things.
244 * Fixed parentNode on Document objects (which caused xml.dom.ext.PrettyPrint
245 to crash).
246 * Added some support for the doctype attribute and related information.
247 * libxml2dom is now licensed under the LGPL - see docs/COPYING.txt for
248 details.
249
250 New in libxml2dom 0.2.4 (Changes since libxml2dom 0.2.3)
251 --------------------------------------------------------
252
253 * Fixed Unicode conversions in the Node's xpath method.
254
255 New in libxml2dom 0.2.3 (Changes since libxml2dom 0.2.2)
256 --------------------------------------------------------
257
258 * Fixed the parse function's docstring.
259 * Added the owner element to obtained attribute nodes.
260 * Fixed Debian package changelog distribution identifiers.
261
262 New in libxml2dom 0.2.2 (Changes since libxml2dom 0.2.1)
263 --------------------------------------------------------
264
265 * Fixed exception raising in parseURI, adding a docstring to explain the
266 current limitations around HTML parsing.
267
268 New in libxml2dom 0.2.1 (Changes since libxml2dom 0.2)
269 ------------------------------------------------------
270
271 * Moved libxml2macro script to the tools directory.
272 * Added getElementsByTagNameNS.
273 * Added a normalize implementation.
274 * Added HTML parsing support.
275 * Added prettyprinting support.
276 * Fixed parseURI.
277 * Introduced better testing for Unicode objects, especially since things
278 like rdflib like to subclass the unicode type, and it might be more
279 convenient to detect such subclasses and convert their values
280 automatically.
281 * Improved some of the API documentation.
282 * Introduced better suppression of warnings, network access, and other
283 potentially intrusive libxml2 features.
284 * Reorganised the documentation, expanding the README.txt file at the
285 expense of the HTML documentation, but removing older, less relevant
286 information.
287 * Added Debian package support.
288
289 New in libxml2dom 0.2 (Changes since libxml2dom 0.1.3)
290 ------------------------------------------------------
291
292 * Adopted libxml2macro code within the libxml2dom classes, removing any
293 dependencies on the libxml2 module - this makes everything much faster
294 and virtually removes any necessity to use libxml2macro.
295 * Improved attribute and document node handling.
296 * Introduced document reference management.
297 * Introduced NodeList wrapper objects.
298
299 New in libxml2dom 0.1.3 (Changes since libxml2dom 0.1.2)
300 --------------------------------------------------------
301
302 * Fixed createElement.
303 * Introduced experimental libxml2macro tools, tests and libraries.
304
305 New in libxml2dom 0.1.2 (Changes since libxml2dom 0.1.1)
306 --------------------------------------------------------
307
308 * Fixed getAttributeNode and getAttributeNodeNS.
309 * Added comment node creation.
310 * Fixed empty namespace usage with elements and attributes.
311 * Introduced usage of the libxml2 file and memory parsing features.
312 * Introduced suppression of DTD retrieval and validation as the default
313 behaviour.
314 * Added experimental XPath method support.
315
316 New in libxml2dom 0.1.1
317 -----------------------
318
319 * Fixed text node creation.
320 * Fixed setAttributeNS.
321 * Added encoding parameters to convenience methods.
322 * Added the missing previousSibling property.
323 * Added release number to the package.
324
325 Release Procedures
326 ------------------
327
328 Update the libxml2dom/__init__.py and libxml2dom/macrolib/__init__.py
329 __version__ attributes.
330 Change the version number and package filename/directory in the documentation.
331 Update the version number in setup.py.
332 Check the setup.py file and ensure that all package directories are mentioned.
333 Change code examples in the documentation if appropriate.
334 Update the release notes (see above).
335 Update the package release notes (in the packages directory).
336 Check the release information in the PKG-INFO file.
337 Tag, export.
338 Archive, upload.
339 Make packages (see below).
340 Update PyPI, PythonInfo Wiki entries.
341
342 Making Packages
343 ---------------
344
345 To make Debian-based packages:
346
347 1. Create new package directories under packages if necessary.
348 2. Make a symbolic link in the distribution's root directory to keep the
349 Debian tools happy; choose one of the following:
350
351 ln -s packages/ubuntu-hoary/python2.4-libxml2dom/debian/
352 ln -s packages/ubuntu-feisty/python-libxml2dom/debian/
353 ln -s packages/ubuntu-gutsy/python-libxml2dom/debian/
354 ln -s packages/debian-sarge/python2.3-libxml2dom/debian/
355 ln -s packages/debian-etch/python-libxml2dom/debian/
356 ln -s packages/debian-lenny/python-libxml2dom/debian/
357
358 3. Run the package builder:
359
360 dpkg-buildpackage -rfakeroot
361
362 4. Locate and tidy up the packages in the parent directory of the
363 distribution's root directory.