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 55670 - Namespace declarations on included templates ignored
Namespace declarations on included templates ignored
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-06-03 18:50 UTC by elmert
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase files and log of xsltproc output (3.17 KB, text/plain)
2001-06-08 21:03 UTC, elmert
Details

Description elmert 2001-06-03 18:50:44 UTC
Hello,

It seems that when an included stylesheet declares a namespace that is not in the top-level stylesheet, it is ignored.
For example,
Top level:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
                exclude-result-prefixes="doc"
                version='1.0'>

and an included stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:gt="http://docbook2x.sourceforge.net/xmlns/xslt/gentext"
                exclude-result-prefixes="gt"
                version='1.0'>
And when the namespace referenced by "gt:" is used libxslt complains. Copying xmlns:gt to the top-level stylesheet works around it.  (I would submit a fix if I knew how to, but I'm still new to the code.)
Comment 1 Daniel Veillard 2001-06-05 10:22:35 UTC
Could you provide a complete example. The current snippet don't
allow me to find the problem,

  thanks,

Daniel
Comment 2 elmert 2001-06-08 21:03:34 UTC
Created attachment 630 [details]
Testcase files and log of xsltproc output
Comment 3 elmert 2001-06-08 21:05:55 UTC
You're right.  The bug is pretty obscure. It can be reproduced from 
the test case that has been attached.

Basically, namespace declarations don't seem to be "in effect" when
something is evaluated for a top-level variable, AND the stylesheet
where the variable is evaluated is included from another one.
Comment 4 Daniel Veillard 2001-06-11 11:52:29 UTC
Okay thanks for the detailed report. The bug was due to the
fact that namespace in scope at the expression level were
not propagated to the XPath evalutation.

I commited the fix to CVS:

http://cvs.gnome.org/bonsai/cvsquery.cgi?module=libxslt&branch=HEAD&branchtype=match&dir=libxslt&file=&filetype=match&who=veillard&whotype=match&sortby=Date&hours=&date=explicit&mindate=06%2F11%2F01+07%3A44&maxdate=06%2F11%2F01+07%3A44&cvsroot=%2Fcvs%2Fgnome

  thanks a lot for the report,

Daniel
Comment 5 Daniel Veillard 2001-06-17 18:23:36 UTC
Should be fixed in the 0.12.0 release, I hope it's closed,

Daniel