This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Passing Variable into a child template
- To: xsl-list at mulberrytech dot com
- Subject: Passing Variable into a child template
- From: "Sia Rahimi" <sia_rahimi at hotmail dot com>
- Date: Fri, 21 Jul 2000 16:03:07 PDT
- Reply-To: xsl-list at mulberrytech dot com
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