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

Re: Variable of variable

Subject: Re: Variable of variable
From: Paul Prescod <paulp@xxxxxxxxxxxxxxx>
Date: Mon, 09 Jul 2001 01:46:12 -0700
Re:  Variable of variable
Frederic Bruneteau wrote:
> 

> I use xalan to transform XML to SVG

By the way, I'm looking for help in collecting some "patterns" in XSLT
to SVG processing. I'm looking to build up an open cookbook of XSLT
recipes and SVG is a particularly interesting new area. Do you think you
have any you could contribute from your current project? This is an open
question for anyone on the list. FO is also something that I could use
help with.

>...
>         ${$col1}
> but xalan doesn't accept these syntaxes !!!
> 
> Do you know how to access to a variable of a variable ?
>...

I don't think it is possible. There are really very few programming
languages where it *is* possible and even in those ones it isn't easy.
Variable names are just labels for places that store information. They
aren't first-class objects that you should be manipulating in your
programs. There must be another way to solve the same problem. If you
explain the underlying problem, we might be able to help you find a
solution that doesn't involve "meta-variables." For instance here's one
idea:

<xsl:choose>
  <xsl:variable name="col-val">
    <xsl:when test="$col='HOUR'"/>
       <xsl:value-of select="$HOUR"/>
    </xsl:when>
    <xsl:when test="$col='DAY'"/>
       <xsl:value-of select="$DAY"/>
    </xsl:when>
</xsl:choose>

-- 
Take a recipe. Leave a recipe.  
Python Cookbook!  http://www.ActiveState.com/pythoncookbook

 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.