EXSLT 日期:差异“bug”更改月份时
我在使用默认 date:difference EXSLT 模板时遇到一些问题,该模板位于 http ://www.exslt.org/date/functions/difference/index.html。 我已经能够缩小问题范围并找到源头:我的 XSL 处理器。 问题是,我可以访问的 XSLT 处理器说,日期“2011-02-28T10:00:00”和“2011-03-01T10:00:00”之间的差异是 -P27DT9H,当区别实际上是 PT15H(此持续时间是其他 XSLT 处理器(例如 Xalan 和 Saxon)正确计算的时间 - 通过 Oxygen XML 编辑器进行测试)。
现在,有没有办法编辑 XSL 模板(日期:差异)以使其与我的 XSL 处理器一起正常工作?我认为我使用的处理器是 JAXP 1.3 - 从可用的 SAP MII 12.1 文档中很难弄清楚。
注意:不可能安装另一个 XSLT 处理器 :)
编辑:进一步的研究表明,“在幕后”,JAXP 正在运行 Xalan(system-property('xsl:vendor') 返回“Apache Software Foundation (Xalan XSLTC)” )”)
编辑:问题的根源已经确定(!),但我无法找到任何可接受的解决方案。 date:difference 模板使用“document('')/*/...”从 xsl 文档本地获取数据集。 “document('')”技巧对我的处理器不起作用。我尝试将本地数据集添加到变量并使用 exslt:node-set() 创建节点集,但我已经遇到了 DTM 问题,并且添加该方法减少了我可以处理的数据量处理比现在更多的事情:(
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 :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让我们关闭这个,只是为了好玩:)
解决方案是将“结构”放入变量中,然后使用 exslt:node-set 将其放入节点集。这会消耗大量资源,但这就是使用非常有限(而且很旧!)的系统时所得到的结果。
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..