2016-07-06 73 views
0

我想一年添加到XSL 2.0 當前的日期我知道如何獲得當前日期:XSL年加入當前的日期

<APPLIN_DT><xsl:value-fof select="format-date(current-date(), '[Y0001]-[M01]-[D01]')"/></APPLIN_DT> 

當前日期也必須進行格式化像「YYYY- MM-DD' 在另一個元素中,我需要currentdate + 1年。 這樣做的最佳解決方案是什麼?

謝謝!

羅伯特

回答

1

當您使用XSLT 2.0,試試這個...

<APPLIN_DT> 
    <xsl:value-of select="format-date(current-date() + xs:yearMonthDuration('P1Y'), '[Y0001]-[M01]-[D01]')"/> 
</APPLIN_DT> 

凡在xs前綴的名稱空間是http://www.w3.org/2001/XMLSchema