xsl-list
[Top] [All Lists]

Re: [xsl] call-template error

2007-05-28 08:18:04
In addition to the explanation of Dr. Kay, see:

      http://fxsl:sf.net


--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play


On 5/28/07, Vaduvoiu Tiberiu <vaduvoiutibi(_at_)yahoo(_dot_)com> wrote:
On my site I have a couple of categories/menus. Each time you're in a category 
it loads a different template(content)
I have a parameter $menu which has the value of the name of the menu you are at 
on the site. So until now I had something like this:

<xsl:if test="$menu= sport">
<xsl:call-template name="toolbox_sport"></xsl:call-template>
</xsl:if>
<xsl:if test="$menu= 'news">
<xsl:call-template name="toolbox_news"></xsl:call-template>
</xsl:if>
<xsl:if test="$menu= recent">
<xsl:call-template name="toolbox_recent"></xsl:call-template>
</xsl:if>
<xsl:if test="$menu= test">
<xsl:call-template name="toolbox_test"></xsl:call-template>
</xsl:if>

like this, it works. But then I though of making it more simple like this:

<xsl:call-template name="toolbox_$menu"></xsl:call-template> so basically it 
should only loads the template of the selected menu. Thing is it doesn't work..I get 
java.util.EmptyStackException:

I also tried creating a variable
<xsl:variable name="tool">toolbox_<xsl:value-of select="$menu"/></xsl:variable>
and then calling the template with the name="$tool"..also doesn't work. So why 
doesn't he load it?? 10x



____________________________________________________________________________________Take
 the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos 
& more.
http://mobile.yahoo.com/go?refer=1GNXIC

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>