[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

problem accessing parameters in templates without an <

Subject: problem accessing parameters in templates without an <xsl:param> in Xalan 2.0
From: "Durgavarjhula, Vasu" <vasud@xxxxxxxxxxxxx>
Date: Wed, 7 Feb 2001 14:50:39 -0800
xalan mode parameter
In Xalan 1.2, i could pass a parameter from one template to another and then
call a 3rd template with
<xsl:with-param> without having another <xsl:param> in the 2nd template. it
used to work in Xalan 1.2. but in Xalan 2.0, i have to first define an
<xsl:param> and then pass it down. Is this a feature or a bug ? I know the
XSLT spec
says, parameters are ignored when there is no explcit <xsl:param> in a
template. but i liked the default feature in
previous version of Xalan.

eg

this works in Xalan 1.2.2 but not in Xalan 2.0

<xsl:template name="company" mode="process">
<xsl:param name="testVar" select="1"/>
<xsl:apply-templates select="person" mode="process">
	<xsl:with-param name="testVar" select="$testVar"/>
</xsl:apply-templates>
</xsl:template>

<xsl:template name="person" mode="process">
	<xsl:apply-templates select="address" mode="process">
		<xsl:with-param name="testVar" select="$testVar"/>
	</xsl:apply-templates>
</xsl:template>

<xsl:template name="address" mode="process">
<xsl:value-of select="$testVar"/>
</xsl:template>

to make the above code work in Xalan 2.0 I had to do this

<xsl:template name="person" mode="process">
<xsl:param name="testVar" select="$testVar"/>
	<xsl:apply-templates select="address" mode="process">
		<xsl:with-param name="testVar" select="$testVar"/>
	</xsl:apply-templates>
</xsl:template>

<xsl:template name="address" mode="process">
<xsl:param name="testVar" select="$testVar"/>
<xsl:value-of select="$testVar"/>
</xsl:template>


-Vasu

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.