Hi,
Iam very new to XSLT and XML. I am trying to invoke a javascript function from inside my xslt documen. The javascript snippet is as follows:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:js="urn:custom-javascript"
exclude-result-prefixes="msxsl js" >
<msxsl:script language = "JavaScript" implements-prefix = "js">
<![CDATA[
function compareCsvs (firstString,secondString) {
var firstArray=firstString.split(",");
var secondArray = secondString.split(",");
var result = "";
if ((firstString == "") || (secondString == ""))
return firstString;
for ( var i = 0; i < firstArray.length ; i++){
if ( firstArray[i] == secondArray[i] ) {
result = result + firstArray[i];
} else {
result = result + "<font color=#FF0000>"+ firstArray[i] + "</font>";
}
if (i != (firstArray.length - 1)){
result = result + ",";
}
}
return result;
}
]]>
</msxsl:script>
But whenver I try to see the output in IE 8, I am getting the error:
"Microsoft JScript runtime error Object doesn't support this property or method line = 7, col = 3 (line is offset from the st..."
I have tried to look up a solution online, but have failed so far. Any help is really appreciated.
Thanks in Advance,
Z