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

Passing local variable from one template to another

Subject: Passing local variable from one template to another
From: "Alex Genis" <agenis@xxxxxxxx>
Date: Tue, 24 Jul 2001 15:18:30 -0400
b one templates
During the execution I've got a message : "Variable Reference given for variable
out of context or without definition ! Name = XYZ
---------------------- Forwarded by Alex Genis/DTCC on 07/24/2001 03:22 PM
---------------------------


Alex Genis
07/24/2001 03:09 PM

To:   xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc:
Subject:  Passing local variable from one template to another

Hi everybody !
I need to pass value of the local variable defined in one template to another
template.
The following source does not work. What's wrong ? 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">
    </xsl:apply-templates>

    <xsl:apply-templates select="A/B/D/E/F">

     <xsl:with-param name="XYZ" select="$XYZ" >
     </xsl:with-param>

    </xsl:apply-templates>

 </xsl:template>

 <xsl:template match="A/B/C">

  <xsl:variable name="XYZ">

    <xsl:value-of select="K/L/M/N/O"/>

  </xsl:variable>

 </xsl:template>

 <xsl:template match="A/B/D/E/F">

   <xsl:text>BLAH-BLAH-BLAH-111</xsl:text>

   ......................................

   <xsl:value-of select="$XYZ" />

   ......................................

   <xsl:text>BLAH-BLAH-BLAH-999</xsl:text>

 </xsl:template>

</xsl:stylesheet>




 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.