第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

通過(guò)XSLT以XML格式格式化日期

通過(guò)XSLT以XML格式格式化日期

守候你守候我 2019-11-28 12:42:49
當(dāng)我使用XML序列化程序序列化時(shí)DateTime,它以以下格式編寫(xiě):<Date>2007-11-14T12:01:00</Date>當(dāng)通過(guò)XSLT樣式表傳遞它以輸出HTML時(shí),如何格式化?在大多數(shù)情況下,我只需要日期,而當(dāng)我需要時(shí)間時(shí),我當(dāng)然不希望其中包含“有趣的T”。
查看完整描述

3 回答

?
不負(fù)相思意

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>


查看完整回答
反對(duì) 回復(fù) 2019-11-28
  • 3 回答
  • 0 關(guān)注
  • 804 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)