xsl-list
[Top] [All Lists]

Re: template value input

2003-09-17 10:10:09
I just tried to construct two examples for the same --

<!--example 1; xsl:call-template returns something,
which is stored in a variable -->
  <xsl:variable name="temp1">
     <xsl:call-template name="TEMP1">
        <xsl:with-param name="param">abc</xsl:with-param>
        </xsl:call-template>
  </xsl:variable>

  <!-- this xsl:call-template uses the value of
previous call to a template, in select="" clause -->
  <xsl:call-template name="TEMP1">
    <xsl:with-param name="param" select="$temp1"/>
  </xsl:call-template>
                
<!--example 2 -->
  <xsl:variable name="temp2">
    <xsl:call-template name="TEMP2">
       <xsl:with-param
name="param">123</xsl:with-param>
    </xsl:call-template>
  </xsl:variable>

  <xsl:call-template name="TEMP2">
    <xsl:with-param name="param" select="$temp2"/>
  </xsl:call-template>          
        
  <xsl:template name="TEMP1">
     <xsl:param name="param"/>
       <xsl:value-of select="$param"/>
  </xsl:template>
        
  <xsl:template name="TEMP2">
    <xsl:param name="param"/>
      <a>
        <xsl:value-of select="$param"/>
      </a>
  </xsl:template>

example 1 uses a very simple xsl:with-param. example 2
uses a slightly different value for xsl:with-param..
There can be other possible ways also to define
<xsl:with-param name="param" select="" />

Depends what the real problem is..

Regards,
Mukul


--- clemens schrenk <clemens(_dot_)schrenk(_at_)gmx(_dot_)net> wrote:
how can i insert the outcome of a template into
another template at the
place of the word space ?
<xsl:with-param name="text" select="space"/>


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



__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



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