N
nilun75
Hi, I have a problem with a probably simple xsl that uses javascript.
Hope anyone can help me with this one.
Code
--------
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:js="http://www.oracle.com/XSL/Transform/java/java.lang.String"
xmlns:msxml="urn:schemas-microsoft-com:xslt">
<msxml:script language="JScript" implements-prefix="js">
function retTime() {
var currentTime = new Date();
var month = currentTime.getMonth()+1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var hour = currentTime.getHours();
var mins = currentTime.getMinutes();
var secs = currentTime.getSeconds();
return(year + "" + month + "" + day + "" + hour + "" + mins + "" +
secs)
}
</msxml:script>
<xsl:template match="/">
<DATETIME>
<xsl:value-of select="js:retTime()"/>
<xsl:text>***SOME_TEXT***</xsl:text>
</DATETIME>
</xsl:template>
</xsl:stylesheet>
---
Error message I get is:
<Line 23, Column 40>: XML-22043: (Error) Extension function error:
Method not found 'retTime'
Can anyone help me with this one?
Hope anyone can help me with this one.
Code
--------
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:js="http://www.oracle.com/XSL/Transform/java/java.lang.String"
xmlns:msxml="urn:schemas-microsoft-com:xslt">
<msxml:script language="JScript" implements-prefix="js">
function retTime() {
var currentTime = new Date();
var month = currentTime.getMonth()+1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var hour = currentTime.getHours();
var mins = currentTime.getMinutes();
var secs = currentTime.getSeconds();
return(year + "" + month + "" + day + "" + hour + "" + mins + "" +
secs)
}
</msxml:script>
<xsl:template match="/">
<DATETIME>
<xsl:value-of select="js:retTime()"/>
<xsl:text>***SOME_TEXT***</xsl:text>
</DATETIME>
</xsl:template>
</xsl:stylesheet>
---
Error message I get is:
<Line 23, Column 40>: XML-22043: (Error) Extension function error:
Method not found 'retTime'
Can anyone help me with this one?