[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Passing Variable into a child template
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|