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