I want to compare current date against a start date and end date.
XML is:
<forms>
<form id="11">
<start>somedate</start>
<end>someotherdate</end>
</form>
</forms>
I am currently trying:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ex="http://exslt.org/dates-and-times" extension-element-prefixes="ex" >
<xsl:choose>
<xsl:when test="end != ''
and start != ''
and ex:date(start) <= current-date()
and current-date() <= ex:date(end)">
<!-- Do Stuff -->
</xsl:when>
</xsl:choose>
I get the following error:
xmlXPathCompOpEval: function current-date not found
XPath error : Unregistered function
XPath error : Stack usage errror
<ul class="ccb_forms_ul"></ul>
Assuming your dates are in yyyy-mm-dd format (as I understand they are from your other question), this should work with most XSLT 1.0 processors: