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