|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








