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

Problem with using $variable in xsl:value-of

Subject: Problem with using $variable in xsl:value-of
From: "Jochen Metzger" <j.metzger@xxxxxxxxxxxx>
Date: Wed, 18 Sep 2002 20:42:18 +0200
xsl variable value of
Hi folks,

I want to use the value of a variable to define a path in XPath, but:
- no way (the problem is marked --> PART A)

-->This does not work--> why ??? <--
=============================
<xsl:variable name="t_path">
     <xsl:value-of select="element[@name='module_active/status']"/>
</xsl:variable>
<xsl:value-of select="element[@name='content_group']/$t_path/@readonly"/>
=============================
(you can find it in the complete source as well )

Does someone have any ideas. I think the solution might be simple,
but I cannot grab it at the moment

Thanks for your feedbacks

Jochen from Berlin

Sources:
========
Heres: xml:
<?xml version="1.0"?>
<module>
    <element name="content_group">
        <in_process readonly="readonly"/>
    </element>
    <element name="module_active/status">
        <value>in_process</value>
    </element>
</module>

Heres: xslt:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

   <xsl:output method="xhtml" version="1.0" encoding="UTF-8" indent="no"
omit-xml-declaration="yes" doctype-public="-//W3C/DTD XHTML 1.0
Transitional//EN"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
standalone="yes" media-type="text/html" />

   <xsl:template match="/module">

      <xsl:variable name="t_path">
           <xsl:value-of select="element[@name='module_active/status']"/>
      </xsl:variable>

       <br/>
      this works:
      <xsl:value-of
select="element[@name='content_group']/in_process/@readonly"/>

       <!-- PART A - this is the part, I am frustrating about -->
        this not (why?):
       <xsl:value-of
select="element[@name='content_group']/$t_path/@readonly"/>

   </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.