1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/NOTES_libxml2macro.txt Mon Aug 15 18:29:47 2005 +0000
1.3 @@ -0,0 +1,48 @@
1.4 +Experiments
1.5 +-----------
1.6 +
1.7 +The libxml2macro.py program, along with the libxml2dom.macrolib package
1.8 +provide support for writing DOM-style code which is then translated to
1.9 +libxml2mod-style code before being compiled to normal Python modules. This
1.10 +special translation should eliminate the need for high-level wrapper objects
1.11 +in most cases as well as low-level libxml2 objects, since the actual compiled
1.12 +code will be using the libxml2mod functions directly.
1.13 +
1.14 +To use libxml2macro.py, first write your code using the typical PyXML DOM
1.15 +style, but make sure that you use a common prefix for all node variables and
1.16 +which is not used by any other kind of variable, and make sure that you do not
1.17 +re-use node variables to refer to other kinds of object. Here is an example of
1.18 +the coding style:
1.19 +
1.20 + # My module.
1.21 +
1.22 + import libxml2macro as my_
1.23 +
1.24 + def processing_function(my_document, some_args):
1.25 +
1.26 + # Perform actions on nodes:
1.27 +
1.28 + my_node = my_document.createElementNS("namespace", "some-name")
1.29 +
1.30 + # Perform actions on other data as normal:
1.31 +
1.32 + some_function(some_args)
1.33 +
1.34 +Then, run libxml2macro.py on the module like this (using tests/macrotest.py as
1.35 +an example):
1.36 +
1.37 + tools/libxml2macro.py tests/macrotest.py
1.38 +
1.39 +This produces a compiled module that can be imported into Python; for example:
1.40 +
1.41 + cd tests
1.42 + python
1.43 + import macrotest
1.44 +
1.45 +It should be possible to run the module directly; for example:
1.46 +
1.47 + python tests/macrotest.pyc
1.48 +
1.49 +Note that running the module using the source filename will probably result in
1.50 +the compiled module being overwritten and various errors being produced. So
1.51 +don't do that!
2.1 --- a/docs/index.html Mon Aug 15 18:28:56 2005 +0000
2.2 +++ b/docs/index.html Mon Aug 15 18:29:47 2005 +0000
2.3 @@ -3,7 +3,6 @@
2.4
2.5 <title>libxml2dom</title><meta name="generator" content="amaya 8.1a, see http://www.w3.org/Amaya/">
2.6 <link href="styles.css" rel="stylesheet" type="text/css"></head>
2.7 -
2.8 <body>
2.9 <h1>libxml2dom</h1>
2.10 <p>The libxml2dom package provides a traditional DOM wrapper around the
2.11 @@ -31,84 +30,4 @@
2.12 on the
2.13 PYTHONPATH and can be installed using the <code>setup.py</code> script
2.14 provided:</p>
2.15 -<pre>python setup.py install</pre>
2.16 -<h2>Dependencies and Installation Issues</h2>
2.17 -<p>The following descriptions identify dependencies and describe
2.18 -appropriate
2.19 -installation issues with each dependency:</p>
2.20 -<h3>libxml2 2.6.16</h3>
2.21 -<p>Building libxml2 from source and configuring the Python bindings can
2.22 -be
2.23 -done as follows:</p>
2.24 -<pre>cd libxml2-2.6.16<br>./configure --with-python=/usr/local/bin/python<br>make</pre>
2.25 -<p>If you are to use an installation of Python installed outside
2.26 -<code>/usr/local</code> then specify the "prefix" accordingly. Install
2.27 -(possibly as <code>root</code>) in the usual way:</p>
2.28 -<pre>make install</pre>
2.29 -<p>Previous releases of libxml2 in the 2.6 series may work, but some
2.30 -bugs
2.31 -were observed with the previously recommended 2.6.0 and these may not
2.32 -have
2.33 -been fixed until 2.6.16 or slightly earlier.</p>
2.34 -<h4>Issues</h4>
2.35 -<p>The <code>patches</code> directory in the source code distribution
2.36 -contains a patch against libxml2 2.5.7 which resolves an issue exposed
2.37 -by
2.38 -libxml2dom. Although it is recommended that later releases of libxml2
2.39 -are
2.40 -used instead, the source code distribution of libxml2 2.5.7 can be
2.41 -patched as
2.42 -follows:</p>
2.43 -<pre>patch -p0 < libxml2dom/patches/libxml2/libxml.c.diff</pre>
2.44 -<p>The command should be run outside/above the <code>libxml2-2.5.7</code>
2.45 -directory, and the stated path should be adjusted accordingly.</p>
2.46 -<h3>Python 2.2</h3>
2.47 -<p>Python releases from 2.2 onwards should be compatible with
2.48 -libxml2dom. The
2.49 -principal requirement from such releases is the new-style class support
2.50 -which
2.51 -permits the use of properties in the libxml2dom implementation, thus
2.52 -simplifying the code somewhat.</p>
2.53 -<h2>Changelog</h2>
2.54 -<h3>New in libxml2dom 0.2.1</h3>
2.55 -<ul>
2.56 - <li>Moved <a href="libxml2macro.html">libxml2macro</a> script to the
2.57 -tools directory.</li>
2.58 - <li>Added getElementsByTagNameNS.</li><li>Added HTML parsing support.</li>
2.59 - <li>Improved some of the API documentation.</li>
2.60 -
2.61 -</ul>
2.62 -<h3>New in libxml2dom 0.2</h3>
2.63 -<ul>
2.64 - <li>Adopted <a href="libxml2macro.html">libxml2macro</a> code within
2.65 -the libxml2dom classes, removing any dependencies on the libxml2 module
2.66 -- this makes everything much faster and virtually removes any necessity
2.67 -to use libxml2macro.</li>
2.68 - <li>Improved attribute and document node handling.</li>
2.69 - <li>Introduced document reference management.</li>
2.70 - <li>Introduced NodeList wrapper objects.</li>
2.71 -</ul>
2.72 -<h3>New in libxml2dom 0.1.3</h3>
2.73 -<ul>
2.74 - <li>Fixed createElement.</li>
2.75 - <li>Introduced experimental libxml2macro tools, tests and libraries.</li>
2.76 -</ul>
2.77 -<h3>New in libxml2dom 0.1.2</h3>
2.78 -<ul>
2.79 - <li>Fixed getAttributeNode and getAttributeNodeNS.</li>
2.80 - <li>Added comment node creation.</li>
2.81 - <li>Fixed empty namespace usage with elements and attributes.</li>
2.82 - <li>Introduced usage of the libxml2 file and memory parsing features.</li>
2.83 - <li>Introduced suppression of DTD retrieval and validation as the
2.84 -default behaviour.</li>
2.85 - <li>Added experimental XPath method support.</li>
2.86 -</ul>
2.87 -<h3>New in libxml2dom 0.1.1</h3>
2.88 -<ul>
2.89 - <li>Fixed text node creation.</li>
2.90 - <li>Fixed setAttributeNS.</li>
2.91 - <li>Added encoding parameters to convenience methods.</li>
2.92 - <li>Added the missing previousSibling property.</li>
2.93 - <li>Added release number to the package.</li>
2.94 -</ul>
2.95 -</body></html>
2.96 \ No newline at end of file
2.97 +<pre>python setup.py install</pre></body></html>
2.98 \ No newline at end of file