Re: [xsl] Named template to return value..

Subject: Re: [xsl] Named template to return value..
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Sat, 01 Jun 2002 02:42:46 +0200
Hello Asif,

something like this?

<xsl:template match="/>
  <xsl:variable name="sum">
    <xsl:call-template name="sum-two-values">
      <xsl:with-param name="number1" select="5"/>
      <xsl:with-param name="number2" select="10"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:value-of select="$sum"/>
</xsl:template>

<xsl:template name="sum-two-values">
  <xsl:param name="number1"/>
  <xsl:param name="number2"/>
  <xsl:value-of select="$number1 + $number2"/>
</xsl:template>

Joerg


S. Asif Imam wrote:
Hi Friends..

Just want an example where a named template do some calculations and returns
a value /node whatever is right.
and a callee template uses this ..

Some thing to achieve
Calleeee....
--------------------------------------------------------------------
<xsl:temmplate  name = "GiveNumberedData">
<xsl:param name ="data"/>
<xsl:param name ="index/>

<xsl variable name = "NumberData" Some thing here to call template and get
the value using  data and index???>
 Some processing here..with
 .
 .
</xsl:template>

Called..
-------------------------------------------------------------
<xsl:template name ="GiveData">
<xsl:param name ="data"/>
<xsl:param name ="index/>
<Some processing here >
<Returning Some value ..>

<xsl:template/>
-----------------------

Any sample that is working like this will work :).

Thanx
Asif.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


Current Thread