|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL - Javascript problem
Can you show us your stylesheet? Hi Oleg & xsl-List members, Thanx for your swift reply! Below you will find my stylesheets, these are shortened versions but with the functionality that I need. Normally the onLoadBody() must be executed but Netscape 6.1 gives the "Error: onLoadBody() is not defined" in the Javascript Console. greetz, Annelies Vercruysse XSL:---------------------------------------------------------------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <head> <title>Test page with javascript code</title> <script type="text/javascript">
function onloadBody() {
alert('When you see this, javascript works!');
}
</script></head> <body onload="onloadBody();">
<table border="1">
<tr>
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="CATALOG/CD">
<tr>
<td><xsl:value-of select="TITLE" /></td>
<td><xsl:value-of select="ARTIST" /></td>
</tr>
</xsl:for-each>
</table>
</body></html> </xsl:template> </xsl:stylesheet> -------------------------------------------------------------------- XML:---------------------------------------------------------------- <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="test.xsl"?> <CATALOG> <CD> <TITLE>Hide your heart</TITLE> <ARTIST>Bonnie Tyler</ARTIST> </CD> <CD> <TITLE>Greatest Hits</TITLE> <ARTIST>Dolly Parton</ARTIST> </CD> <CD> <TITLE>Still got the blues</TITLE> <ARTIST>Gary Moore</ARTIST> </CD> </CATALOG> -------------------------------------------------------------------- -------------------------------------------------------------------- Original Request: My current HTML pages contain Javascripts that treat elements in the HTML document. > (getElementById();) > > It seems that these javascripts are completely ignored when opening the XML page. Could it be that an XML page doesn't have the > "document"-property so an element will never be found? > > I've already tried to put the javascript between the following tags: > <![CDATA[ .... ]]> > > (I use the Netscape 6.1 browser) > > are there any known bugs with Javascripts within XSL? > can anyone please help me? It would very much be appreciated! From my experience with mozilla's xslt I remember there were some problemswith script invocation in generated on the fly html documents, but I remember there were some workarounds too. Can you show us your stylesheet? - -- Oleg Tkachenko Multiconn International, Israel _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








