You are not logged in Log in Join
You are here: Home » Members » Martijn Faassen's Page » XPath Methods » install

Log in
Name

Password

 

install

Installing XPath Methods

Making XPath Methods work for your Zope is unfortunately not as easy as it should be, due to its dependencies on PyXML and FourThought's 4Suite. 4Suite's XPath processor is the actual provider of XPath support for ParsedXML; XPath Methods are just a wrapper around them.

Installing XPath Methods itself is not too hard; just put the XPathMethods directory in your Zope Products directory and restart your Zope. Installing the dependencies to make them actually work is the hard part, so please read on beyond the requirements. I'm really sorry this is so terribly complicated; 4XPath is hard to detach from 4Suite (I gave up on the attempt), and 4Suite needs PyXML. The Formulator dependency is my fault, but you'll be doing yourself a favor installing it anyway. :) It may at least get easier in the future as Zope's binary distribution gains distutils support, and PyXML includes a working 4XPath.

Requirements

  • Recent Zope version. This has been tested with Zope 2.4, but should also work with 2.3. If not, let me know.
  • ParsedXML. I use the most recently released version 1.1b1. This is available in source form as well as in binary form for Windows, so installing this shouldn't be a problem. You can find ParsedXML here:

    http://www.zope.org/Members/karl/ParsedXML/ParsedXML

    If you use the Windows binary, for now you appear to be stuck with Zope 2.3, as the latest binary has only been compiled for Python 1.5.2, while Zope 2.4 requires Python 2.1.

    After unpacking ParsedXML and placing it in the Products directory, make sure the directory there is named ParsedXML, not ParsedXML-1.1b1. Otherwise products such as XPathMethods which depend on it won't be able to import from ParsedXML.

  • A recent version of Formulator (let's say 1.0 or newer). Formulator can be found here:

    http://www.zope.org/Members/faassen/Formulator

    To install it just follow Formulator's installation instructions.

  • PyXML 0.6.6. 0.6.5 might work as well; if it does, let me know. You can find PyXML here:

    http://pyxml.sourceforge.net

    The actual download page is here:

    http://sourceforge.net/project/showfiles.php?group_id=6473&release_id=46829

    See below for more installation instructions.

  • 4Suite 0.11.1 or later. You can find 4Suite here:

    http://www.4suite.org

    The actual download page is here:

    http://www.4suite.org/download.html

    Note that having 4Suite 0.11.1 installed for your Zope's Python breaks the Zope debug screen in the control panel for obscure reasons (bug in 4Suite's cDomlettec implementation). I've already sent in a fix for this to FourThought, so this should appear in the next version.

    If you're using Debian, Debian's packaged 4Suite version was at the time of this writing actually not recent enough, even though its version number seems to indicate otherwise.

    See below for more installation structions.

  • If you are using Python 1.5.2, you may need to install distutils first, to make the other installers work. Python versions 2.0 and up already contain a working distutils (except Zope's packaged version of Python; see below..). If you need it, you can find distutils here:

    http://www.python.org/sigs/distutils-sig/download.html

Installing the dependencies

It's probably the easiest to use Zope with a separate Python installation; so, not using the prebuilt Python in the binary version of Zope for your platform. This because distutils, needed into install several of these packages, does not yet work with the binary distribution of Zope 2.4.1 and lower. The binary distribution of Zope 2.4.2 will fix that. In this document I'll assume you have Zope working with a separate version of Python.

If on Linux, this could be your Linux distribution's Python, though be aware that Zope versions before 2.4 require Python 1.5.2, while Zope version 2.4 requires Python 2.1 to work. For most Linux distributions, Python 1.5.2 is still supplied, which means you'll have to install your own Python if you want to use Zope 2.4.

For Unix I suggest that at least for testing proposals you install this in a user's homedirectory, so you are not messing up your distribution's Python. You can do this using the --prefix option of the configure script of the Python sources. That's all I'll say about compiling and installing Python; there are other channels to be found through www.python.org if you want more information.

On Windows, you'll just have to install the right version of Python and work with that. If anyone can supply more detailed instructions feel free to contribute them.

If you're on a Unixy system, follow the following instructions to install the various dependencies from sources. Alternatively you could try downloading binary packages such as RPMs or Windows installers and install those.

Unpack PyXML:

    tar xvzf PyXML-0.6.6.tar.gz

Go to the PyXML directory:

    cd PyXML-0.6.6

Now be careful to use the Python that also runs Zope; if you use another Python, we're going to install PyXML for that other Python installation, so beware. This is also why we need a non-Zope python, as the python included with Zope's binary distribution doesn't work with distutils. In my case I've put this python in /home/faassen/XMLZope/bin. First, to build PyXML (you could also skip this step as the install step will do the building if you do):

    /home/faassen/XMLZope/python setup.py build

Then to install it in the right place:

    /home/faassen/XMLZope/python setup.py install

After seeing a whole lot of stuff on your screen, PyXML ought to be installed.

Installing 4Suite (from source)

Unpack 4Suite:

    tar xvzf 4Suite-0.11.1b6.tar.gz 

Go to the 4Suite directory:

    cd 4Suite-0.11.1b6

Now invoke distutils to build, again with the right version of the Python interpreter:

    /home/faassen/XMLZope/bin/python setup.py build

And after the compilation has finished, we'll install:

    /home/faassen/XMLZope/bin/python setup.py install

We should now be done with the installation of the dependencies (if you have ParsedXML and Formulator installed as well, but those are easier, though ParsedXML does need to be compiled if you got it in source form..). Restart your Zope with XPath Methods installed and try them out. Have fun!