Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Jan 11, 2011 @ 01:19
    Profiterole
    0

    Date smaller than or equal

    Hi, I try to select events with eventDate smaller or equal to a certain date (2009 in my example). I saw the library DateGreaterThanOrEqual, but the library I want do not exist (DateSmallerThanOrEqual).

    So I tried that :

    <xsl:for-each select="umbraco.library:GetXmlNodeById($albumSource)/node[(data[@alias = 'eventDate']) &lt;= 2009]">
    <xsl:call-template name="fonction"/>
    </xsl:for-each>

    I, as you can guess, it did not worked.

    Do you have an idea how I can do this?

    Thank you

  • Chris Houston 535 posts 980 karma points MVP admin c-trib
    Jan 11, 2011 @ 02:03
    Chris Houston
    0

    Hi,

    I am not 100% sure about the first example as I have not tested it, but I think the following two examples should help you. The first should work for the original XML format used prior to 4.5 but if you are using the latest format then try the second one:

    <xsl:for-each select="umbraco.library:GetXmlNodeById($albumSource)/node[Exslt.ExsltDatesAndTimes:year(data[@alias = 'eventDate']) &lt;= 2009]">
    <xsl:call-template name="function"/>
    </xsl:for-each>

    Or for the latest XML format:

    <xsl:for-each select="umbraco.library:GetXmlNodeById($albumSource)/* [@isDoc][Exslt.ExsltDatesAndTimes:year(@updateDate) &lt;= 2011]">
        <xsl:call-template name="function"/>
    </xsl:for-each>

    Best regards,

    Chris

  • Profiterole 232 posts 264 karma points
    Jan 11, 2011 @ 02:29
    Profiterole
    0

    Hi, thank you... Someday I'll be good in xslt :) I used the first one in 4.5 with Legacy mode... I began to be good with first format and now I have to understand the new one...

    Thank you again!

Please Sign in or register to post replies

Write your reply to:

Draft