[lxml-dev] Using EXSLT extensions on Windows with standard lxml binaries

Hello! I'm trying to use EXSLT extension functions on Windows with standard lxml binary distribution (lxml-1.3.6.win32-py2.4.exe) I'm trying to do the next, but it is not work as expected: <?xml version="1.0"?> <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:str="http://exslt.org/strings" extension-element-prefixes="str"> <xsl:template match="body"> <body> <h1 class="{str:replace('abc', 'b', 'x')}">test</h1> </body> </xsl:template> </xsl:stylesheet> Is it possible to use EXSLT extensions on Windows without rebuilding of standard binaries? Thanks in advance -- Best regards, Alexander mailto:alexander.kozlovsky@gmail.com

Hi, Alexander Kozlovsky wrote:
What result do you get?
Try removing the following line (except for the '>', obviously):
extension-element-prefixes="str">
Never tried, but I wouldn't know a reason why this should fail. Stefan

This exception: XSLTApplyError: Internal error: Failed to evaluate the AVT of attribute 'class'
Try removing the following line (except for the '>', obviously):
extension-element-prefixes="str">
I got the same error
Probably I misread this old message: http://codespeak.net/pipermail/lxml-dev/2006-April/001098.html "However, this requires linking against libexslt" So, I have supposed (maybe incorrectly) standard widows binaries does not linked against libexslt -- Best regards, Alexander mailto:alexander.kozlovsky@gmail.com

Hi, Alexander Kozlovsky wrote:
Interesting. Could you run the test suite from the source distribution? There are a couple of EXSLT tests in there. Just unpack the source tar.gz from PyPI and (having lxml installed) run "python test.py".
That shouldn't have anything to do with it. Stefan

Hi, Alexander Kozlovsky wrote:
This definitely works for me on Linux: ------------------------------ def test_exslt_str_attribute_replace(self): tree = self.parse('<a><b>B</b><c>C</c></a>') style = self.parse('''\ <xsl:stylesheet version = "1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:str="http://exslt.org/strings" extension-element-prefixes="str"> <xsl:template match="/"> <h1 class="{str:replace('abc', 'b', 'X')}">test</h1> </xsl:template> </xsl:stylesheet>''') st = etree.XSLT(style) res = st(tree) self.assertEquals('''\ <?xml version="1.0"?>\n<h1 class="aXc">test</h1>\n''', str(res)) ------------------------------ May be a problem with the Windows build? Stefan

Hi, Alexander Kozlovsky wrote:
I just checked the release notes of libxslt. They say that str:replace was "improved" in libxslt 1.1.20. However, my tests show that it does not work in any version before 1.1.21, so I assume the binary build uses 1.1.20 or an older version. http://xmlsoft.org/XSLT/news.html Stefan

On Thu, Feb 28, 2008 at 2:30 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
I am almost sure we are using 1.1.19 for building the binary. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

On Thu, Feb 28, 2008 at 5:51 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
"are using" means: also for the lxml 2.0.x builds?
Yes. I remember back at the time there were issues with .20 or .21 (can't recall) so you told me to stick around with .19. I completely missed that .22 was out. What should we do? Release new builds of 1.3.x with updated libxslt? I haven't built the latest 2.x yet, so that one should get the newer libxslt (as soon as zlatkovic.com is back). -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

Hi, Sidnei da Silva wrote:
This is not a critical problem, so I wouldn't do a re-release. If you can build 2.0.2 with a newer libxslt, that's just fine. I currently don't have the time to backport fixes for a 1.3.7 release, but once that gets done, we'll have that problem sorted out as well. Is there a way you could document the libxml2/libxslt versions used when uploading binaries? Like, in the file comment on PyPI?
I haven't built the latest 2.x yet, so that one should get the newer libxslt (as soon as zlatkovic.com is back).
This works just fine for me, and it has libxslt 1.1.22: ftp://ftp.zlatkovic.com/pub/libxml Stefan

On Fri, Feb 29, 2008 at 5:32 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Ok, 2.0.2 is up.
Is there a way you could document the libxml2/libxslt versions used when uploading binaries? Like, in the file comment on PyPI?
Right now, only if I do it manually, or if I override the 'upload' setuptools command. There's no command-line or setup.py option to specifying what the comment will be, it is hardcoded inside the 'upload' command. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

Hi Sidnei, Sidnei da Silva wrote:
Overriding 'upload' isn't practicable as there isn't a hook for it. The comment is built right before uploading the file. You could add a line to the package description on the PyPI site manually, like "the Windows binary downloads on this site statically include libxml2 2.6.XY and libxslt 1.1.Z". Not sure you're currently allowed to do so, though. Stefan

Hi, Alexander Kozlovsky wrote:
What result do you get?
Try removing the following line (except for the '>', obviously):
extension-element-prefixes="str">
Never tried, but I wouldn't know a reason why this should fail. Stefan

This exception: XSLTApplyError: Internal error: Failed to evaluate the AVT of attribute 'class'
Try removing the following line (except for the '>', obviously):
extension-element-prefixes="str">
I got the same error
Probably I misread this old message: http://codespeak.net/pipermail/lxml-dev/2006-April/001098.html "However, this requires linking against libexslt" So, I have supposed (maybe incorrectly) standard widows binaries does not linked against libexslt -- Best regards, Alexander mailto:alexander.kozlovsky@gmail.com

Hi, Alexander Kozlovsky wrote:
Interesting. Could you run the test suite from the source distribution? There are a couple of EXSLT tests in there. Just unpack the source tar.gz from PyPI and (having lxml installed) run "python test.py".
That shouldn't have anything to do with it. Stefan

Hi, Alexander Kozlovsky wrote:
This definitely works for me on Linux: ------------------------------ def test_exslt_str_attribute_replace(self): tree = self.parse('<a><b>B</b><c>C</c></a>') style = self.parse('''\ <xsl:stylesheet version = "1.0" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:str="http://exslt.org/strings" extension-element-prefixes="str"> <xsl:template match="/"> <h1 class="{str:replace('abc', 'b', 'X')}">test</h1> </xsl:template> </xsl:stylesheet>''') st = etree.XSLT(style) res = st(tree) self.assertEquals('''\ <?xml version="1.0"?>\n<h1 class="aXc">test</h1>\n''', str(res)) ------------------------------ May be a problem with the Windows build? Stefan

Hi, Alexander Kozlovsky wrote:
I just checked the release notes of libxslt. They say that str:replace was "improved" in libxslt 1.1.20. However, my tests show that it does not work in any version before 1.1.21, so I assume the binary build uses 1.1.20 or an older version. http://xmlsoft.org/XSLT/news.html Stefan

On Thu, Feb 28, 2008 at 2:30 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
I am almost sure we are using 1.1.19 for building the binary. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

On Thu, Feb 28, 2008 at 5:51 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
"are using" means: also for the lxml 2.0.x builds?
Yes. I remember back at the time there were issues with .20 or .21 (can't recall) so you told me to stick around with .19. I completely missed that .22 was out. What should we do? Release new builds of 1.3.x with updated libxslt? I haven't built the latest 2.x yet, so that one should get the newer libxslt (as soon as zlatkovic.com is back). -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

Hi, Sidnei da Silva wrote:
This is not a critical problem, so I wouldn't do a re-release. If you can build 2.0.2 with a newer libxslt, that's just fine. I currently don't have the time to backport fixes for a 1.3.7 release, but once that gets done, we'll have that problem sorted out as well. Is there a way you could document the libxml2/libxslt versions used when uploading binaries? Like, in the file comment on PyPI?
I haven't built the latest 2.x yet, so that one should get the newer libxslt (as soon as zlatkovic.com is back).
This works just fine for me, and it has libxslt 1.1.22: ftp://ftp.zlatkovic.com/pub/libxml Stefan

On Fri, Feb 29, 2008 at 5:32 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
Ok, 2.0.2 is up.
Is there a way you could document the libxml2/libxslt versions used when uploading binaries? Like, in the file comment on PyPI?
Right now, only if I do it manually, or if I override the 'upload' setuptools command. There's no command-line or setup.py option to specifying what the comment will be, it is hardcoded inside the 'upload' command. -- Sidnei da Silva Enfold Systems http://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214

Hi Sidnei, Sidnei da Silva wrote:
Overriding 'upload' isn't practicable as there isn't a hook for it. The comment is built right before uploading the file. You could add a line to the package description on the PyPI site manually, like "the Windows binary downloads on this site statically include libxml2 2.6.XY and libxslt 1.1.Z". Not sure you're currently allowed to do so, though. Stefan
participants (3)
-
Alexander Kozlovsky
-
Sidnei da Silva
-
Stefan Behnel