This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How do we call Javascript function in XSL file on Netscape(Ver 6.2) browser?
- From: "Thomas B. Passin" <tpassin at mitretek dot org>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 10 Apr 2002 14:29:44 -0400
- Subject: Re: [xsl] How do we call Javascript function in XSL file on Netscape(Ver 6.2) browser?
- References: <BB884B7614DBD211ADD50008C739BF9004751F33@chqexch2.fullerco.com>
- Reply-to: xsl-list at lists dot mulberrytech dot com
Your code works fine using Mozilla 0.9.9 on Windows 2000. The javascript
alerts come up as expected. I can't say what happens with Netscape 6.2,
because I don't want to install it right now.
Cheers,
Tom P
[Deshpande, Gururaj]
>
> I am copying my XSL and XML files. Can you find out the problem?
>
> <?xml version="1.0" encoding="iso-8859-1"?>
> <?xml-stylesheet type="text/xsl" href="equipment.xsl"?>
> <plant>
> <dept deptid="231">
> <eqpt eqptid="39">
> <equipmentno>010.AS100</equipmentno>
> <description>High-top airslide 300 12 200</description>
> <prodxml>prod39.xml</prodxml>
> </eqpt>
> <eqpt eqptid="38">
> <equipmentno>010.AS200</equipmentno>
> <description>Low-bottom airslide 200 12 100</description>
> <prodxml>prod38.xml</prodxml>
> </eqpt>
> <eqpt eqptid="37">
> <equipmentno>010.AS300</equipmentno>
> <description>No-bottom airslide 200 12 100</description>
> <prodxml>prod37.xml</prodxml>
> </eqpt>
> </dept>
> </plant>
> ------------------------------------------
> <?xml version='1.0' encoding="iso-8859-1"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="html"/>
> <xsl:template match="/">
> <html>
> <head>
> <SCRIPT language="JavaScript"><![CDATA[
> function test(avalue) {
> alert(avalue);
> }
> ]]></SCRIPT>
> </head>
> <body>
> <table border="1">
> <tr>
> <td>Equipment No.</td>
> <td>Description</td>
> </tr>
> <xsl:apply-templates select="plant/dept/eqpt"/>
> </table>
> </body>
> </html>
> </xsl:template>
> <xsl:template match="plant/dept/eqpt">
> <xsl:for-each select=".">
> <tr>
> <td><a
> href="javascript:test('{prodxml}')"><xsl:value-of
> select="equipmentno"/></a></td>
> <td><xsl:value-of select="description"/></td>
> </tr>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
> ---------------------------------------------------------
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list