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

Re: How I can include javscript code ?

Subject: Re: How I can include javscript code ?
From: "Charles Knell" <cknell@xxxxxxxxxx>
Date: Wed, 10 Jul 2002 07:18:17 -0700
javscript load include
You can try this universe, Mike.

This stylesheet:
#######################
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" encoding="UTF-8" />
<xsl:template match="/">
  <html>
    <head>
      <script language="JavaScript">
      <![CDATA[
        function twiZone(Node){
          if(Node >= 1){
            alert("This one.");
          }
        }
      ]]>
      </script>
    </head>
    <body onload="twiZone(3)">

    </body>
  </html>
</xsl:template>
</xsl:stylesheet>
#######################
Produces this output:
#######################
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script language="JavaScript">
      
        function twiZone(Node){
          if(Node >= 1){
            alert("This one.");
          }
        }
      
      </script>
</head>
<body onload="twiZone(3)"></body>
</html>
#######################
And if you don't want to type the <![CDATA[ ]]> tags in manually, you
can use the cdata-section-elements attribute of the <xsl:output> element
like this:

<xsl:output cdata-section-elements="script">
-- 
Charles Knell
cknell@xxxxxxxxxx - email


---- Mike Brown <mike@xxxxxxxx> wrote:
> Charles Knell wrote:
> > There's no need to disable output escaping if you enclose your code
> in
> > <![CDATA[ ]]> tags.
> 
> In what alternate universe?
> 
>    - Mike
> ____________________________________________________________________________
>   mike j. brown                   |  xml/xslt: http://skew.org/xml/
>   denver/boulder, colorado, usa   |  resume: http://skew.org/~mike/resume/
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
>  

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.