问题
How can I convert a date contained in a string into a date value with XPath?
I got the string by formatting a date value with fn:format-date
, and now I want the date value from the formatted string.
Thank you,
回答1:
You can use EXSLT's date:date(string)
. It is implemented in most XSLT processors but also as a pure XSLT function.
Documentation: http://www.exslt.org/date/functions/date/index.html.
来源:https://stackoverflow.com/questions/9208959/convert-a-formatted-date-string-to-a-date-value-in-xpath