Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Assigning XSL value to Javascript

Hi Guys, I am using Javascript in my XSL. I want to assign the value of my XSL:value of tag to Javascript variable..I am trying something like below

m[1] = '<xsl:value-of disable-output-escaping="yes" select="/Properties/Data/Group[@Name='Available Movies']/Datum[@Name='Flash Movie 1']"/>';

but in this manner my output is coming something
m[1] = '
http://images.aristarec.com/img/artists/outkast/outkast_instores_02.swf
';

its broken in throw lines ...why its happening like this ..I want the output to be in one line
[606 byte] By [teamsite] at [2007-11-11 6:41:59]
# 1 Re: Assigning XSL value to Javascript
try wrapping your text areas with <xsl:text>

<xsl:text>m[1] = '</xsl:text>
<xsl:value-of disable-output-escaping="yes" select="/Properties/Data/Group[@Name='Available Movies']/Datum[@Name='Flash Movie 1']"/>
<xsl:text>';</xsl:text>

and you may want to add a translate(value,'"','\"') to escape any ' if found within your value
KC-Luck at 2007-11-11 23:28:49 >