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