如何在 XSLT 1.0 中查找当前日期 [英] how to find the current date in XSLT 1.0

查看:37
本文介绍了如何在 XSLT 1.0 中查找当前日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 XSLT 代码中检索当前日期时遇到问题.我正在使用 1.0 版和 MSXSL.exe 应用程序来触发我的 xslt 代码.我尝试使用以下代码行来实现此功能,但它不起作用.看起来 1.0 版本不支持当前日期功能.您能否提供一个适用于 xslt 1.0 的解决方案.

I am finding trouble in retrieving the current date in my XSLT code. I am using version 1.0 and MSXSL.exe application to trigger my xslt code. I tried using the following line of code to implement this functionality, however its not working. Looks like the version 1.0 doesn't support the current date function. Could you please provide a solution which will work for xslt 1.0.

               <xsl:value of select="current-date()"/>

推荐答案

XSLT 1.0 中没有 current-date() 函数.

There is no current-date() function in XSLT 1.0.

如果您的处理器支持,您可以使用 date-time() EXSLT 扩展函数.除此以外您必须在运行时将日期作为参数传递给样式表,或者从网络服务中获取.

If your processor supports it, you can use the date-time() EXSLT extension function. Otherwise you will have to pass the date as a parameter to the stylesheet during runtime, or get it from a web service.

这篇关于如何在 XSLT 1.0 中查找当前日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆