GNOME Bugzilla – Bug 155197
Namespace wilderness with functions
Last modified: 2009-08-15 18:40:50 UTC
Looks like a bug in name-space handling in func:result elements: % cp lib1.xsl.ok lib1.xsl % xsltproc screen.xsl screen.xsl In function lib1 In function lib2 ===]200[=== // - valid result % cp lib1.xsl.fail lib1.xsl % xsltproc screen.xsl screen.xsl In function lib1 xmlXPathCompOpEval: function myfunc bound to undefined prefix tmpl xmlXPathCompiledEval: evaluation failed exsltFuncResultElem: ret == NULL ===][=== // - unexpected error % diff -u lib1.xsl.ok lib1.xsl.fail --- lib1.xsl.ok Mon Oct 11 17:39:13 2004 +++ lib1.xsl.fail Mon Oct 11 17:39:13 2004 @@ -7,9 +7,9 @@ <func:function name="cred:myfunc"> <xsl:message>In function lib1</xsl:message> - <xsl:variable name="func-dbg" select="tmpl:myfunc()"/> - <func:result select="$func-dbg"/> + <func:result select="tmpl:myfunc()"/> + </func:function> // diff looks Ok - same expression, but in .ok variant firstly was put into variable When function's result compute some XPath expression it does computation with name-space list from top document (screen.xsl in my example) not with name-space of current document as should be (I guess). Adding "xmlns:tmpl=..." into screen.xsl fix situation, but it is not option, because top stylesheet does not know anything and do not want to know about name-spaces used in below computations. (files used above - attached)
Created attachment 32516 [details] screen.xsl
Created attachment 32517 [details] layout.xsl
Created attachment 32518 [details] lib1.xsl.ok
Created attachment 32519 [details] lib1.xsl.fail
Created attachment 32520 [details] lib2.xsl
I believe I have fixed the problem. Certainly your testfiles work with the fix. The fixed file is in CVS (libexslt/functions.c). Please try on your live data and re-open the bug if there are futher problems. Thanks for the report.
I confirm - problem fixed with latest version libexslt/functions.c
This should be closed by release of libxslt-1.1.15 thanks, Daniel