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



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.


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.


This stylesheet used to work some months ago, but I don't know exactly what has 
changed on my system since then.

To debug, I have added lots of xsl:message elements to my stylesheet, and I am 
still perplexed as to why my stylesheet would fail, but only when transformed from 
the alternate python install.

So to debug this more, I want to be certain which version of libxslt is being used 
by the alternate python install (hence question #1)

Once I know that, I can look through bugzilla to see if there were any known 
issues related to the version I am using.

Thanks!





-- 
Brad Clements,                bkc murkworks com    (315)268-1000
http://www.murkworks.com                          
AOL-IM or SKYPE: BKClements




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