Subject: Re: [xsl] Javascript in XSL From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx> Date: Thu, 25 Oct 2001 10:33:38 -0400 |
[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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Javascript in XSL, Oleg Tkachenko | Thread | [xsl] xpath query in an attribute, Balazs Scheidler |
[xsl] Re: Re: simple tree problem ., Dimitre Novatchev | Date | Re: [xsl] SAX parser for CSS (Was: , Joerg Pietschmann |
Month |