xml - XSL + Java Script Issue ... Unable to call javascript function from xsl file -
I'm a newbie for XSL world and facing some problems with XSL
& lt;? XML version = "1.0"? & Gt; & Lt; Xsl: stylesheet xmlns: xhtml = "http://www.w3.org/1999/xhtml" xmlns = "http://www.w3.org/1999/xhtml" xmlns: xsl = "http: // www. W3.org/1999/XSL/Transform "version =" 2.0 "& gt; & Lt; Xsl: template match = "/" & gt; & Lt; Html lang = "en" xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Top & gt; & Lt; Link rel = "stylesheet" type = "text / css" href = "mycss.css" /> & Lt; Script language = "javascript" type = "text / javascript" & gt; & Lt; XSL: Text & gt; & Lt; / XSL: text & gt; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Table & gt; & Lt; Tr bgcolor = 'yellow' onMouseover = "changecolor (event, 'red');" & Gt; MYTEXT & lt; / Tr & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Lt; / Html & gt; & Lt; / XSL: Templates & gt; & Lt; / XSL: stylesheet & gt; and my XML file
& lt; COUNTRY & gt; & Lt; City & gt; X & lt; / City & gt; & Lt; City & gt; Y & lt; / City & gt; & Lt; / Country & gt; and my javascript file is
function change color (E, highlight color) {source = ie? Event.srcElement: e.target source.style.backgroundColor = highlightcolor} The issue is not on the mouse, the color does not change in the browser ........
I do not include any javascript file (.js) in my XSL nor do I include the JavaScript function have seen . In the second place where the variable is defined which you are using in the changecolor function?
Check the HTML that is being prepared to see the visual source on your browser, to see if all of them are correct. Add some alerts to your function to confirm whether it is actually called.
Comments
Post a Comment