EXSLT date:difference "bug" when changing month

244 views Asked by At

I'm experiencing some problems when using the default date:difference EXSLT template, provided at http://www.exslt.org/date/functions/difference/index.html. I've been able to narrow down the problem and find the source: my XSL processor. The problem is, that the XSLT processor I have access to is saying, that the difference between the dates "2011-02-28T10:00:00" and "2011-03-01T10:00:00" is -P27DT9H, when the difference really is PT15H (This duration is what other XSLT processors, such as Xalan and Saxon calculates correctly - tested through Oxygen XML Editor).

Now, is there a way to edit the XSL template (date:difference) to get it to work properly with my XSL processor? I THINK the processor I'm using is JAXP 1.3 - it's a little hard to figure out from the SAP MII 12.1 documentation available.

NB: It is NOT possible to install another XSLT processor :)

Edit: Further research has shown, that "under the hood", JAXP is running Xalan (system-property('xsl:vendor') returns "Apache Software Foundation (Xalan XSLTC)")

Edit: Source of the problem has been identified (!), but I can't get to any acceptable solution. The date:difference template uses "document('')/*/..." to get a data-set locally from the xsl-document. The "document('')" trick just won't work with my processor. I've tried adding the local data-set to a variable and creating a node-set using exslt:node-set(), but I'm already running into DTM-problems, and adding that method reduces the amount of data i can handle even more than already :(

1

There are 1 answers

0
Thor Jacobsen On BEST ANSWER

Let's get this one closed, just for fun :) Solution was to put the "structure" into an variable and then use exslt:node-set to make it into a node set. This eats up a lot of resources, but that's what you get when using a very limited (and old!) system..