[XML-SIG] Python API for the Sablotron XSL Processor

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 7 Nov 2000 01:03:39 +0100

> I copied a new version of Sab-pyth, the Python interface for the
> Sablotron XSL processor, on our website at:
> http://www.ubka.uni-karlsruhe.de/~guenter/Sab-pyth/

I put a link on


If you'd like a different text, please sent me a patch against


[also let me know if I should remove the link]

> I appreciate all kinds of comments, also some testing and/or code
> reviewing would be nice (I am not sure I am doing all the reference
> counting in C right...).

I only had a shallow look (not having used Sablotron before); here's
what I found:

- would be nice to use distutils for setup. If you think it is too
  much trouble for 1.5.2 users to install Distutils before, you can
  still continue to provide Setup.in for backwards compatibility.
  Please note that it also gives an advantage for the maintainer:
  You can produce RPMs and Windows Installers quite easily.
- on building Python objects: using specific constructor functions
  instead of Py_BuildValue is preferred most of the time; if nothing
  else, it is faster. Specifically, don't write

     retval = Py_BuildValue("s", ret);

  instead write

     retval = PyString_FromString(ret);

  Likewise PyInt_FromLong.

- I believe freedbllist/makedbllist doesn't work if initialization of
  the list is incomplete (e.g. some of the elements are not string
  pairs): the dbllist should be allocated with calloc, so any uninitialised
  pointer is zero (or freedbllist should get the number of elements).

- Also, is it really necessary to strcpy all the strings in a dbllist?
  It would be if Sablotron modifies the strings (or the dbllists); if it
  merely looks at them, then putting the char* of the PyString into
  the list may be sufficient.

Otherwise, your code looks quite clean to me; I could not spot any
refcounting problems.