[lxml-dev] Using EXSLT extensions on Windows with standard lxml binaries
![](https://secure.gravatar.com/avatar/14ee766a8f92667b755c18b8499b4c77.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, Alexander Kozlovsky wrote:
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:
What result do you get?
<?xml version="1.0"?> <xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:str="http://exslt.org/strings"
Try removing the following line (except for the '>', obviously):
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?
Never tried, but I wouldn't know a reason why this should fail. Stefan
![](https://secure.gravatar.com/avatar/14ee766a8f92667b755c18b8499b4c77.jpg?s=120&d=mm&r=g)
Alexander Kozlovsky wrote:
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:
What result do you get?
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
Is it possible to use EXSLT extensions on Windows without rebuilding of standard binaries?
Never tried, but I wouldn't know a reason why this should fail.
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
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, Alexander Kozlovsky wrote:
Alexander Kozlovsky wrote:
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: What result do you get?
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
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".
Is it possible to use EXSLT extensions on Windows without rebuilding of standard binaries? Never tried, but I wouldn't know a reason why this should fail.
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
That shouldn't have anything to do with it. Stefan
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, Alexander Kozlovsky wrote:
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>
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
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, Alexander Kozlovsky wrote:
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?
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
![](https://secure.gravatar.com/avatar/b6073970eae005069be426177e2e7779.jpg?s=120&d=mm&r=g)
On Thu, Feb 28, 2008 at 2:30 PM, Stefan Behnel <stefan_ml@behnel.de> 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.
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
![](https://secure.gravatar.com/avatar/14ee766a8f92667b755c18b8499b4c77.jpg?s=120&d=mm&r=g)
Sidnei da Silva wrote:
On Thu, Feb 28, 2008 at 2:30 PM, Stefan Behnel <stefan_ml@behnel.de> 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.
I am almost sure we are using 1.1.19 for building the binary.
Yes, I checked libxslt version of Windows build and it is 1.1.19 -- Best regards, Alexander mailto:alexander.kozlovsky@gmail.com
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi Sidnei, Sidnei da Silva wrote:
On Thu, Feb 28, 2008 at 2:30 PM, Stefan Behnel <stefan_ml@behnel.de> 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.
I am almost sure we are using 1.1.19 for building the binary.
"are using" means: also for the lxml 2.0.x builds? Stefan
![](https://secure.gravatar.com/avatar/b6073970eae005069be426177e2e7779.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi, Sidnei da Silva wrote:
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?
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
![](https://secure.gravatar.com/avatar/b6073970eae005069be426177e2e7779.jpg?s=120&d=mm&r=g)
On Fri, Feb 29, 2008 at 5:32 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
What should we do? Release new builds of 1.3.x with updated libxslt?
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.
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
![](https://secure.gravatar.com/avatar/8b97b5aad24c30e4a1357b38cc39aeaa.jpg?s=120&d=mm&r=g)
Hi Sidnei, Sidnei da Silva wrote:
On Fri, Feb 29, 2008 at 5:32 AM, Stefan Behnel <stefan_ml@behnel.de> wrote:
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.
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