DOM Binding For Tcl

TclDOM

Steve Ball

Zveno Pty Ltd


  
    www.zveno.com
  

$Id: README.xml,v 1.1 2003/03/09 11:14:56 balls Exp $

Revision History
Revision 2.6

Table of Contents

Installation
Dependencies
Pure-Tcl Installation
Compiled Installation
Usage

This package provides a DOM binding for Tcl. It provides the following implementations:

See the TclXML website for more information on XML support for Tcl.

Contact Steve Ball for information about this release.

Installation

How you install the package depends on which components you require.

Dependencies

All in cases, the following packages must be installed before attempting to install TclDOM.

Tcllib

http://dev.scriptics.com/software/tcllib/

In order for the Tcl-only parser to resolve external entities, the tcllib package must be installed.

Be sure to get a version which includes the uri package. Version 1.2 or better is recommended.

The latest CVS snapshot may be found at the SourceForge project page.

TclXML

First install TclXML version 2.6.

Note

You must install the same numbered version as this package, ie. 2.6.

Pure-Tcl Installation

no compilation required

The install.tcl script will install the pure-Tcl DOM implementation. Run it using wish, eg.

wish install.tcl

Note

If Tcl/Tk has been configured correctly on your system, you should be able to simply double-click the script

If the pure-Tcl parser is good enough for you, then read no further.

Compiled Installation

If you need the speed of a compiled DOM implementation, then you have three options:

  • TclDOM/C (a.k.a. TclDOMPro)

  • TclDOM/libxml2

  • tDOM (different API to TclDOM, but similar functionality)

Compiling TclDOM/libxml2

Additional Dependencies

In order to build TclDOM/libxml2, first install the libxml2 library itself. Download libxml2 from the libxml2 website. There are binary distributions available for some platforms.

Unix/Linux

You must have Tcl/Tk version 8.2 or better installed on your system. Tcl/Tk 8.3 or better is recommended.

  1. Unpack the TclDOM distribution and cd into the tcldom-2.6 directory.

  2. Run the configure script, with the [--prefix], [--exec_prefix] and [--enable-threads] switches (the latter only if Tcl has been built with threads enabled).

    For example, on my system I have Tcl 8.4 installed in /usr/local/tcl8.4 so I would use the command:

    ./configure --prefix=/usr/local/tcl8.4 --exec-prefix=/usr/local/tcl8.4 --enable-threads
  3. make
  4. make install

    You may have to do this as root

  5. cd src-libxml2
  6. Run the configure script, with the same values as above for the [--prefix], [--exec_prefix] and [--enable-threads] switches.

    Note

    If libxml2 was installed in a non-standard location you might have to add the [--with-xml2-include] and [--with-xml-lib] switches.

    Note

    On Windows the iconv library is required too. See www.fh-frankfurt.de/~igor/projects/libxml/ for either precompiled binaries, or a link to the sources. The relevant options are [--with-iconv-include] and [--with-iconv-lib].

    For example, on my Linux system I have Tcl 8.4 installed in /usr/local/tcl8.4 and libxml2 installed in /usr/local so I would use the command:

    ./configure --prefix=/usr/local/tcl8.4 --exec-prefix=/usr/local/tcl8.4 --enable-threads --with-xml2-include=/usr/local/include --with-xml2-lib=/usr/local/lib
  7. make
  8. make install

    You may have to do this as root

Usage

See reference documentation.