[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem passing value of variable using xsl:call-t

Subject: Re: Problem passing value of variable using xsl:call-t
From: Steven.C.Kienle@xxxxxxxxxx
Date: Thu, 26 Jul 2001 07:34:38 -0400
xsl value of variable
  I think you are confused.  The xsl:with-param/xsl:param is used to 
  pass values TO the called template, not to return them.  I'm not sure 
  why you want to return a value, but if you wish to capture the result 
  of the called template for later use you can use the following:
  
  <xsl:variable name="call-result">
     <xsl:call-template name="Take-XYZ" />
  </xsl:variable>
  
  <xsl:template name="Take-XYZ">
     <xsl:value-of select="A/K/L/M"/>
  </xsl:template>
  
  The result tree fragment produced by Take-XYZ will then be put into 
  the call-result variable.  In this case the value of the selected 
  nodes.
  
  Of course, this may not be actually what you are looking for, and in 
  this case is a wasted call since the result is a "constant" value. 
  Also, you need to understand that you may not be able to use the 
  call-result variable everywhere you may wish to, such as in 
  <xsl:apply-templates select="$call-result" />
  
  I think I got this information right, I'm sure if I didn't one of the 
  real experts will jump in.
  


______________________________ Reply Separator _________________________________
Subject:  Problem passing value of variable using xsl:call-templ
Author:  xsl-list@xxxxxxxxxxxxxxxxxxxxxx at Internet-America
Date:    25-07-2001 4:16 PM


Hi everybody !  I have a problem passing value of parametr using 
xsl:call-template and xsl:with-param.
   Thanks a lot in advance. Alex.
  
<?xml version="1.0"?>
  
<xsl:stylesheet     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
version="1.0">
  
  <xsl:output method="text"/>
  
    <xsl:template match="/">
  
       <xsl:apply-templates select="A/B/C/D"> 
       </xsl:apply-templates>
  
    </xsl:template>
  
    <xsl:template match="A/B/C/D">
  
      <xsl:text>111</xsl:text>
  
      <xsl:value-of select="E"/>
      ......................................
  
     <xsl:call-template name="Take-XYZ">
  
        <xsl:with-param name="XYZ"  select=" What should I specifiy here to get
result from template Take-XYZ ??????? " />
  
     </xsl:call-template>
    ......................................
  
   </xsl:template>
  
   <xsl:template name="Take-XYZ">
  
      <xsl:param name="XYZ">
           <xsl:value-of select="A/K/L/M"/>
      </xsl:param>
  
   </xsl:template>
  
</xsl:stylesheet>
  
  
  
  
 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
  

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.