Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Javascript calls from xsl not identified by FireFox [Thread Next] RE: Javascript calls from xsl not identified by FireFoxTo: NULL Date: 2/2/2005 12:41:00 PM I think it's because of the closing comment. Try it like this:
<script type="text/javascript"
language="javascript"><xsl:comment><![CDATA[
function validate(){
alert("Help ! This function is not been called ...")
}
//]]></xsl:comment></script>
note the "//" right before the closing CDATA.
An unfortunate problem with mozilla based XSLT is the lack of support for
disable-output-escaping. This means that pointy brackets in your javascript
will be escaped, which may or may not cause you problems. It depends on
where you use them. Many of us have argued with the developers about this
issue, but they are unwilling to budge, and have taken the position that
"it's not needed".
There are technical reasons why it would be hard for them to handle, but
it's something to be aware of if you're doing this sort of thing client-side
in mozilla-based browsers.
Regards,
Mike Sharp
"Rose Girl" wrote:
> I have a web application that uses xsl and javascript which runs
> smoothly on IE. Recently i decided to try it on FireFox 1.0 . But the
> same application gives javascript errors as displayed in the console.
> What i found out is that FireFox doesnt recognize Javascript functions
> from a xsl page. Its ok from a html page.
>
> I have given a code of a xsl page. Can someone point what possibly
> could be the problem.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:template match="/spider-xml">
>
> <html>
> <head>
> <script type="text/javascript"
> language="javascript"><xsl:comment><![CDATA[
>
> function validate(){
> alert("Help ! This function is not been called ...")
>
> }
>
> ]]></xsl:comment></script>
>
> </head>
> <body>
> <table>
> <tr>
> <td>
> <a href="#xx">
> <xsl:attribute name="onClick">validate();</xsl:attribute>
> Some link
> </a>
> </td>
> </tr>
> </table>
> </body>
> </html>
>
> </xsl:template>
> </xsl:stylesheet>
>
> Thankyou for your time.
> Regards
> Rose Girl.
>
>
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
