在 XSL 中转换日期
Convert date in XSL
我想知道你怎么能把这种日期改成正常日期
样本xml:
我希望我的输出是这样的:基于示例 xml 的 01/03/1959。我正在使用 xslt 1.0 版和 xpath 1.0
好吧,在 XSLT 1.0 中没有这样的日期,所以只需威胁将其作为字符串操作的练习并写出:
<xsl:value-of select="substring(data, 5, 2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(data, 7, 2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(data, 1, 4)"/>
或者,如果您愿意:
<xsl:value-of select="concat(substring(data, 5, 2), '/', substring(data, 7, 2), '/', substring(data, 1, 4))"/>
how can you this kind of date into a normal one.
实际上,"normal one" 看起来像这样:1959-01-03
。
http://en.wikipedia.org/wiki/ISO_8601
我想知道你怎么能把这种日期改成正常日期
样本xml:
我希望我的输出是这样的:基于示例 xml 的 01/03/1959。我正在使用 xslt 1.0 版和 xpath 1.0
好吧,在 XSLT 1.0 中没有这样的日期,所以只需威胁将其作为字符串操作的练习并写出:
<xsl:value-of select="substring(data, 5, 2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(data, 7, 2)"/>
<xsl:text>/</xsl:text>
<xsl:value-of select="substring(data, 1, 4)"/>
或者,如果您愿意:
<xsl:value-of select="concat(substring(data, 5, 2), '/', substring(data, 7, 2), '/', substring(data, 1, 4))"/>
how can you this kind of date into a normal one.
实际上,"normal one" 看起来像这样:1959-01-03
。
http://en.wikipedia.org/wiki/ISO_8601