After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 489854 - applyStylesheet paramaters not passed correctly on x86_64 platforms
applyStylesheet paramaters not passed correctly on x86_64 platforms
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
1.1.22
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-24 16:19 UTC by Colin Guthrie
Modified: 2007-10-25 08:30 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20



Description Colin Guthrie 2007-10-24 16:19:09 UTC
Please describe the problem:
The paramaters (second argument of applyStylesheet) doe not get passed through to the stylesheet on x86_64 platforms.

Steps to reproduce:
With the following code:
#!/usr/bin/env python
import libxml2
import libxslt
import string

styledoc = libxml2.parseDoc("""
<xsl:stylesheet version='1.0'
  xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>

  <xsl:param name='bar'>failure</xsl:param>
  <xsl:template match='/'>
    This should say "success": <xsl:value-of select='$bar'/>
  </xsl:template>
</xsl:stylesheet>
""")

style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseDoc("<doc/>")
result = style.applyStylesheet(doc, { "bar": "'success'" })
print result 
style.freeStylesheet()
doc.freeDoc()



Actual results:
 This should say "success": failure


Expected results:
 This should say "success": success


Does this happen every time?
On x86_64 platforms, yes. On i586 platforms it appears to function correctly.

Other information:
Confirmed by DV on IRC #xml
Comment 1 Daniel Veillard 2007-10-24 16:21:16 UTC
Reproduced.
Code doing the parameter conversion is in python/libxslt.c
libxslt_xsltApplyStylesheet() around line 750.

Daniel
Comment 2 William M. Brack 2007-10-25 00:49:50 UTC
This was caused by the "iterator" argument for Py_Dict_Next being declared as an "int" rather than an "ssize_t" (I'm not sure when this change to Python occurred - my system is on version 2.5).  Fixed in SVN - thanks!
Comment 3 Colin Guthrie 2007-10-25 08:30:44 UTC
Thanks for the fix Bill :)

For people wanting to backport a patch, here is the important bit of the fix:
http://svn.gnome.org/viewvc/libxslt/trunk/python/libxslt.c?r1=1444&r2=1447&pathrev=1447
(NB you have to remove parmas_size from the final hunk to apply to 1.1.22)

Can't for the life of me work out how to make the viewvc thing display a full changeset of the fix you committed, which has to be one of the fundamental advantages of SVN over CVS, but hey ho :)