cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Heinz R., ITS P E320, TR" <R.He...@deutschepost.de>
Subject template parameter
Date Thu, 28 Dec 2000 11:55:45 GMT
Hi.

I'm using cocoon 1.8 on tomcat 3.1 with a three tier
xsp->logicsheet->stylesheet architecture.
In the logicsheet, I tried to pass a parameter to a chain of templates, but
it doesn't work.

My files are:

page.xml:
========
<?xml-stylesheet href="page-xsp.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<page>
	<shownews count="3"/>
</page>

page-xsp.xsl:
=============
<xsl:template match="shownews">		<!-- LOCATED IN PAGE.XML -->
	<xsl:apply-templates select="document('news.xml')"> <!-- goes to
template "newslist" -->
		<xsl:with-param name="newscount" select="@count"/>
	</xsl:apply-templates>  
</xsl:template>
<xsl:template match="newslist"> 		<!-- LOCATED IN NEWS.XML -->
	<xsl:param name="newscount"/>
	<xsl:element name="news_to_show">
		<xsl:attribute name="number">
			<xsl:value-of select="$newscount"/>	<!-- DOESN'T
WORK-->
		</xsl:attribute>
	</xsl:element>
</xsl:template>


news.xml:
=========
<newslist>
	<news id="1">
		<title>a title</title>
		<content>some text</conotent>
	</news>
</newslist>

What SHOULD happen:
Catch <shownews count="3">, include "news.xml" into the tree and process
the first shownews/@count <news> elements from news.xml.
It seems to work except of the count parameter, which seems to be empty
in template "newslist".

Any suggestions?

Another Problem I encountered is to get Cocoon to serve a new page when the
content of
news.xml changes.

Thanks,
Roman

Mime
View raw message