Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XSLT indirect variable lookup

From: "Dimitre Novatchev" <dimitren@---.---.-->
To: NULL
Date: 6/1/2007 6:05:00 AM

Yes, it is possible and it is not a good design.

Cheers,
Dimitre Novatchev.


"Zachary Turner" <divisortheory@g...> wrote in message 
news:1180533781.522342.302460@u......
> Let's say I have a variable defined as follows:
>
> <xsl:variable name="test_variable_1" value="'test_value_A'"/>
> <xsl:variable name="test_variable_2" value="'test_value_B'"/>
> <xsl:variable name="test_variable_3" value="'test_value_C'"/>
>
> Then, somewhere else in my source document I have some elements like
> this:
>
> <some-doc-element param="2"/>
> <some-doc-element param="3"/>
> <some-doc-element param="1"/>
>
> I want to transform this into the following:
>
> <destination-element value="'test_value_B'"/>
> <destination-element value="'test_value_C'"/>
> <destination-element value="'test_value_A'"/>
>
> Essentially, this would consist of a couple steps:
>
> 1) Reading the value of the proper source element attribute
> 2) Programmatically create a string that specifies the name of the
> variable to look up
> 3) Retrieve the 'value' parameter of the variable determined in #2.
> 4) Output the value determined in #3 to the document.
>
> Step 3 is what I don't know how to do.  I have the -name- of a
> variable stored in the value of another variable, and I want to use
> that variable to find the variable with that name.
>
> Is something like this even possible?  I can make a huge if statement
> if necessary, but this seems more elegant, and easier to understand.
>
> Thanks
> 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent