[lxml-dev] Segfault on XSLT/XPath undefined variable error.
John Krukoff
jkrukoff at ltgc.com
Thu Jul 31 21:07:07 CEST 2008
On Thu, 2008-07-31 at 20:13 +0200, Stefan Behnel wrote:
> Hi,
>
> John Krukoff wrote:
> > Okay, can only get it to crash when first signing a document using
> > libxmlsec, so I suppose I'll simply assume that the two libraries use
> > the error log in incompatible ways.
> >
> > I'll work around it by signing the document in a separate process, I
> > think.
>
> That should work, yes. However, I think in the specific case of libxslt, I
> might be able to make the error logging setup local to an XSLT call. It should
> not be needed anywhere else, so this would reduce the chance for collisions.
>
> Thanks for the report anyway, at least it made me aware of such problems.
>
> BTW, since you are using libxmlsec (which I never needed), how do you use it
> together with lxml? (Assuming that it doesn't crash, that is...) Do you think
> there is space left for a tighter integration, or does your current usage
> match your use case (well enough)?
>
> Stefan
>
I've been using this set of python bindings from verisign:
http://xmlsig.sourceforge.net/testing.html
Which required me to serialize my lxml tree, and then reparse, with the
same for the output. I wouldn't recommend it, but then the verisign
module itself is hard to recommend since it's both poorly documented and
prone to crashing.
If I had the time to start over, I'd give these bindings a look, since
they at least look to be python specific:
http://pyxmlsec.labs.libre-entreprise.org/
They don't look like much more than I'd get with just calling the thing
directly with ctypes, and I chose the verisign module since the simpler
interface was much easier to get up and running.
So, yeah, things could work much better. I've no idea how commonly used
the XML signature standard is, I'm implementing it for integration with
a vendor that requires it. It seems to be much more of a Java/.NET
enterprise kind of thing. From the sample code we've gotten, I am
envious of how easy it is to use in .NET, given the standard library
support for it.
Since I've got some sample code from my vendor in C#, I'm thinking about
just calling out to that since I need to move things to another process
anyway. The .NET xmldsig stuff appears to work on mono, so I may go that
route.
Basically, I'm trying to say that as far as I've been able to tell,
there's no good interface for doing xmldsig in python, which is actually
the first time I've run into that with the language and an open
standard.
--
John Krukoff <jkrukoff at ltgc.com>
Land Title Guarantee Company
More information about the lxml-dev
mailing list