hi we can asign the xsl variable inside the javascript tag but its vice varsa is it possible or not.
One is server side, the other is client side.
XSL can "print" javascript code when it first creates the page. Javascript can then modify the DOM, but it can't go back and impact the XSL. Unless perhaps you're talking about doing an AJAX call with parameters?
Actually i am talking about client side, if we are taking any any script variable inside the aperance part of component like <script>var abc;</Script> than how to asign this varable inside the xsl template.
You'll have to describe the use case more clearly. As it's currently phrased, what you're asking can't be done.
Have you tried something like this?
<script>
var abc = "<xsl:value-of select="/Properties/Data/Datum[@Name='value for abc']"/>";
</script.
Dan is right, we can assign the XSL variables in JS var like mentioned by him
Yes you are right we can assign xsl variable inside <script> tag but i am asking its reverse condition means how to use script variable inside template.
eg.<xsl:template match="/">
var abc="ashu";
</script>
now we want to use this variable here.????
</xsl:template>
I'm a little confused about what you are asking.
If this is what you want:
<xsl:template match="/">
<xsl:text>welcome the value of abc is </xsl:text><xsl:value-of select='$abc'/>
Then the answer is a resounding NO. Assigning a variable in JavaScript can't be used in the XSL.
You can do something like this:
<xsl:text>welcome, the value of abc is </xsl:text><script>document.write(abc);</script>
The resulting output will be: welcome, the value of abc is ashu
JavaScript is run/interpreted by the browser (remember not all browsers process JavaScript 100% of the time) while XSL is processed by your server. You have ZERO control over what the browser is doing with the JavaScript.
Perhaps if you posted more of what you are trying to accomplish, someone could give you a possible solution.
thanks bolker..