<?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="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="com.infor.tfs.mappings.extensions.XsltExt">
    <!---->
    <!-- template to insert -->
    <xsl:template name="CrtDateTime">
        <!---->
        <!-- parameter -->
        <xsl:param name="date"/>
        <xsl:param name="time"/>
        <!---->
        <!-- variables -->
        <!---->
        <!-- set Date -->
        <xsl:variable name="dateInt">
            <xsl:choose>
                <xsl:when test="$date != ''">
                    <xsl:value-of select="$date"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="ext:getDate('yyyy-MM-dd')"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!---->
        <!-- set Time -->
        <xsl:variable name="timeInt">
            <xsl:choose>
                <xsl:when test="$time != '' or $date != ''">
                    <xsl:value-of select="$time"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="ext:getTime('HH:mm:ss')"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <xsl:call-template name="DateTime">
            <xsl:with-param name="name">
                <xsl:value-of select="'CreationDateTime'"/>
            </xsl:with-param>
            <xsl:with-param name="date">
                <xsl:value-of select="$dateInt"/>
            </xsl:with-param>
            <xsl:with-param name="time">
                <xsl:value-of select="$timeInt"/>
            </xsl:with-param>
        </xsl:call-template>
    </xsl:template>
</xsl:stylesheet>
