Java script in xsl


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Java script in xsl

  1. #1
    Suraj Guest

    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('&lt;'+'div id = "'+variable+'"'+'&gt;');
    ]]></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

  2. #2
    Jesse Guest

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center