Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - XSLT indirect variable lookup [Thread Next] Re: XSLT indirect variable lookupTo: 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 > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
