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

Java script in xsl

I have an xsl sheet which process some xml data.
I have used
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
Now I need to inser some HTML tags dynamically for which I used

javascript like the one below to create a <div id="sss9"> tag
<script language="Javascript"><![CDATA[
document.write('<'+'div id = "'+variable+'"'+'>');
]]></script>

I tried "< and >" this sign still no good. IT is printing the whole tag as
text in the html page.

If any one could help it will be very great
Suraj
[636 byte] By [Suraj] at [2007-11-9 15:22:24]
# 1 Re: Java script in xsl
To produce --<div id="sss9">--

<xsl>
......
<div><xsl:attribute name="id">sss9</xsl:attribute></div>
......
</xsl>

Note that I added the </div> and the "..."

You'll want to replace the sss9 with the value-of or whatever.

- jesse

"Suraj" <tssuraj@yahoo.com> wrote:
>
>I have an xsl sheet which process some xml data.
>I have used
><xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
>Now I need to inser some HTML tags dynamically for which I used
>
>javascript like the one below to create a <div id="sss9"> tag
><script language="Javascript"><![CDATA[
>document.write('<'+'div id = "'+variable+'"'+'>');
>]]></script>
>
>I tried "< and >" this sign still no good. IT is printing the whole tag
as
>text in the html page.
>
>If any one could help it will be very great
>Suraj
Jesse at 2007-11-11 23:30:22 >