<?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">
	<!---->
	<!-- imports -->
	<!---->
	<!-- template to insert -->
	<xsl:template name="DocumentReference">
		<!---->
		<!-- parameter -->
		<xsl:param name="type"/>
		<xsl:param name="referenceID"/>
		<xsl:param name="value"/>
		<xsl:param name="agencyRole"/>
		<xsl:param name="variationID"/>
		<xsl:param name="date"/>
		<xsl:param name="time"/>
		<xsl:param name="name"/>
		<!---->
		<!-- set name -->
		<xsl:variable name="nameInt">
			<xsl:choose>
				<xsl:when test="$name != ''">
					<xsl:value-of select="$name"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="'DocumentReference'"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		<!---->
		<xsl:element name="{$nameInt}">
			<!-- type is mandatory -->
			<xsl:attribute name="type"><xsl:value-of select="$type"/></xsl:attribute>
			<!-- DocumentID -->
			<xsl:call-template name="DocumentID">
				<xsl:with-param name="documentID">
					<xsl:value-of select="$referenceID"/>
				</xsl:with-param>
				<xsl:with-param name="agencyRole">
					<xsl:value-of select="$agencyRole"/>
				</xsl:with-param>
				<xsl:with-param name="variationID">
					<xsl:value-of select="$variationID"/>
				</xsl:with-param>
			</xsl:call-template>
			<xsl:call-template name="DateTime">
				<xsl:with-param name="name">
					<xsl:value-of select="'DocumentDateTime'"/>
				</xsl:with-param>
				<xsl:with-param name="date">
					<xsl:value-of select="$date"/>
				</xsl:with-param>
				<xsl:with-param name="time">
					<xsl:value-of select="$time"/>
				</xsl:with-param>
			</xsl:call-template>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
