Hello....
An XSLT file that I am using function correctly when called from a
browser but fails when used within .NET Transform function.
The code follows:
<msxsl:script language="JScript" implements-prefix="wg"><![CDATA[
/*-----------------------------------------------
FUNCTION: GetFiscalYear 1.0 / 20030313
PURPOSE:
-----------------------------------------------*/
function GetFiscalYear(vDate) {
/*
original
var rDATE = /^([0-9]{4})\-([0-9]{2})\-([0-9]{2})(([0-9]{2}):([0-9]{2}):([0-9]{2}))?$/;
replacement */
var rDATE = /^.*?$/;
var sDate, aDate, dDate;
var nFY = 0;
if(typeof(vDate) == "object") sDate = NodeValue(vDate); // convert
nodeset to string
if(typeof(sDate) != "string") return 0; // handle bad parameter
variant type
aDate = rDATE.exec(sDate); // check for expected date format
if(aDate == null) return -2;
dDate = new Date(eval(aDate[1]), eval(aDate[2]) - 1, eval(aDate[3]));
dDate.setMonth(dDate.getMonth() + 6);
nFY = dDate.getFullYear();
return nFY;
}
If I use the original rDATE, this function alway returns a -2. The
replacement doesn't cause a faile but also does not help me find a
problem.
Any clues ???
Thank you,