GNOME Bugzilla – Bug 489854
applyStylesheet paramaters not passed correctly on x86_64 platforms
Last modified: 2007-10-25 08:30:44 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
Reproduced. Code doing the parameter conversion is in python/libxslt.c libxslt_xsltApplyStylesheet() around line 750. Daniel
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!
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 :)