Re: [xslt] get libxslt version via python? debugging transform



On Tue, Dec 19, 2006 at 06:27:11PM -0500, Brad Clements wrote:
> On 13 Dec 2006 at 5:48, Daniel Veillard wrote:
> 
> >   I don't see how you can expect to have libxml2-python-2.6.21 and
> > libxml2-2.6.27-1 RPMs installed simultaneously without troubles. Sorry
> > that seems to be too much of a hack, that subsequent problems sounds
> > somehow impossible to debug.
> 
> Sorry for the delay in responding, it's been a tough week.
> 
> Also, I'm sorry my original post was not clear. Let me break it up into two 
> questions.
> 
> 1. when using python bindings for libxml2 and libxslt, how can I find out from 
> python which libxml2 and libxslt version is being used?
> 
> I thought I might find a module global like LIBXML_VERSION_STRING, but I 
> can't find anything like that.

  Right, it seems to be missing, that's available at the C level though

> 2. I have an .xslt stylesheet that functions correctly under some versions of libxslt, 
> but not others.
> 
> It works using this xsltproc:
> 
> Using libxml 20627, libxslt 10118 and libexslt 813
> xsltproc was compiled against libxml 20627, libxslt 10118 and libexslt 813
> libxslt 10118 was compiled against libxml 20627
> libexslt 813 was compiled against libxml 20627
> 
> 
> It also works with xmlstarlet 1.0 (which I know uses an old statically linked libxslt)
> 
> The rpms I have installed are:
> 
> libxml2-2.6.27-1
> libxslt-1.1.18-1
> libxml2-python-2.6.27-1
> libxslt-python-1.1.18-1
> 
> 
> Now the twist. Because I am using an alternate install for Python 2.4 on my 
> system, I cannot use libxslt-python RPM because that only adds libxslt support to 
> the system python. 
> 
> The way I handle this is I download: 
> 
> ftp://xmlsoft.org/libxslt/python/libxml2-python-2.6.21.tar.gz
> 
> and run setup.py against my alternate python.
> 
> I assume that links against the current RPM version of libxslt (that is, 1.1.18-1)
> 
> 
> However when I use libxslt2 from my alternate python install, the transform fails 
> unexpectedly with:
> 
> element copy-of
> Attribute nodes must be added before any child nodes to an element.

  Your stylesheet seems to work with the new version, not with the old one
(I don't see why you're using the old version in your alternate). Probably
the result of bug fixes available only in the new version.

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]