Is this not possible? Been trying something along the lines of the following
$currentPage/* [($regionName = 'ALL' or $regionName = eventRegion) and umbraco.library:DateGreaterThanOrEqualToday(eventDate) and @isDoc and string(umbracoNaviHide) != '1']
It throws up an error each time. I've managed to achieve what I want with various xsl:if, but that uses test. Wondering if there's an issue using library items in select clauses?
Or am I, once more, just trying to do something completely wrong?
what is the error you are getting?? i am using this as a select statement and it works just fine... not the exact library item... just because i was unaware of GreaterThanOrEqualToday - Doh!
<xsl:for-each select="umbraco.library:GetXmlAll()//*
[name() = $documentTypeAlias and string(umbracoNaviHide) != '1' and
umbraco.library:DateGreaterThan(start, $today)]">
This probably happens because one or two of the nodes you select has an empty (or non-existent) value in the property you send to the library function.
Try to exclude the library call and inside the loop, do a simple value-of for the eventDate property along with @nodeName (or @id) and see if there's not one or two nodes getting caught in there with rogue data...
Yeah - just came to another realization: You're doing all the filtering in the same predicate so effectively, the processor is calling the library function on everything else too - try putting that call in a separate predicate, like this:
OK - don't you get a "better"/more specific error description when you try to save the XSLT file in the Umbraco UI? - Usually you'd get a red box with the .NET error description.
D'oh. I never really look at xslt in the Umbraco interface. More fool me
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)
Edit: That said, why doesn't it mind it in the xsl:if?
That error definitely tells me that it's calling the method on a property that doesn't exist (or is empty) - are you using it in a for-each select or a variable select?
You could try to prepend the eventDate with current()/ (so current()/eventDate ) to see if it's somehow trying to use the eventDate of $currentPage...
Otherwise - could you post some more of the XSLT here?
DateGreaterThanOrEqualToday in xslt select
Is this not possible? Been trying something along the lines of the following
It throws up an error each time. I've managed to achieve what I want with various xsl:if, but that uses test. Wondering if there's an issue using library items in select clauses?
Or am I, once more, just trying to do something completely wrong?
what is the error you are getting?? i am using this as a select statement and it works just fine... not the exact library item... just because i was unaware of GreaterThanOrEqualToday - Doh!
Just the generic unable to render xslt error
Just the generic unable to render xslt error
Hi Tony,
This probably happens because one or two of the nodes you select has an empty (or non-existent) value in the property you send to the library function.
Try to exclude the library call and inside the loop, do a simple value-of for the eventDate property along with @nodeName (or @id) and see if there's not one or two nodes getting caught in there with rogue data...
/Chriztian
Nah. Two nodes with holding test data. Both have values for that field
Yeah - just came to another realization: You're doing all the filtering in the same predicate so effectively, the processor is calling the library function on everything else too - try putting that call in a separate predicate, like this:
This way, it should only be called for "valid" nodes...
/Chriztian
Same:
Error parsing XSLT file: \xslt\Events.xslt
OK - don't you get a "better"/more specific error description when you try to save the XSLT file in the Umbraco UI? - Usually you'd get a red box with the .NET error description.
/Chriztian
D'oh. I never really look at xslt in the Umbraco interface. More fool me
Edit: That said, why doesn't it mind it in the xsl:if?
I only ever use it for the error messages :-)
That error definitely tells me that it's calling the method on a property that doesn't exist (or is empty) - are you using it in a for-each select or a variable select?
You could try to prepend the eventDate with current()/ (so current()/eventDate ) to see if it's somehow trying to use the eventDate of $currentPage...
Otherwise - could you post some more of the XSLT here?
/Chriztian
is working on a reply...