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

re: treat string as variable name

Subject: re: treat string as variable name
From: "Pouliot, Brian R." <brpouliot@xxxxxxxx>
Date: Mon, 8 Jan 2001 09:21:04 -0500
string to variable name
Thanks Mike.  I can just pass the contents of the variable into the
template.  It's not as elegent as what I was trying to do, but it will still
work.

Brian


No, it's not possible. All variable references in XSLT must explicitly spell
out the name of the variable; you can't calculate it.

In Perl you'd just do ${$temp}. Frustrating, isn't it?

What is the problem you are trying to use this approach to solve? There
might
be another way.

   - Mike



Date: Fri, 5 Jan 2001 17:50:21 -0700 (MST)
From: Mike Brown <mike@xxxxxxxx>
Subject: Re:  treat a string into a variable name

Pouliot, Brian R. wrote:
> <xsl:variable name="temp">$day<xsl:value-of
select="$n"/>date</xsl:variable>
> 
> Now, I need to use $temp to access the actual variables.  Is this
possible?
> I'm having a terrible time with it!  $temp == "$day1date".  How do get the
> value of the variable named by the string inside $temp?



 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.