This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > February 2005 > How to make the following javascript in a XSLT file work in Netscape





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to make the following javascript in a XSLT file work in Netscape
Leo

2005-02-24, 11:17 pm

I have some javascript below in a XSLT file to response to file load
and onchange events. It works perfectly in IE, but not in Netscape. Any
suggestion on how to modify my code to let it also work in Netscape?
Thanks in advance.

Leo

<SCRIPT language="JavaScript">
<![CDATA[
function showField()
{
se = window.event.srcElement;
param =
document.XSLDocument.selectSingleNode("//xsl:param[@name='FieldName']");
param.childNodes.item(0).nodeValue = se.SelectedValue;
displaySection.innerHTML =
xmlDoc.documentElement.transformNode(xmlStyle);
}
]]>

</SCRIPT>

<SCRIPT language="JavaScript" for="window" event="onload">
<![CDATA[
xmlDoc = document.XMLDocument;
xmlStyle = document.XSLDocument;
]]>
</SCRIPT>

Martin Honnen

2005-02-25, 6:36 pm



Leo wrote:

> I have some javascript below in a XSLT file to response to file load
> and onchange events. It works perfectly in IE, but not in Netscape. Any
> suggestion on how to modify my code to let it also work in Netscape?


You would need to change a lot, in particular it seems you are loading
the XML in the browser that is associated with an XSLT stylesheet and
the browser automatically transforms that to HTML with script and making
properties document.XMLDocument and document.XSLDocument available.
These properties are not available in Mozilla/Netscape.
Perhaps making use of Sarissa can ease the task for you:
<http://sarissa.sourceforge.net/>

If not then have a look at the Mozilla pages about XSLT:
<http://www.mozilla.org/projects/xslt/>
<http://www.mozilla.org/projects/xslt/faq.html>
<http://www.mozilla.org/projects/xslt/js-interface.html>

If you still have problems you should then better ask them in the XSLT
group on news.mozilla.org.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Leo

2005-02-25, 6:37 pm

Hello Martin,

Thanks very much for your info.

Leo

Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews