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

RE: passing parameter to template

Subject: RE: passing parameter to template
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Wed, 2 Jul 2003 21:51:10 +0100
xsl pass parameter to template
The apply-templates on document() is not going to invoke the template
with match="item", because document() is a document (root) node and
"item" matches an element. So if it's being called at all then the call
is indirect, via a built-in template; and built-in templates do not pass
their parameters on. 

Michael Kay



> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Fei Zheng
> Sent: 02 July 2003 18:21
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  passing parameter to template
> 
> 
> Hi all,
> 
> I am having a problem with passing a paramter to template. It 
> works without using a second xml. Do you know how to code it 
> working with a second xml? 
> 
> This is code which has no value pass into template. Anything 
> I am doing wrong?   Thanks!
> 
> <xsl:for-each select="tech">
> 	<xsl:variable name="current-tech" select="@descr"/> 
> 	<xsl:apply-templates select="document('report.xml')" 
> mode="report">
> 		<xsl:with-param name="current" select="$current-tech"/>
> 	</xsl:apply-templates>
> </xsl:for-each>
> 
> <xsl:template match="item" mode="report">
> <xsl:param name="current" />
> 	<xsl:if test="($current = metadata/technology)">
> 		<xsl:value-of select="content/company/." /><br/>
> 	</xsl:if>
> </xsl:template>
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 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.