将格式化的日期字符串转换为XPath中的日期值 [英] Convert a formatted date string to a date value in XPath
本文介绍了将格式化的日期字符串转换为XPath中的日期值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用XPath将字符串中包含的日期转换为日期值?
How can I convert a date contained in a string into a date value with XPath?
我通过格式化日期值与 fn:format-date
,现在我需要格式化的字符串的日期值。
I got the string by formatting a date value with fn:format-date
, and now I want the date value from the formatted string.
谢谢,
推荐答案
您可以使用EXSLT的日期:date(string)
。它在大多数XSLT处理器中实现,但也可以作为纯XSLT功能。
You can use EXSLT's date:date(string)
. It is implemented in most XSLT processors but also as a pure XSLT function.
文档: http://www.exslt.org/date/functions/date/index.html 。
这篇关于将格式化的日期字符串转换为XPath中的日期值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文