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 155197 - Namespace wilderness with functions
Namespace wilderness with functions
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
git master
Other FreeBSD
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-10-12 15:08 UTC by vgrebenschikov
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screen.xsl (404 bytes, text/plain)
2004-10-12 15:09 UTC, vgrebenschikov
Details
layout.xsl (204 bytes, text/plain)
2004-10-12 15:10 UTC, vgrebenschikov
Details
lib1.xsl.ok (481 bytes, text/plain)
2004-10-12 15:10 UTC, vgrebenschikov
Details
lib1.xsl.fail (428 bytes, text/plain)
2004-10-12 15:13 UTC, vgrebenschikov
Details
lib2.xsl (418 bytes, text/plain)
2004-10-12 15:14 UTC, vgrebenschikov
Details

Description vgrebenschikov 2004-10-12 15:08:52 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)
Comment 1 vgrebenschikov 2004-10-12 15:09:48 UTC
Created attachment 32516 [details]
screen.xsl
Comment 2 vgrebenschikov 2004-10-12 15:10:15 UTC
Created attachment 32517 [details]
layout.xsl
Comment 3 vgrebenschikov 2004-10-12 15:10:43 UTC
Created attachment 32518 [details]
lib1.xsl.ok
Comment 4 vgrebenschikov 2004-10-12 15:13:46 UTC
Created attachment 32519 [details]
lib1.xsl.fail
Comment 5 vgrebenschikov 2004-10-12 15:14:03 UTC
Created attachment 32520 [details]
lib2.xsl
Comment 6 William M. Brack 2004-10-15 05:40:40 UTC
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.
Comment 7 vgrebenschikov 2004-10-15 09:22:41 UTC
I confirm - problem fixed with latest version libexslt/functions.c
Comment 8 Daniel Veillard 2005-09-05 09:41:46 UTC
This should be closed by release of libxslt-1.1.15

  thanks,

Daniel