我目前有一个日期的以下解决方案,但是我的xml有很多日期需要以这种方式转换。有没有更快的方法?
<xsl:value-of select="substring($date/@Val,1,2)"/>
<xsl:choose>
<xsl:when test="(substring($date/@Val,4,2)='01')">-Jan-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='02')">-Feb-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='03')">-Mar-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='04')">-Apr-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='05')">-May-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='06')">-Jun-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='07')">-Jul-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='08')">-Aug-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='09')">-Sep-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='10')">-Oct-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='11')">-Nov-</xsl:when>
<xsl:when test="(substring($date/@Val,4,2)='12')">-Dec-</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:value-of select="substring($date/@Val,7,4)"/>