[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Accessing Global Parameters from an included Stylesheet


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

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