Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Javascript calls from xsl not identified by FireFox

From: rdcpro@---------.------
To: 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.
> 
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent