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

RE: Change the value of a parameter in a template

Subject: RE: Change the value of a parameter in a template
From: Kay Michael <Michael.Kay@xxxxxxx>
Date: Tue, 14 Nov 2000 09:33:15 -0000
RE: Change the value of a parameter in a template
You are trying to write a template as a function that returns a selected
node. Templates don't do that: they write output to trees.

To find a node, use an XPath expression, something like
//wc:INSTANCE[Left=@article]/Right

You have to write this inline.

If you don't like this you might like to look at Saxon's <saxon:function>
which allows you to write extension functions in XSLT.

Mike Kay


> In the template "findRelation" I compare the parameter 
> "article" with the
> XML-data in a loop ("for-each").
> When an element, <Left>, is equal to the parameter "article" 
> I store the
> <Right> element in the parameter "find ": 
> 
> <xsl:template name="findRelation">
> 	<xsl:param name="article"/>
> 	<xsl:param name="find"/>
> 	<xsl:for-each select="//wc:INSTANCE"> 
> 		<xsl:if test="Left=$article">
> 			<xsl:param name="find" select='Right'/>	
> 	 
> 		</xsl:if>
> 	</xsl:for-each>
> </xsl:template>			 
> 
> Then I want to access the parameter "find", with its new 
> value, from the
> calling template "Relation". 
> Does anybody know how to do that? 
>   
> Regards
> Fredric
> 
> 
>  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.