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 59480 - <xsl:apply-templates> doesn't pass parameters with <xsl:with-param> when 'select' use nodeset from variable.
<xsl:apply-templates> doesn't pass parameters with <xsl:with-param> when 'sel...
Status: VERIFIED NOTABUG
Product: libxslt
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
Daniel Veillard
Depends on:
Blocks:
 
 
Reported: 2001-08-24 11:51 UTC by lev
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description lev 2001-08-24 11:51:36 UTC
If I use this construction:
<xsl:apply-templates select="$var">
<xsl:with-param name="title" select="'new-value'"/>
</xsl:apply-templates>
Templates are applied Ok, but parametes are not passed.
If select-expression doesn't use variables (select some nodeset inside 
this document), parameters works Ok too.

Here is three files to reproduce bug:
======================= test.xsl ==
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">
<xsl:variable name="var" select="document('a.xml')"/>
<xsl:template match="root">
	<out>
		Here is output with default title:
		<xsl:apply-templates select="$var"/>
		Here is output with 'new-value' title:
		<xsl:apply-templates select="$var">
			<xsl:with-param name="title" select="'new-value'"/>
		</xsl:apply-templates>
	</out>
</xsl:template>
<xsl:template match="a">
	<xsl:param name="title" select="'default'"/>
	<a-template>
	<title><xsl:value-of select="$title"/></title>
	<was-a><xsl:value-of select="."/></was-a>
	</a-template>
</xsl:template>
</xsl:stylesheet>
===================================
======================= test.xml ==
<?xml version="1.0"?>
<root/>
===================================
========================== a.xml ==
<?xml version="1.0"?>
<a>some text in a-tag</a>
===================================
Comment 1 Daniel Veillard 2001-09-10 14:23:48 UTC
I think the bug is in your stylesheet:
select="$var"
Selects the document contained in a.xml. This is a single
*document* node with a single "a" child. 
The XSLT processors applies the templates to the selected
*document* nodes, there is none, so it applies the default
processing, which then process the children "a" but the
inherited param is lost at that point.

 Not a bug !

Daniel
Comment 2 Daniel Veillard 2001-09-15 17:39:48 UTC
I think we can close this bug,

Daniel