如何在XSLT 2.0中格式化日期

jvm*_*jvm 5 xslt-2.0

我需要显示日期,如2011年5月5日星期三,我正在尝试

<xsl:value-of select="format-date(
                         current-date(),
                         '[FNn,*-3], [D01] [MNn,*-3] [Y0001]',
                         'en',
                         '',
                         'US'
                      )" />
Run Code Online (Sandbox Code Playgroud)

另一个我试过

<xsl:value-of select="format-date(
                         current-date(),
                         '[FNn], [MNn] [D1o], [Y]',
                         'en',
                         (),
                         ()
                      )" />
Run Code Online (Sandbox Code Playgroud)

两者都让我跟随.我需要文字,它只提供数字.我使用XSLT 2.0

3, 5 4, 2011
Run Code Online (Sandbox Code Playgroud)

小智 7

这个样式表:

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <xsl:value-of select="format-date(
                                 current-date(),
                                 '[FNn], [D1o] [MNn,*-3], [Y]',
                                 'en',
                                 (),
                                 ()
                              )" />
    </xsl:template>
</xsl:stylesheet>
Run Code Online (Sandbox Code Playgroud)

输出:

Wednesday, 4th May, 2011
Run Code Online (Sandbox Code Playgroud)

在Saxon和Altova上测试过.