I try to call javascript function xslt ? why it is not called?
http://xsltransform.net/gWEamLX
I tried like this
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:jscript="http://www.url.com"
exclude-result-prefixes="msxsl jscript">
<xsl:output method="html" doctype-public="XSLT-compat" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<hmtl>
<head>
<title>New Version!</title>
</head>
<xsl:variable name="sVar" select="'ss'"/>
<xsl:value-of select="jscript:getRegion(string($sVar))"/>
<msxsl:script language="JScript" implements-prefix="jscript">
function getRegion(sVar){
alert(sVar)
}
</msxsl:script>
</hmtl>
</xsl:template>
</xsl:transform>
I take reference from here Calling a user defined function written in javascript using xsl why alert is not showing
jscript, though you can calljavascriptfunction withinxhtmldocument.msxsl:scriptto be supported? And even when supported, why do you expect thealertfunction, which is not a function implemented by an Javascript engine, but rather by browsers, to work? If you have an XSLT processor like MSXML 3 or 6 supportingmsxsl:scriptthen you only have support for core objects/functions/data types implemented by the JScript engine msdn.microsoft.com/en-us/library/yek4tbz0(v=vs.85).aspx