System.Xml.Xsl.XslTransformException: An error occurred
during a call to extension function 'GenerateDates'. See InnerException for a
complete description of the error. ---> System.FormatException: String was
not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s,
DateTimeFormatInfo dtfi, DateTimeStyles styles) at PDCalendar.library.[1](String [1], String
) at PDCalendar.library.GenerateDates(String _start, String
_end, String _alias) --- End of inner exception stack trace --- at
System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[]
args) at
System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name,
String namespaceUri, IList`1[] args) at messages(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at
System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver
dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at
System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver
dataSources, XsltArgumentList argumentList, XmlWriter writer) at
System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input,
XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) at
System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input,
XsltArgumentList arguments, TextWriter results) at
umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform
xslt, Dictionary`2 parameters) at
umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object
sender, EventArgs e)
This happens even when there are no published events.
This happens even when using the default PDCalendar XSLT.
could you send me the line of your xlst where you call the pdcalendar:GenerateDates?
I'm guessing you don't hardcode your dates every moth right? My first guess is that one of the dates put into the GenerateDates is in a wrong format, that needs to be yyyy-MM-dd.
Correct, we don’t hard code the dates, however, even if we do, we get the error. The reason we tried hardcoding it was to eliminate the possibility that any of our date calculations are the cause of the problem.
Craig and I had a few mails back and forth and we were able to fix the issue. It was a bug in PDCalendar which has been fixed in version 2.0.3 (Craig, I allready sent you that version by mail)
If anyone else encounters this problem, download the latest zip-file (2.0.3), extract the dll and overwrite the pdcalender.dll in the bin-folder.
It's worth noting that the version of the dll in the package that is installed through the package manager matches the version in the downloadable package on the project page. They are not the same, however, as the version in the downloadable package does correct this bug.
Start date in February 2012 causing Error parsing XSLT
Our client's site: http://mountaintimes.info is throwing an XSLT error as of February 1.
The problem we're having occurs when the call in the XSLT to pdcalendar:GenerateDates is passed a start date greater than February 1st, 2012.
In our case, a call like:
<xsl:variable name="messages" select="pdcalendar:GenerateDates('2012-01-31','2012-12-31','event')" />
would work, but when it rolls around to February:
<xsl:variable name="messages" select="pdcalendar:GenerateDates('2012-02-01','2012-12-31','event')" />
we get the following error:
Error parsing the XSLT:
System.Xml.Xsl.XslTransformException: An error occurred during a call to extension function 'GenerateDates'. See InnerException for a complete description of the error. ---> System.FormatException: String was not recognized as a valid DateTime. at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles) at PDCalendar.library.[1](String [1], String
) at PDCalendar.library.GenerateDates(String _start, String _end, String _alias) --- End of inner exception stack trace --- at System.Xml.Xsl.Runtime.XmlExtensionFunction.Invoke(Object extObj, Object[] args) at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args) at messages(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results) at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver) at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results) at umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters) at umbraco.presentation.umbraco.developer.Xslt.xsltVisualize.visualizeDo_Click(Object sender, EventArgs e)
This happens even when there are no published events.
This happens even when using the default PDCalendar XSLT.
Could this be because this is a leap year?
Correct, we don’t hard code the dates, however, even if we do, we get the error. The reason we tried hardcoding it was to eliminate the possibility that any of our date calculations are the cause of the problem.
Here’s the line you requested:
<xsl:variable name="messages" select="pdcalendar:GenerateDates('2012-02-01','2012-12-31','event')" />
Craig and I had a few mails back and forth and we were able to fix the issue. It was a bug in PDCalendar which has been fixed in version 2.0.3 (Craig, I allready sent you that version by mail)
If anyone else encounters this problem, download the latest zip-file (2.0.3), extract the dll and overwrite the pdcalender.dll in the bin-folder.
Peter
Thanks for all your help, Peter!
- Craig
It's worth noting that the version of the dll in the package that is installed through the package manager matches the version in the downloadable package on the project page. They are not the same, however, as the version in the downloadable package does correct this bug.
Cheers,
-Sheppe
Hi, I have the same issue and have downloaded the package and replace the dll but still have the problem.
can you provide a link to the correct dll just to be sure.
Thanks
Digby
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.