Subject: Re: [xsl] How do we call Javascript function in XSL file on Netscape (Ver 6.2) browser? From: Chuck White <chuckwh@xxxxxxxxxxx> Date: Wed, 10 Apr 2002 10:33:30 -0700 |
Hi Gururaj One thing, one of your table elements wasn't closed in your sample, but also, the stuff in curly braces in your a href where your Javascript function is being called is, I'm assuming, being interpreted as an attribute value template. I haven't tested your code, but that's probably it. Anything in an attribute value surrounded by {} gets interpeted as an AVT, in other words, an expression. regards, Charles White CEO The Tumeric Partnership http://www.tumeric.net chuck@xxxxxxxxxxx ________________________________________ Author, Mastering XSLT Sybex Books, May, 2002 Co-Author, Mastering XML, Premium Edition Sybex Books, May, 2001 http://www.javertising.com ----- Original Message ----- From: "Deshpande, Gururaj" <gururaj.deshpande@xxxxxxxxxxxx> To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, April 10, 2002 7:45 AM Subject: [xsl] How do we call Javascript function in XSL file on Netscape (Ver 6.2) browser? > To, all XML Gurus > My question is about Netscape 6.2, XSL, XML and Javascript. I am doing > client side transformation. No server support at all. When I call javascript > function within XSL file, Netscape does not run / understand the javascript. > Same works on IE without problems. > I am copying my XSL file below. > Does anybody has a solution? Thanks > Gururaj > > xsl file > <?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> > <title></title> > </head> > <link rel="stylesheet" type="text/css" > href="../html/SparesCat.CSS"></link> > <SCRIPT language="JavaScript"><![CDATA[ > function test(avalue) { > alert(avalue); > } > ]]></SCRIPT> > <body> > <table> > <tr> > <td>Equipment No..</td> > <td>Description.</td> > <td>Manufacture No..</td> > <td>Contract No.</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 valign="middle" class="TableGrey"> > <td><a href="javascript:test('{prodxml}')"><xsl:value-of > select="equipmentno"/></a></td> > <td><xsl:value-of select="description"/></td> > <td><xsl:value-of select="manufactureno"/></td> > <td><xsl:value-of select="contractno"/></td> > </tr> > </xsl:for-each> > </xsl:template> > </xsl:stylesheet> > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Seperating a delimited St, Greg Faron | Thread | [xsl] replacing a character with a , Corey A. Spitzer |
RE: [xsl] passing twice in a node (, Michael Kay | Date | RE: [xsl] How do we call Javascript, Deshpande, Gururaj |
Month |