2013-05-13 2 views
0

내 스키마이다 : 나는 두 날짜 사이의 차이를 얻기 위해 노력하고는 XSLT 날짜 차이를 가져 오는 방법을

<xsl:stylesheet version="2.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:datetime="http://exslt.org/dates-and-times" xmlns:fn="http://www.w3.org/2005/xpath-functions"> 

.

실마리가 없습니다. 날짜 차이를 얻을 수

답변

3

예는 다음과 같습니다

<?xml version="1.0" encoding="UTF-8"?> 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"> 

<xsl:param name="currentDate" select="current-date()"/> 
    <xsl:param name="yesterdayDate" select="'2013-05-12'"/> 

    <xsl:template match="/"> 
    <xsl:value-of select="$currentDate - xs:date($yesterdayDate)"/><!-- Result in duration --> 
    </xsl:template> 

</xsl:stylesheet>