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

Passing Variable into an external xml document template

Subject: Passing Variable into an external xml document template
From: "Sia Rahimi" <sia_rahimi@xxxxxxxxxxx>
Date: Wed, 16 Aug 2000 19:47:13 GMT
passing variable to xml
Hi,

Known:
(1) How to pass parameters to a template
(2) How to use an an external xml file

Problem:
Within the template of an external xml file,
I want to process based on the parameter Passed in.

XML main:
<MenuDisplay>
 <MenuName>Main</MenuName>
</MenuDisplay>

XML external (Menus.xml):
<MenuTreeList>
 <MenuTree name="Login">
   <MenuItem>
     <Text>Please Login</Text>
   </MenuItem>
 </MenuTree>
 <MenuTree name="Main">
   <MenuItem>
     <Text>System News</Text>
   </MenuItem>
   <MenuItem>
	<Text>Customer Menu</Text>
   </MenuItem>
 </MenuTree>
</MenuTreeList>

XSL:
<xsl:stylesheet
 version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:template match="MenuDisplay">
   <xsl:apply-templates select="document('Menus.xml')">
     <xsl:with-param name="theMenu select="MenuName"/>
   </xsl:apply-templates>
 </xsl:template>
 <xsl:template match="MenuTreeList">
   <xsl:param name="theMenu"/>
   <xsl:apply-templates select="MenuTree[@name=$theMenu]"/>
 </xsl:template>
</xsl:stylesheet>

It seems that the parameter theMenu is not set.

Thanks to Jeni's site I have come this far, but, although
the current problem seems like another problem answered by Jeni
"Re:Loading an external file of index" it does not seem to
work for me. (using xalan).


Thanks for any help you may be able to provide.


________________________________________________________________________
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.