parsing variable in value-of
Posted: Thu Nov 02, 2006 4:45 pm
Hi,
I'm having problems trying to output the value of a variable. I've tried a LOT of different ways to solve it but i just seem to get back at this annoying problem.. It's hard to explain but imma give a try
This is the situation: i have a for-each loop over several xml-records. Each loop puts a string in a variable called $displayName. For each loop i want the script to return a value from the xml-document; the location of this value depends on the $displayName.
For instance, for a certain point in the loop the variable $displayName = 'companyName'. I want to call //HEADER/companyName, so i write <xsl:value-of select="//HEADER/$displayName"/> . XSL doesnt like it when i do that.
Is there a way to get around this? Thanks in advance!
I'm having problems trying to output the value of a variable. I've tried a LOT of different ways to solve it but i just seem to get back at this annoying problem.. It's hard to explain but imma give a try

This is the situation: i have a for-each loop over several xml-records. Each loop puts a string in a variable called $displayName. For each loop i want the script to return a value from the xml-document; the location of this value depends on the $displayName.
For instance, for a certain point in the loop the variable $displayName = 'companyName'. I want to call //HEADER/companyName, so i write <xsl:value-of select="//HEADER/$displayName"/> . XSL doesnt like it when i do that.
Is there a way to get around this? Thanks in advance!