This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
calling template with parameters
- To: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] calling template with parameters
- From: "Heinz R., ITS P E320, TR" <R dot Heinz at deutschepost dot de>
- Date: Tue, 9 Jan 2001 13:05:44 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi.
I have a problem passing a parameter.
Why is the parameter in template "newslist" empty??
<xsl:template match="shownews">
<xsl:variable name="count" select="@count"/>
Here it works: <xsl:value-of select="$count"/>
<xsl:apply-templates select="document('news/news.xml')">
<xsl:with-param name="newscount" select="$count"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="newslist">
<xsl:param name="newscount"/>
now newscount is empty: <xsl:value-of select="$newscount"/>
<!-- At this point, I want to process $newscount elements of
type <news>, but the parameter newscount is empty.-->
</xsl:template>
### news/news.xml ###
<newslist>
<news id="123">
<title>important news</title>
<created>18.12.2000</created>
<expires/>
<content>foo</content>
<created_by>rh</created_by>
</news>
</newslist>
#####################
Thanks,
Roman
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list