[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Script blocks in XSLT

Subject: RE: Script blocks in XSLT
From: Scott Trenda <Scott.Trenda@xxxxxxxx>
Date: Wed, 27 May 2009 13:56:14 -0500
RE:  Script blocks in XSLT
Robert,

If you're using innerHTML to populate an element with the results of your
transformation, you need to use the defer="defer" attribute on the <script>
element in order for the <script> block to run in Internet Explorer.

~ Scott



-----Original Message-----
From: Robert G [mailto:nyjets3422@xxxxxxxxx]
Sent: Wednesday, May 27, 2009 1:47 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Script blocks in XSLT


I have been trying to call a function that I wrote in my xslt but everytime I
call a very basic function the error console says the function is not defined.
I have tried a bunch of things but nothing seems to work.
I don't know if it matters but I use javascript in the original html file to
generate the new html and js by using the xsl processor depending on the
browser.


Here is my code.....

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
     <script language="javascript">
      <![CDATA[
        function trythis()
         {
           alert("hello");
         }
      ]]>
    </script>

</head>
<body>
        <xsl:apply-templates select="page/content"/>
</body>
</html>
</xsl:template>

<xsl:template match="content">

        <h2>Welcome to this page!</h2>
        <input type='button' value='java' onclick='trythis()'/>
        <p> Here is a new page. </p>

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.