You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Vaduvoiu Tiberiu <va...@yahoo.com> on 2007/05/09 15:40:34 UTC

calling a template from an anchor

Hi all. Can anyone tell me if it's possible to "re-call" a template from an anchor? something like:

<xsl:template name="test">
<xsl:param name="howmany" select="5">
<xsl:value-of select="parent/child[position()>$howmany]/>

<a><xsl:attribute name="href"><xsl:call-template name="test"><xsl:with-parameter name=howmany select=10></....</a>

I tried it but I get an Http error 500. So I'm trying to display a fixed number of elements and have a link wich when clicked displays the next 5 elements let's say. The only way I figured to do it was to call the same template but I can't make it work. Anyone have any solution? 10x

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: calling a template from an anchor

Posted by Joerg Heinicke <jo...@gmx.de>.
On 09.05.2007 15:40, Vaduvoiu Tiberiu wrote:

> Hi all. Can anyone tell me if it's possible to "re-call" a template
> from an anchor? something like:
> 
> <xsl:template name="test"> <xsl:param name="howmany" select="5"> 
> <xsl:value-of select="parent/child[position()>$howmany]/>
> 
> <a><xsl:attribute name="href"><xsl:call-template
> name="test"><xsl:with-parameter name=howmany select=10></....</a>
> 
> I tried it but I get an Http error 500. So I'm trying to display a
> fixed number of elements and have a link wich when clicked displays
> the next 5 elements let's say. The only way I figured to do it was to
> call the same template but I can't make it work. Anyone have any
> solution?

What you must have in mind is that the XSLT is completely decoupled from 
the page you are viewing at the end. It is executed on the server and 
not in the browser. So you have to pre-generate all the necessary code. 
This is best done by grouping your result, put each group into a <div> 
and hide it except one. On clicking the anchor you change the visible <div>.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org