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 114563 - with-param, apply-templates($contextNode)
with-param, apply-templates($contextNode)
Status: VERIFIED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other other
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2003-06-06 12:12 UTC by bz
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bz 2003-06-06 12:12:41 UTC
Hi

I found a bug in libxslt 1.0.27, I think it is not fixed in the
current release...

Stylesheet:
----------------------------------------
?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl">

<xsl:output method="xml" encoding="utf-8" indent="yes"/>

<xsl:template match="/">

<xsl:apply-templates select="document('test.xslt')" mode="test">
<!--
<xsl:apply-templates select="//xsl:param" mode="test">
-->

<xsl:with-param name="text">asdf</xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<xsl:template match="*" mode="test">
<xsl:param name="text"/>
<p>
<xsl:value-of select="$text"/>
</p>
</xsl:template>

</xsl:stylesheet>
----------------------
Use filename: test.xslt

xsltproc test.xslt test.xslt 

The xsl:param is not working.

Bernhard
http://datenkueche.com
Comment 1 Daniel Veillard 2003-06-06 14:57:55 UTC
The semantic of:

<xsl:apply-templates select="document('test.xslt')" mode="test">

applies the template to the *document* node from the result
of parsing test.xslt with mode="test", which is not defined, so it
fallbacks to handling the children of that node and nothing is
output.
Changing to 

<xsl:apply-templates select="document('test.xslt')/*" mode="test">

generates

<?xml version="1.0" encoding="utf-8"?>
<p xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink">asdf</p>

which you expect.
Seems mode is not cascaded in templates fallbacks. Apparently it
looks like an actual libxslt bug ... I will try to fix this...

Daniel

Comment 2 William M. Brack 2003-08-14 15:12:39 UTC
The problem was that parameters were not passed when the fallback 
(default template) case took place.  Fixed in CVS - thanks for the 
report.
Comment 3 Daniel Veillard 2003-09-13 19:55:39 UTC
  This should be closed by the release of libxml2-1.0.33,
                                                                     
          
    thanks!
                                                                     
          
Daniel