tags:

views:

63

answers:

1

Hi,

I knw its pretty basic question but I have just started reading it...

I have a variable name

<variable name="NAME">
http://www.yahoo.com/&lt;xsl:value-of select="$someothervariable"/>
</variable>

and i want to use it in like this

I have used these two approaches but it didn't work

<a href="{NAME}">HELLO</a>
<a href="<xsl:value-of select="$NAME"/>

Any idea how to achieve this...

Thanks,

+3  A: 

You need to combine your two approaches:

<xsl:variable name="NAME">yourValue</xsl:variable>
<a href="{$NAME}" />
mopoke
Can you provide some more context on your XSL? It could be a variable scoping issue. Or are there conditionals where your variable is first set?
mopoke
Its working fine but there is empty spaces before and after the value in a tag.
TSSS22
That'll be the newlines you have surrounding your expression in the <variable></variable> tag. Try removing those newlines to get rid of leading/trailing spaces.
mopoke
Thanks a lot...I am laughing on myself rite now....:-)......worked perfectly....
TSSS22