Python Expat wrapper module, version 1.3, 15-Oct-98
===================================================


If you have downloaded the binary distribution for the macintosh you
can skip the "building" sections and go straight to the "using"
bit. If you are using a macintosh and do want to build from source you 
should get the pyexpat.tgz distribution (Stuffit Expander with
Expander Enhancer will know how to unpack a gzipped tar file).

Changes since version 1.2
-------------------------

Minimal changes, really: a memory leak in the callback routine was
plugged, and exceptions in the callback are now passed through to the
mainline code. The module also exports a version attribute.

Building the pyexpat module under unix
--------------------------------------

- Build libexpat.a in expat. This version is very slightly different 
  from the original by James Clark (the libexpat.a target was added,
  and a few C++ comments were replaced by C comments).
- Edit Makefile.pre.in and set your installdir
- make -f Makefile.pre.in VERSION=1.5.1 Makefile
- make sharedmods
- put the shared module somewhere in your sys.path

(if you want a static Python edit Setup.in, and replace the last line
with "make").

Building the pyexpat module on the macintosh
--------------------------------------------
- Unpack the various .hqx project files.
- All the projects are linked, so building pyexpat.prj should build
  everything. If this doesn't work you will find the library
  subprojects to build in the expat folder.
- Use EditPythonPrefs to add the current folder to sys.path.

Using the pyexpat module
-----------------------

The pyexpat module exports two functions:
ParserCreate(encoding) Creates a new parser object. The optional
	encoding arg (a string) specifies the encoding.
ErrorString(number) Return a string corresponding to the given error
	number.

Parser objects have one method:
Parse(data, isfinal) Parse some data. If the optional isfinal arg is 1 
	this is the last bit of data. Returns true if parsing
	succeeded (so far), otherwise the error attributes have
	information on the error.

Parser objects have the following attributes:

StartElementHandler, EndElementHandler, CharacterDataHandler,
ProcessingInstructionHandler - The Python handlers called for various
	events. See below for the signatures.
ErrorCode, ErrorLineNumber, ErrorColumnNumber, ErrorByteIndex -
	Readonly integers giving information on the current parse
	error.

Testing it
----------

There's a very minimal test script in expattest.py. It should be easy 
to adapt it to generate ESIS (but I'm not familiar enough with ESIS to 
do it). This module parsed Hamlet in 2 seconds on an 180 Mhz R5000 SGI 
O2.

Feedback
--------

This module currently lives at
ftp://ftp.cwi.nl/pub/jack/python/pyexpatsrc.tgz (source) and
ftp://ftp.cwi.nl/pub/jack/python/pyexpat.hqx (macintosh binary-only).

The author is Jack Jansen, jack@cwi.nl. The expat proper was written
by James Clark and can be found at http://www.jclark.com/xml/ .

	Jack Jansen, CWI, Amsterdam
	jack@cwi.nl
