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

Re: Javascript in XSL

Subject: Re: Javascript in XSL
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Thu, 25 Oct 2001 10:33:38 -0400
put javascript in xsl
[Annelies Vercruysse]

>
> I'm converting existing HTML pages to XML-XSL combinations. My current
HTML
> pages contain Javascripts that treat elements in the HTML document.
> (getElementById();)
>
> It seems that these javascripts are completely ignored when opening the
XML
> page. Could it be that an XML page doesn't have the "document"-property so
> an element will never be found?
>
> I've already tried to put the javascript between the following tags:
> <![CDATA[    ....     ]]>
>
> (I use the Netscape 6.1 browser)
>
> are there any known bugs with Javascripts within XSL?
> can anyone please help me? It would very much be appreciated!
>

Javascript scripts are run when they appear in an html page.  If you put
them, using the same syntax, into an xml page, the html processor is not
invoked and there is nothing inherent in xml to cause them to run.  Hence
your results.

However, if you use xslt to produce legal html or xhtml pages, then the html
processor will run the javascript - as long as the browser knows that the
pages are html.  This is usually achieved by naming the file with a name
ending in ".htm" or ".html", although sometimes setting the right MIME
header works (that is something that gets set outside of the html document).

Cheers,

Tom P


 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.