OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
using javascript in a xsl stylesheet
This page's ID:
10900
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
maybe i'm asking something idiot.. please forgive me! I'm trying to use some javascript function in a xsl stylesheet, and it doesn't work. Theese are the functions: <script language="JavaScript"> <!-- function MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW | | innerHeight!=document.MM_pgH) location.reload(); } MM_reloadPage(true); //--> function MM_findObj(n, d) { //v4.0 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && document.getElementById) x=document.getElementById(n); return x; } function MM_showHideLayers() { //v3.0 var i,p,v,obj,args=MM_showHideLayers.arguments; for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2]; if (obj.style) { obj=obj.style; v=(v=='show')?'visible' :(v='hide')?'hidden':v; } obj.visibility=v; } } //--> //--> </script> I copied them from a html document made with dreamweaver! And I tried to call them in the stylesheet in this way: <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl :output method="html" /> <xsl:template match="/"> <head> <title> - </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></meta> ... <!-- I create a layer with div tag and the name is given through a generete-id function --> <div id="generate-id(.)" style=" visibility: visible"><b><xsl:value-of select="./numnota" /> </font><xsl:value-of select="./testonota" /></b> </div> <!-- then i recall the function trying to hidden the layer, referring to the same element and so the same generated id --> <b onClick="MM_showHideLayers('generate-id(.)','','hidden')"> [<xsl:value-of select="./numnota" />]</b> I don't know which is the way to put the javascript functions in the xsl stylesheet! I dont understand why dreamweaver is using comment tags containing the javascript functions... if I erase these tags, and use & etc., the browser can use my stylesheet, but the functions don't work (Errors loading the page...) I hope of having been clear, and that someone can help me! thanks a lot, Stefano
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »