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

Re: Accessing Global Parameters from an included Style

Subject: Re: Accessing Global Parameters from an included Stylesheet
From: "S.Murali Krishna" <ismk@xxxxxxxxxxxxx>
Date: Mon, 19 Jan 2004 12:35:37 +0530 (IST)
xsl param variable
Hi Todd,

Correct me If I'm wrong. I'm just trying to help u out.


><xsl:param name="id"></xsl:param>
><xsl:param name="query_news"></xsl:param> <xsl:param
>name="stateFolder">new_south_wales</xsl:param>
><xsl:param name="statePagesFolder">nsw_pages</xsl:param>
><xsl:param name="stateLibraryFolder">nsw_library</xsl:param>
>
><xsl:template match="/">
>	<!-- Lots of stuff in here deleted -->
>
>	<xsl:call-template name="LatestNews" />

In the above code, the xsl:param has to be provided inside call-template
element. like following.

<xsl:call-template name="LatestNews">
 <xsl:param name="id"></xsl:param>
 <xsl:param name="query_news"></xsl:param> 
 <xsl:param name="stateFolder">new_south_wales</xsl:param>
 <xsl:param name="statePagesFolder">nsw_pages</xsl:param>
 <xsl:param name="stateLibraryFolder">nsw_library</xsl:param>
</xsl:call-template> 
 
And the 'LatestNews' template has to be modifed as following.


><< nswTemplates.xsl >>

<xsl:template name="LatestNews">
 <xsl:param-variable name="stateFolder">Default Value</xsl:param-variable>
 <xsl:param-variable name="stateLibraryFolder">Default Value</xsl:param-variable>

 <h1>Latest News</h1>
 <xsl:for-each
select="/content/assets/group[@name='states']/group[@name=$stateFolder]/grou
p[@name=$stateLibraryFolder]//asset[@assetdefname='state news']/version">
	<xsl:sort select="element_priority_news" order="descending"/>
	<xsl:sort select="element_date/@datesort" order="descending" />

	<xsl:sort select="element_time/@timesort" order="descending" />

	<!--  BLAH BLAH BLAH, Do this and that, maybee some more... -->

 </xsl:for-each>		
</xsl:template>		

-- 
Regards
S. Murali Krishnan



 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.