<?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:bod="http://schema.infor.com/InforOAGIS/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<!---->
	<!-- imports -->
	<!---->
	<!-- template to insert -->
	<xsl:template name="VDACountry">
		<!---->
		<!-- parameter -->
		<xsl:param name="name"/>
		<xsl:param name="code"/>
		<!---->
		<!-- set country code - map with countrycodes.xml -->
		<xsl:variable name="codeInt">
			<xsl:value-of select="document('codes/countrycodes.xml')/countries/country/countrycodevda[@bod=$code]/text()"/>
		</xsl:variable>
		<!---->
		<!-- country code must be mapped to VDA value -->
		<xsl:if test="$code != '' and $codeInt =''">
			<xsl:message terminate="yes">
				<xsl:value-of select="concat('country code ', $code, ' could not be mapped!')"/>
			</xsl:message>
		</xsl:if>
		<!---->
		<!-- country code -->
		<xsl:element name="{$name}">
			<xsl:value-of select="$codeInt"/>
		</xsl:element>
	</xsl:template>
</xsl:stylesheet>
