2001-03-09 14:31:34 UTC
I started experimenting with Sablotron/PySablot just recently, and it's pleasantly fast.
Thanks for writing the Python interface!
However, I was surprised to find that it's not throwing python exceptions when a parse error occurs (and perhaps when other errors occur as well).
For example, say I have a stylesheet with an unclosed element in it. If I run something like the following code:
xslfile = open('bad.xsl')
xmlfile = open('good.xml')
output = PySablot.ProcessStrings(xslfile.read(), xmlfile.read())
No exception is thrown, but the following is printed to stderr:
Error [code:2] [URI:arg:/_stylesheet] [line:38]
XML parser error 7: mismatched tag
It would be much better (I think) for the error message from Sablot to be thrown as a proper python exception (with the error message text included as an exception argument), so that calling code can catch it (and report the error to the end user, etc).