GNOME Bugzilla – Bug 55670
Namespace declarations on included templates ignored
Last modified: 2009-08-15 18:40:50 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.)
Could you provide a complete example. The current snippet don't allow me to find the problem, thanks, Daniel
Created attachment 630 [details] Testcase files and log of xsltproc output
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.
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
Should be fixed in the 0.12.0 release, I hope it's closed, Daniel