Search

Hi there,

I'm trying to count the number of new added entries younger than 8 day's.

I have two sections, one with the provinces of The Netherlands (total of 12) and another with terraces. Each entry inside the terraces section has an unique ID and the location information (such as the province and place).

I already now how to count the total of the terraces inside each province.

<xsl:template match="provinces/entry">
    <xsl:variable name="province" select="province/@handle"/>
    <xsl:variable name="new" select="count(//statics-total-terraces/entry[province/item/@handle = $province])"/>
</xsl:template>

But now I have to count the terraces which date is younger than 8 day's. I don't know how to do this?

My xml for the terraces

<statics-total-terraces>
    <section id="8" handle="terrace">Terrace</section>
    <entry id="160">
        <date-added time="22:06" weekday="1">2011-05-02</date-added>
        <place handle="amsterdam">Amsterdam</place>
        <province>
            <item handle="noord-holland">Noord-Holland</item>
        </province>
        <terrace-id handle="160-the-cafe">160-the-cafe</terrace-id>
    </entry>
</statics-total-terraces>

My xml for the provinces

<provinces>
    <section id="14" handle="provinces">Provinces</section>
    <entry id="221">
        <province handle="drenthe">Drenthe</province>
    </entry>
    <entry id="221">
        <province handle="brabant">Brabant</province>
    </entry>
    <entry id="221">
        <province handle="noord-holland">Noord-Holland</province>
    </entry>
</provinces>

Here's a hint. You can use EXSLT's date-difference.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details