<?xml version="1.0"?>
<!--
		@author Last Changed:$Author: theegarten $ @version $Revision: 4772 $
		@date $Date: 2010-09-06 15:04:22 +0200 (Mo, 06. Sep 2010) $
	-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:java="http://xml.apache.org/saxon/java" xmlns:tfs="http://www.infor.com/tfs" exclude-result-prefixes="java tfs" xmlns:xd="http://www.pnp-software.com/XSLTdoc">
	<!---->
	<!--************************************************************-->
	<!-- Formats the date from an EDI Message -->
	<!--************************************************************-->
	<!---->
	<xd:doc>
		This function returns the EDI date passed with 6 digits as a date with
		8 digits. As century the fix value '20' is added for the first two
		digits. If the passed date is empty(EDIFACT passes an empty string,
		VDA passes '000000') no value is returned.
		<xd:param name="date">EDI date to </xd:param>
	</xd:doc>
	<!---->
	<xsl:function name="tfs:getEDIDate">
		<xsl:param name="date"/>
		<!---->
		<xsl:choose>
			<xsl:when test="$date = '000000'">
				<xsl:value-of select="''"/>
			</xsl:when>
			<xsl:when test="$date !='' and string-length($date) = 6 ">
			<xsl:value-of select="concat('20',$date)"/>			
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$date"/>			
			</xsl:otherwise>
		</xsl:choose>
	</xsl:function>
</xsl:stylesheet>
