Created
April 19, 2011 15:45
-
-
Save markito/928536 to your computer and use it in GitHub Desktop.
xsd date fix for 12/31
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:variable name="myYear" select="year-from-date(current-date())"/> | |
<xsl:choose> | |
<xsl:when test="/env:Body/rout:ISO8583_0100/ISO8583_0100_Request/bit_013 = 1231"> | |
<top:transactionDate> | |
<xsl:choose> | |
<xsl:when test="concat(month-from-date(current-date()),day-from-date(current-date())) != 1231"> | |
<xsl:variable name="fixYear" select="int($myYear - 1)"/> | |
<xsl:value-of select="concat(/env:Body/rout:ISO8583_0100/ISO8583_0100_Request/bit_013,$fixYear)"/> | |
</xsl:when> | |
<xsl:otherwise> | |
<xsl:value-of select="concat(/env:Body/rout:ISO8583_0100/ISO8583_0100_Request/bit_013,$myYear)"/> | |
</xsl:otherwise> | |
</xsl:choose> | |
</top:transactionDate> | |
</xsl:when> | |
<xsl:otherwise> | |
<top:transactionDate> | |
<xsl:value-of select="concat(/env:Body/rout:ISO8583_0100/ISO8583_0100_Request/bit_013,$myYear)"/> | |
</top:transactionDate> | |
</xsl:otherwise> | |
</xsl:choose> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment