Which works as expected. That is, it processes all the nodes where the eventDate hasn't yet passed. There's just one thing I don't understand. If I remove the part data [@alias = 'eventDate'] != '' and from the xsl:for-each, it works just fine. But if I remove it from the xsl:when, it fails to save the xslt with the error:
Error occured
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
Why is this? I struggled hours to find out how to get around this weird problem. To me it seems odd that a previous comparison should affect the following method call (DateGreaterThanOrEqualToday).
If you save the xslt it checkes the xslt against an existing node (the first one), so if you dont't have this property there it will fail => you have to check if the value exists before usage. To go around you can mark the check box to not check for erros.
DateGreaterThanOrEqualToday
Hi.
I have the following xslt:
Which works as expected. That is, it processes all the nodes where the eventDate hasn't yet passed. There's just one thing I don't understand. If I remove the part data [@alias = 'eventDate'] != '' and from the xsl:for-each, it works just fine. But if I remove it from the xsl:when, it fails to save the xslt with the error:
Error occured
System.FormatException: String was not recognized as a valid DateTime.
at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
at umbraco.library.DateGreaterThanOrEqualToday(String firstDate)
Why is this? I struggled hours to find out how to get around this weird problem. To me it seems odd that a previous comparison should affect the following method call (DateGreaterThanOrEqualToday).
If you save the xslt it checkes the xslt against an existing node (the first one), so if you dont't have this property there it will fail => you have to check if the value exists before usage. To go around you can mark the check box to not check for erros.
hth, Thomas
is working on a reply...