3 回答

TA貢獻1777條經驗 獲得超10個贊
以下是幾個您可以使用的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是具有標準日期時間格式的元素或屬性的路徑。
- 3 回答
- 0 關注
- 799 瀏覽
添加回答
舉報