我有
<datetime xml:space="preserve">2020-08-11T04:00:00</datetime>
我想把这个改成
2020-08-11
04:00:00
使用xslt,但我搞不清楚,我搜索了很多,但没有找到
在这种情况下,您可以使用substring-before()
和substring-after()
,使用T作为参考来分割文本,如:
<xsl:template match="datetime">
<xsl:value-of select="substring-before(., 'T')"/>
<xsl:value-of select="substring-after(., 'T')"/>
</xsl:template>