xsl-list
[Top] [All Lists]

Re: [xsl] [XSLT]Use value of parameter

2008-04-11 02:46:50
Hi Izaskun!

On Fri, Apr 11, 2008 at 11:25 AM, IZASKUN GUTIERREZ GUTIERREZ
<igutierrez027(_at_)ikasle(_dot_)ehu(_dot_)es> wrote:
Hello everybody!

 I want one templete. This template have one global parameter. In the
template I need change value of the global parameter, but I dont know if
this is possible and how to do it.

If I understand you correctly, you have one global xsl:variable and
want to assign a different value to it? If so, this is not possible in
XSLT as far as I know. But you could use a processor extension to do
this, if you don't believe in the benefits of avoiding side effects ;)

 And other question:

 I need pass a parameter from one template to other template and pass the
result from the second template to de first (like a normal function).

When you invoke a template, you can use xsl:with-param to pass
parameters, the corresponding template should define the parameter in
its content. Perhaps the following helps:

<xsl:template match="/">
<xsl:call-template name="foo">
<xsl:with-param name="a">Hello Mary Lou</xsl:with-param>
</xsl:call-template>
</xsl:template>

<xsl:template name="foo">
<xsl:param name="a" />
<xsl:value-of select="$a" />
</xsl:template>

A template (the content of the xsl:template element) is the output, or
result as you put it. Not sure what you mean by "passing a result to a
template". In the above example, the content of the first (unnamed)
template, gets  replaced by the "result" of the foo template.

Hope this helps :)

Cheers,
Felix

 Anybody can help me?

 Thank you, Regards

 Izaskun



 --~------------------------------------------------------------------
 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>