OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] How do we call Javascript function in XSL file on Netscape

[ Lists Home | Date Index | Thread Index ]

The html document your XSLT transform is creating is invalid according to
the HTML 4.01 DTD.  The only allowed content for the HTML element is (HEAD,
BODY).  You probably meant to put the link and SCRIPT elements into the HEAD
element.  Perhaps Netscape 6.2 is more standards-compliant and refuses to
accept illegal HTML?  It is useful in cases like these to run the output of
the style sheet through the W3C 'tidy' program.

Jeff
----- Original Message -----
From: "Deshpande, Gururaj" <gururaj.deshpande@flsmidth.com>
To: <xml-dev@lists.xml.org>
Sent: Wednesday, April 10, 2002 8:11 AM
Subject: [xml-dev] 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>
>
>
>
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://lists.xml.org/ob/adm.pl>
>
>
>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS