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

Passing Variable into a child template

Subject: Passing Variable into a child template
From: "Sia Rahimi" <sia_rahimi@xxxxxxxxxxx>
Date: Fri, 21 Jul 2000 16:03:07 PDT
free child templates
Hi,

This should be a simple solution but I haven't been able to find any solutions in the archive...

Basically I want to share a common value within a child template.

<MenuList>
	<ServerName>myserver</ServerName>

	<MenuItem>
		<MenuName>Menu 1</MenuName>
		<MenuUrl>doc1.html</MenuUrl>
	</MenuItem>
	<MenuItem>
		<MenuName>Menu 1</MenuName>
		<MenuUrl>doc2.html</MenuUrl>
	</MenuItem>
</MenuList>

So that I can use it like:
<xsl:template match="MenuItem">
 <xsl:param name="theServer"/>
  ...
 <xsl:attribute name="src">
    http://<xsl:value-of-select="$theServer"/>
 </xsl:attribute>
  ...
</xsl:template>

I have tried variables with call-templates, but that doesn't seem to work. I have also tried apply-templates unsuccessfully:
<xsl:variable name="server-in-parent">
<xsl:apply-templates select="MenuItem">
<xsl:with-param name="thisServer" select="ServerName"/>
</xsl:apply-templates>
</xsl:variable>


Can you help?

Thanks,
Sia.

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com


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.