GNOME Bugzilla – Bug 539741
XSLT concat() function bug with "}" ...
Last modified: 2008-06-25 21:37:54 UTC
I'm trying to concat "{" "}" characters using AVT (Atttribute Value Template) expression. I believed that this bug was related to Safari because wont' works under Safari 3.1.1 or 4 developper preview and with the latest WebKit nigthly build and It works as expected under Firefox 2.x and 3 and IE. Take a look to this testcase http://concentre.zensoluciones.com/xslttest/concatbug.xhtml Unfortunately seems that is a bug of libxslt that use apple inside webkit. Because xsltproc return me error too ! I'm running OS X leopard 10.5.3 (the latest release from apple) My XPath expression concat('{',namespace-uri(),'}',local-name()) If you put something like this in the xsl stylesheet <myelt myattr={concat('{',namespace-uri(),'}',local-name())}" ... /> XSLT processor doesn't render page ... Take a look to the testcase. It's an annoying BUG ! --- $xsltproc test.xsl test.xml XPath error : Unfinished literal compilation error: file test.xsl line 43 element div Attribute template concentre: failed to compile concat('{',namespace-uri(),' --- $xsltproc --version Using libxml 20616, libxslt 10112 and libexslt 810 xsltproc was compiled against libxml 20616, libxslt 10112 and libexslt 810 libxslt 10112 was compiled against libxml 20616 libexslt 810 was compiled against libxml 20616 You can download test.xml and test.xsl here http://concentre.zensoluciones.com/xslttest/concatbug.xhtml Regards
I've installed the latest libxml and libxslt form macports.org and I've got the same problem ! $ xsltproc --version Using libxml 20631, libxslt 10123 and libexslt 813 xsltproc was compiled against libxml 20631, libxslt 10123 and libexslt 813 libxslt 10123 was compiled against libxml 20631 libexslt 813 was compiled against libxml 20631 sebasOSX:~ scramatte$ cd Desktop/xsltest/ sebasOSX:xsltest scramatte$ xsltproc test.xsl test.xml XPath error : Unfinished literal compilation error: file test.xsl line 43 element div Attribute 'concentre': Failed to compile the expression 'concat('{',namespace-uri(),'' in the AVT.
Someone test it under debian with the latest library. And the same problem occur ! https://bugs.webkit.org/show_bug.cgi?id=19722#c6
I enhanced the coding in libxslt/attrvt.c, and hope that this will solve the problem. Please try it out. Changed code is in SVN.
I've verified with r1481 that the error no longer occurs and that the output looks correct. Thanks for the quick fix William!