6 users online. Create an account or sign in to join them.Users
< and > is not working
This is an open discussion with 7 replies, filed under Troubleshooting.
Search
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 < 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, '-', '') < 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.
<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 < $today"/> </xsl:template>When I do this the variable
$actiefisfalse, the same when I use$gt;. But when I use the=or!=I get a resulttrue.Does someone know what’s the problem here?