3 回答

TA貢獻(xiàn)1777條經(jīng)驗(yàn) 獲得超10個(gè)贊
以下是幾個(gè)您可以使用的1.0模板:
<xsl:template name="formatDate">
<xsl:param name="dateTime" />
<xsl:variable name="date" select="substring-before($dateTime, 'T')" />
<xsl:variable name="year" select="substring-before($date, '-')" />
<xsl:variable name="month" select="substring-before(substring-after($date, '-'), '-')" />
<xsl:variable name="day" select="substring-after(substring-after($date, '-'), '-')" />
<xsl:value-of select="concat($day, ' ', $month, ' ', $year)" />
</xsl:template>
<xsl:template name="formatTime">
<xsl:param name="dateTime" />
<xsl:value-of select="substring-after($dateTime, 'T')" />
</xsl:template>
致電給他們:-
<xsl:call-template name="formatDate">
<xsl:with-param name="dateTime" select="xpath" />
</xsl:call-template>
和
<xsl:call-template name="formatTime">
<xsl:with-param name="dateTime" select="xpath" />
</xsl:call-template>
其中xpath是具有標(biāo)準(zhǔn)日期時(shí)間格式的元素或?qū)傩缘穆窂健?/p>
- 3 回答
- 0 關(guān)注
- 804 瀏覽
添加回答
舉報(bào)