<?xml version="1.0"?>
<!--
@author Last Changed:$Author: lenz $
@version $Revision: 5199 $
@date $Date: 2010-10-22 08:16:16 +0200 (Fr, 22 Okt 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">
    <!---->
    <!-- imports -->
    <xsl:import href="includes/Sender.xsl" xml:base="../"/>
    <xsl:import href="includes/fields/CrtDateTime.xsl" xml:base="../"/>
    <!---->
    <!-- template to insert -->
    <xsl:template name="ApplicationArea">
        <!---->
        <!-- parameter -->
        <xsl:param name="logicalID"/>
        <xsl:param name="componentID"/>
        <xsl:param name="confirmationCode"/>
        <xsl:param name="authorizationID"/>
        <xsl:param name="bodID"/>
        <xsl:param name="date"/>
        <xsl:param name="time"/>
        <!---->
        <!-- variables -->
        <!---->
        <!-- set BODID -->
        <xsl:variable name="bodIDInt">
            <xsl:choose>
                <xsl:when test="$bodID != ''">
                    <xsl:value-of select="$bodID"/>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="'#BODID#'"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!---->
        <!-- 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="'#CREATIONDATETIME#'"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <!---->
        <xsl:element name="ApplicationArea">
            <!---->
            <!-- Sender -->
            <xsl:call-template name="Sender">
                <xsl:with-param name="logicalID">
                    <xsl:value-of select="$logicalID"/>
                </xsl:with-param>
                <xsl:with-param name="componentID">
                    <xsl:value-of select="$componentID"/>
                </xsl:with-param>
                <xsl:with-param name="confirmationCode">
                    <xsl:value-of select="$confirmationCode"/>
                </xsl:with-param>
                <xsl:with-param name="authorizationID">
                    <xsl:value-of select="$authorizationID"/>
                </xsl:with-param>
            </xsl:call-template>
            <!---->
            <!-- CreationDateTime -->
            <xsl:call-template name="CrtDateTime">
                <xsl:with-param name="date">
                    <xsl:value-of select="$dateInt"/>
                </xsl:with-param>
                <xsl:with-param name="time">
                    <xsl:value-of select="$time"/>
                </xsl:with-param>
            </xsl:call-template>
            <!---->
            <!-- BODID -->
            <xsl:element name="BODID">
                <xsl:value-of select="$bodIDInt"/>
            </xsl:element>
        </xsl:element>
    </xsl:template>
</xsl:stylesheet>
