<?xml version="1.0"?>
<!--
@author Last Changed:$Author: fbrodersen $
@version $Revision: 7898 $
@date $Date: 2011-04-28 14:52:08 +0200 (Do, 28 Apr 2011) $
-->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bod="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="com.infor.tfs.mappings.extensions.XsltExt">
	<!---->
	<!-- imports -->
	<!---->
	<!-- template to insert -->
	<xsl:template name="VDATime">
		<!---->
		<!-- parameter -->
		<xsl:param name="name"/>
		<xsl:param name="time"/>
		<!---->
		<!-- extract Time from BOD field -->
		<xsl:variable name="timeExt" select="substring($time, 12, 8)"/>
		<!---->
		<!-- set Time - time must be valid otherwise time is 0000 -->
		<xsl:variable name="timeInt">
			<xsl:choose>
				<xsl:when test="ext:parseDate($timeExt, 'HH:mm:ss','HHmm') != ''">
					<xsl:value-of select="ext:parseDate($timeExt, 'HH:mm:ss','HHmm')"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="'0000'"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<!-- Time field -->
		<xsl:element name="{$name}">
			<xsl:value-of select="$timeInt"/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
