[exslt] RE: date.msxsl.xsl
by Rindahl, Bruce other posts by this author
Mar 21 2002 2:38PM messages near this date
[exslt] RE: date.msxsl.xsl
|
Re: [exslt] RE: date.msxsl.xsl
I don't have a solution to this problem but I have used the date.msxsl.xsl
and found a couple of bugs in it. I sent this to Chris Bayes but haven't
heard back yet. Maybe several issues could be resolved at once. The
following is what I sent:
In the function _formatDate the lines:
case "xs:gMonthDay": //(--MM-DD)
return pad(oDate.getMonth()) + "-" +
pad(oDate.getDate());
break;
Should read:
case "xs:gMonthDay": //(--MM-DD)
return pad(oDate.getMonth() + 1) + "-" +
pad(oDate.getDate());
break;
In the funcion parseDate the lines:
if (oDate = _validDate(date, inFormat))
return _formatDate(oDate, "xs:dateTime", dfName,
ctx);
else
return '';
Should read:
if (oDate = _validDate(date, inFormat))
return _formatDate(oDate, dfName);
else
return '';
Thanks for your great code - I am using it a lot.
By the way I noticed the EXSLT functions date:hour-in-day,
date:minute-in-hour and date:second-in-minute are called in date.msxsl.xsl
date:hourInDay, date:minuteInHour and date:secondInMinute. Is this correct
or a previous version of the functions??
Bruce Rindahl
Message: 1
Date: Wed, 20 Mar 2002 15:15:24 -0600
From: "Bruce Krautbauer" <bruce.krautbauer@[...].com>
To: <exslt@[...].com>
Subject: [exslt] date.js with .Net System.Xml.Xsl
Hi all,
Has anyone else run into problems with JavaScript and the .Net
System.Xml.Xsl class? If I import date.msxsl.xsl and try to compile it
using the .Net System.Xml.Xsl classes, for example when debugging with
ActiveState's Visual XSLT Visual Studio.Net add-in, I get the following
error (note, you have to get by a previous error by changing the language
attribute from 'ECMSScript' to 'JavaScript' first):
Exception Starting XSLTransform :System.Xml.Xsl.XsltException: Script
compile errors:
file:///C:/BothTrends/date.msxsl.xsl(23,1) : error JS1002: Syntax error
file:///C:/BothTrends/date.msxsl.xsl(25,35) : error JS1197: Too many errors.
The file might not be a JScript .NET file
I seem to have boiled the problem down to Array assignments, i.e., the
following stylesheet generates the same error at the my_array[0]=1 line:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"
xmlns:user="urn:my-scripts">
<msxsl:script language="Javascript" implements-prefix="user">
<![CDATA[
var my_array = new Array();
my_array[0] = 1;
]]>
</msxsl:script>
</xsl:stylesheet>
I have some applications that use various EXSLT functions, including
date:seconds(), and would really like to be able to do this work in my new
environment. Any suggestions?
Thanks,
Bruce
--__--__--
_______________________________________________
exslt mailing list
list@[...].org
http://www.exslt.org/list
End of exslt Digest
Attachments:
unknown1
Thread:
Rindahl, Bruce
Jeni Tennison
Chris Bayes
|