Hello,
I have just put together a Python interface for the basic Sablotron
APIs. The thing is calles Sab-pyth, Version 0.2 and is right now
located at http://www.ubka.uni-karlsruhe.de/~guenter/Sab-pyth/.
Handlers via SablotRegHandler() and SablotUnregHandler() are not
supported, yet. Documentation is not written, yet. Some things are
tested, most are not (so they may work?). I hope I find some more
time...
There is an example file testsab2.py that shows how to use it. The
build process is the same as with the original Sab-pyth-0.1. There is
no copyright statement, yet, but I plan to put something like in
Python 1.5 in (... may be used by anyone for any purpose free of
charge... may in no case be liable for anything ... is copyright by
...), because today everything seems to need a copyright.
You may experience build problems because
- the Makefile.pre.in is from Python 1.6 - if you have an older
version, copy
/usr/local/lib/python$(your_python_version)/config/Makefile.pre.in
to the module's directory.
- you may not need "-liconv". Remove "-liconv" from Setup.pre.in and
start (with make -f Makefile.pre.in boot) again.
- I have not updated the build instruction contained in the modules
directory. Refer to an older mail of mine to the Sablotron
development list (hope You can find that somewhere).
--------------------
Now I have this, I wish to ask a few questions I have about the
Sablotron C-Language API:
1. Are the functions SablotSetBase and SablotSetBaseForScheme new or
are they old? Will they be maintained? The sabcmd program has a
command line option to set some base, but this is never done (in
version 0.44).
2. What are SablotSetInstanceData() and SablotGetInstanceData() for?
Normally I would create a struct containig all the stuff needed in my
Python object, including the sablotron processor.
One situation that comes to mind: I could store the
address of the Python object with SablotSetInstanceData() and retrieve
it when I get called from Sablotron giving me tha processor only (and
I need the Python object). Where can this happen? Looks like
handlers have there own private data pointer so I don't need it there,
right?
3. Why is the first arg to SablotSetBaseForScheme declared "void *"?
Should we pass NULL-Pointers here?
4. Are there any plans for further APIs that allow me to extend XSL
and more important, XPath (eg. I want to write simple string
conversion functions in Python and use them in XSL)?
5. What else besides the converted output can be put in the ResultArgs
and how? Is there a way to retrieve error messages with the %ses
replaced by their values?
--
Guenter Radestock, Universitaetsbibliothek Karlsruhe
[EMAIL PROTECTED]
http://www.ubka.uni-karlsruhe.de/~guenter