# HG changeset patch # User paulb # Date 1124130587 0 # Node ID 74ad868608905d97639a08b1b48c96d1af5185e7 # Parent a776fa1ff4f2504a5b2dca51fe41e53ef70a8878 [project @ 2005-08-15 18:29:47 by paulb] Reorganised the documentation, removing dependency information from the HTML documentation (which is now in the README.txt file). Moved the libxml2macro details into a separate file. diff -r a776fa1ff4f2 -r 74ad86860890 docs/NOTES_libxml2macro.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/NOTES_libxml2macro.txt Mon Aug 15 18:29:47 2005 +0000 @@ -0,0 +1,48 @@ +Experiments +----------- + +The libxml2macro.py program, along with the libxml2dom.macrolib package +provide support for writing DOM-style code which is then translated to +libxml2mod-style code before being compiled to normal Python modules. This +special translation should eliminate the need for high-level wrapper objects +in most cases as well as low-level libxml2 objects, since the actual compiled +code will be using the libxml2mod functions directly. + +To use libxml2macro.py, first write your code using the typical PyXML DOM +style, but make sure that you use a common prefix for all node variables and +which is not used by any other kind of variable, and make sure that you do not +re-use node variables to refer to other kinds of object. Here is an example of +the coding style: + + # My module. + + import libxml2macro as my_ + + def processing_function(my_document, some_args): + + # Perform actions on nodes: + + my_node = my_document.createElementNS("namespace", "some-name") + + # Perform actions on other data as normal: + + some_function(some_args) + +Then, run libxml2macro.py on the module like this (using tests/macrotest.py as +an example): + + tools/libxml2macro.py tests/macrotest.py + +This produces a compiled module that can be imported into Python; for example: + + cd tests + python + import macrotest + +It should be possible to run the module directly; for example: + + python tests/macrotest.pyc + +Note that running the module using the source filename will probably result in +the compiled module being overwritten and various errors being produced. So +don't do that! diff -r a776fa1ff4f2 -r 74ad86860890 docs/index.html --- a/docs/index.html Mon Aug 15 18:28:56 2005 +0000 +++ b/docs/index.html Mon Aug 15 18:29:47 2005 +0000 @@ -3,7 +3,6 @@ libxml2dom -

libxml2dom

The libxml2dom package provides a traditional DOM wrapper around the @@ -31,84 +30,4 @@ on the PYTHONPATH and can be installed using the setup.py script provided:

-
python setup.py install
-

Dependencies and Installation Issues

-

The following descriptions identify dependencies and describe -appropriate -installation issues with each dependency:

-

libxml2 2.6.16

-

Building libxml2 from source and configuring the Python bindings can -be -done as follows:

-
cd libxml2-2.6.16
./configure --with-python=/usr/local/bin/python
make
-

If you are to use an installation of Python installed outside -/usr/local then specify the "prefix" accordingly. Install -(possibly as root) in the usual way:

-
make install
-

Previous releases of libxml2 in the 2.6 series may work, but some -bugs -were observed with the previously recommended 2.6.0 and these may not -have -been fixed until 2.6.16 or slightly earlier.

-

Issues

-

The patches directory in the source code distribution -contains a patch against libxml2 2.5.7 which resolves an issue exposed -by -libxml2dom. Although it is recommended that later releases of libxml2 -are -used instead, the source code distribution of libxml2 2.5.7 can be -patched as -follows:

-
patch -p0 < libxml2dom/patches/libxml2/libxml.c.diff
-

The command should be run outside/above the libxml2-2.5.7 -directory, and the stated path should be adjusted accordingly.

-

Python 2.2

-

Python releases from 2.2 onwards should be compatible with -libxml2dom. The -principal requirement from such releases is the new-style class support -which -permits the use of properties in the libxml2dom implementation, thus -simplifying the code somewhat.

-

Changelog

-

New in libxml2dom 0.2.1

- -

New in libxml2dom 0.2

- -

New in libxml2dom 0.1.3

- -

New in libxml2dom 0.1.2

- -

New in libxml2dom 0.1.1

- - \ No newline at end of file +
python setup.py install
\ No newline at end of file