SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2001
    Posts
    140
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Creating a Javascript code output from XSL

    Anyone knows how to deal with XSL/Javacsript. I tried to output javascript with XSL with no success.

    PHP Code:
    <?xml version='1.0' encoding='ISO-8859-1'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> 
    <xsl:output method="html"/> 
    <xsl:template match="/">

    <xsl:for-each select="Listings/Listing">

    <xsl:text>document.write('</xsl:text><a><xsl:attribute name="href"><xsl:value-of select="URL" /></xsl:attribute><font size="-1" face="Arial" color="#DF3716"><b><xsl:value-of select="Title" /></b></font></a><br /><xsl:text>');</xsl:text>

    </xsl:for-each>

    </xsl:template>
    </xsl:stylesheet>

    Thanks in advance.
    Last edited by d-net; May 27, 2002 at 12:00.

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <xsl:script langauge="jscript">
    <![CDATA[
    bla bla bla js
    ]]>
    </xsl:script>

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    d-net, I don't think the third line of the code you posted is quite right!


    M@rco

  5. #5
    The doctor is in... silver trophy MarcusJT's Avatar
    Join Date
    Jan 2002
    Location
    London
    Posts
    3,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DOH! Not your fault, it's just vB mangling posted code AGAIN!


    M@rco


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •