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: "Joerg Heinicke" <joerg dot heinicke at gmx dot de>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Wed, 10 Apr 2002 20:16:10 +0200
- 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
Maybe AVT is not known to the XSLTransformer Transformiix. Try to use
<xsl:attribute/> then. The <xsl:for-each> is not needed. And the matcher of
the template can be shortened, because you have only eqpt-elements on this
level.
<xsl:template match="eqpt">
<tr>
<td>
<a>
<xslattribute name="href">
<xsl:text>javascript:test('</xsl:text>
<xsl:value-of select="prodxml"/>
<xsl:text>')</xsl:text>
</xsl:attribute>
<xsl:value-of select="equipmentno"/>
</a>
</td>
<td><xsl:value-of select="description"/></td>
</tr>
</xsl:template>
Joerg
> <?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