Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Craig Palenshus 39 posts 63 karma points
    Feb 06, 2012 @ 15:56
    Craig Palenshus
    0

    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?

     

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Feb 06, 2012 @ 17:07
    Peter Dijksterhuis
    0
    Craig,
     
    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.
     
    Peter
  • Craig Palenshus 39 posts 63 karma points
    Feb 06, 2012 @ 17:12
    Craig Palenshus
    0

    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')" />

  • Peter Dijksterhuis 1442 posts 1722 karma points
    Feb 07, 2012 @ 22:06
    Peter Dijksterhuis
    0

    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

  • Craig Palenshus 39 posts 63 karma points
    Feb 07, 2012 @ 22:09
    Craig Palenshus
    0

    Thanks for all your help, Peter!

    - Craig

  • Sheppe Pharis 43 posts 139 karma points
    Feb 02, 2013 @ 01:16
    Sheppe Pharis
    0

    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

  • Digby 23 posts 43 karma points
    Mar 28, 2014 @ 11:52
    Digby
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft