1

xslt2.0 を 1.0 にダウングレードして xalan を使用していましたが、次の例外が発生しています。

回復可能なエラー: 9 行目: サポートされていない XSL 要素 '関数'。

xsltの部分は以下の通りです。

    <xsl:function name="nav:adjustDate">
            <xsl:param name="dateStr" />
            <xsl:param name="age" />
            <xsl:variable name="minutes">
                    <xsl:choose>
                            <xsl:when test="$age = 1">
                                    <xsl:value-of select="0" />
                            </xsl:when>
                            <xsl:when test="$age = 2">
                                    <xsl:value-of select="-10" />
                            </xsl:when>
                            <xsl:when test="$age = 3">
                                    <xsl:value-of select="-20" />
                            </xsl:when>
                            <xsl:when test="$age = 4">
                                    <xsl:value-of select="-30" />
                            </xsl:when>
                            <xsl:when test="$age = 5">
                                    <xsl:value-of select="-40" />
                            </xsl:when>
                            <xsl:when test="$age = 6">
                                    <xsl:value-of select="-50" />
                            </xsl:when>
                            <xsl:otherwise>
                                    <xsl:value-of select="-60" />
                            </xsl:otherwise>
                    </xsl:choose>
            </xsl:variable>
            <xsl:variable name="dateFormatterStr">
                    <xsl:text>yyyy-MM-dd'T'HH:mm:ss.SSSZ</xsl:text>
            </xsl:variable>
            <!--  output date format should match the input date format of the job file -->
            <xsl:variable name="outDateFormatterStr">
                    <xsl:text>yyyy-MM-dd'T'HH:mm:ssZ</xsl:text>
            </xsl:variable>
    <xsl:variable name="bo" select="bool:new('FALSE')" />
            <xsl:variable name="dateFormatter" select="dateFormat:new($dateFormatterStr)" />
            <xsl:variable name="outDateFormatter" select="dateFormat:new($outDateFormatterStr)" />
    <xsl:value-of select="dateFormat:setLenient($dateFormatter,$bo)" />
            <!-- Have to remove the colon in the timezone offset(eg. +05:00) otherwise date formatter wont work correctly -->
            <xsl:variable name="testDate"
                    select="dateFormat:parse($dateFormatter,concat(substring($dateStr,1,string-length($dateStr)-3),'00'))" />
            <xsl:variable name="cal" select="gregorianCal:new()" />
            <xsl:value-of select="gregorianCal:setTime($cal,$testDate)" />
            <!-- xslt version 2 does not accept contants 12 represents the value for java.util.Calendar.MINUTE
                 Follow section of code will subtract the number of minutes-->
            <xsl:value-of select="gregorianCal:add($cal,12,$minutes)" />
            <xsl:variable name="outputDate" select="gregorianCal:getTime($cal)" />
            <xsl:sequence select="dateFormat:format($outDateFormatter,$outputDate)" />
    </xsl:function>

xslt1.0のxsl:sequenceの代替も知りたい

誰かがこれについて私を案内できますか? どうやって進める ?xslt はまったく新しいものです。

4

1 に答える 1