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

Re: Including javascript files in HTML output

Subject: Re: Including javascript files in HTML output
From: "Robert Koberg" <rob@xxxxxxxxxx>
Date: Wed, 21 Jun 2000 11:56:47 -0700
javascript files empty
why is the closing tag needed?

it is not required.

you can have html that says:
<script language="javascript" src="whatever.js">

----- Original Message -----
From: JB Blond <pblond@xxxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxx>
Sent: Wednesday, June 21, 2000 10:23 AM
Subject: Re: Including javascript files in HTML output


> Instead, you could try :
>
>      <xsl:for-each select="SCRIPT">
>            <xsl:element name="script">
>                 <xsl:attribute name="language">JavaScript</xsl:attribute>
>                 <xsl:attribute name="src"><xsl:value-of
> select="."/></xsl:attribute>
>             </xsl:element>
>         </xsl:for-each>
>
> This should solve you're closing tag problem...
>
> JB
>
> ----- Original Message -----
> From: "Carlson, Thor" <CarlsonT@xxxxxxx>
> To: <xsl-list@xxxxxxxxxxxxxxxx>
> Sent: Wednesday, June 21, 2000 2:28 PM
> Subject: Including javascript files in HTML output
>
>
> > Problem: I'm trying to include a JavaScript file "validate.js" in my
HTML
> > output but IE5 is reporting a syntax error.  No error exists when I hard
> > code the JavaScript in the stylesheet.  The following is simplified for
> > readability:
> >
> > Given the following XML fragment:
> >
> >     <SCRIPTS>
> >         <SCRIPT>validate.js</SCRIPT>
> >     </SCRIPTS>
> >
> > And the following stylesheet fragment:
> >
> >     <xsl:for-each select="SCRIPT">
> >         <SCRIPT LANGUAGE="JavaScript">
> >             <xsl:attribute name="SRC">
> >                 <xsl:value-of select="."/></xsl:attribute>//need
> > this</SCRIPT>
> >     </xsl:for-each>
> >
> > My generated html result is:
> >
> >     <SCRIPT LANGUAGE="JavaScript" SRC="validate.js">//need this</SCRIPT>
> >
> > (I need to include the "file://need this" without which the browsers do
> not
> > generate the closing </SCRIPT> tag, resulting in the display of an empty
> > page.)
> >
> > My problem is the IE5 browser reports a syntax error.  The generated
HTML
> is
> > correctly formed.  When the .js file contents are directly pasted into
the
> > stylesheet, the syntax error is not reported.
> >
> > Sample validate.js file:
> >
> >     <xsl:text disable-output-escaping="yes">
> >     <![CDATA[
> >     <!-- hide javascript from older browsers
> >     function validate(form)
> >     {
> >         alert ('validate()!');
> >     }
> >     file://-->
> >     ]]>
> >     </xsl:text>
> >
> > Can anyone explain how to successfully include .js files?
> >
> > Thank you.
> >
> > - Thor
> >
> > ----------------------------------
> > Thor Carlson
> > Dun & Bradstreet
> > carlsont@xxxxxxx
> > 973.605.6095 voice
> > 973.605.6957 fax
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
>  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.