Search

<xsl:for-each select="entry[aangemaakt=$title]">
    <xsl:call-template name="overzicht_actief">
        <xsl:with-param name="publiceer-van" select="publiceer-van"/>
        <xsl:with-param name="publiceer-tot" select="publiceer-tot"/>
    </xsl:call-template>
</xsl:for-each>

<xsl:template name="overzicht_actief">
<xsl:param name="title"/>
<xsl:param name="publiceer-van"/>
<xsl:param name="publiceer-tot"/>
<xsl:variable name="actief" select="$publiceer-van &lt; $today"/>
</xsl:template>

When I do this the variable $actief is false, the same when I use $gt;. But when I use the = or != I get a result true.

Does someone know what’s the problem here?

Could you post your XML, please?

I guess from what I see that $publiceer-var is a XML node while $today is the core param, e. g. 2010-09-01, so is it possible that you are trying to compare a node and not a node’s value with today’s date?

Yes the $today is the core param and $publiceer-van and $publiceer-tot are nodes, how can I get the value of the node and compare them with the core param $today?

This is the XML

<vacatureoverzicht-beheer>
        <section id="10" handle="vacaturedatabase">Vacaturedatabase</section>
        <entry id="278">
            <aangemaakt handle="dirkmessemaker-psy-zonl">dirkmessemaker@psy-zo.nl</aangemaakt>
            <aanmaakdatum time="00:00" weekday="3">2010-09-01</aanmaakdatum>
            <publiceer-tot time="00:00" weekday="6">2010-09-04</publiceer-tot>
            <publiceer-van time="00:00" weekday="3">2010-09-01</publiceer-van>
            <vacature-naam handle="psycholoog">Psycholoog</vacature-naam>
        </entry>
    </vacatureoverzicht-beheer>

It looks to me like you’re comparing two strings that aren’t directly convertible to an integer. The &lt; is not the problem.

Okey, maybe it is, but how can I fix the problem? Put it between two ' ' apostrophes does the job ?

Try this:

<xsl:variable name="actief" select="translate($publiceer-van, '-', '') &lt; translate($today, '-', '')"/>

What Nils said. I was just about to suggest the same thing.

Guys really thanks for this solution. On my own I wouldn’t fix that problem. Now I’ve learned something new.

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