I looking for a good example how inject javascript inside of XSLT file and then will be transformed into html. My transformation works very well, but when I following every documentation about adding Script occur error [ERROR]: Cannot find class 'randomString'. [ERROR]: Cannot find external method 'randomString.getZoom' (must be public).
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common"
extension-element-prefixes="exsl"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="randomString">
<msxsl:script language="JScript" implements-prefix="user">
function getZoom() {
return "#zoom=100";
}
</msxsl:script>
<body>
<xsl:value-of select="user:getZoom()"/>
</body>
Many guys put there some kind of example.com inside of xmlns:user,but that namespace should be everything,right ? Anyway I need get that string "#zoom=100" into my html body, how ?
I tried get that String into html body.
msxsl:scriptwill only work with Microsoft, so if you are using Saxon or Xalan you'll have to adopt their flavor of inline scripting.xsl:functionas part of the XSLT language instead of needing to delegate work to functions in a proprietary/platform specific scripting language.