我是 xslt 的新手。所以这可能是一个基本问题。我正在尝试将以 xs:date 格式接收到的日期转换为 xs:dateTime 接收到的输入是:<tns:receivedDate>2017-06-27</tns:receivedDate>
我想将其转换为2017-06-27T00:00:00.000-05:00
或2017-06-27T00:00:00.000
我尝试了下面的语句,但不起作用
<tns:receivedDate>xs:date(<xsl:value-of select="//ns0:receivedDate"/>)cast as xs:dateTime</tns:receivedDate>
请让我知道缺少什么。谢谢
XSLT 1.0 没有日期的概念。您需要使用字符串操作来执行此操作 - 例如:
<tns:receivedDate>
<xsl:value-of select="//ns0:receivedDate"/>
<xsl:text>T00:00:00.000</xsl:text>
</tns:receivedDate>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句