<?xml version="1.0" encoding="UTF-8"?>
<!--
This file was generated by Altova MapForce 2013sp1

YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.

Refer to the Altova MapForce Documentation for further details.
http://www.altova.com/mapforce
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="vmf xs">
	<xsl:template name="vmf:vmf1_Inputtoresult">
		<xsl:param name="input" select="/.."/>
		<xsl:choose>
			<xsl:when test="$input='119'">
				<xsl:value-of select="'Leistungserbringer,Buchhaltung'"/>
			</xsl:when>
			<xsl:when test="$input='114'">
				<xsl:value-of select="'Leistungserbringer,Chiropraktiker'"/>
			</xsl:when>
			<xsl:when test="$input='111'">
				<xsl:value-of select="'Leistungserbringer,Zahnärzte'"/>
			</xsl:when>
			<xsl:when test="$input='110'">
				<xsl:value-of select="'Leistungserbringer,Ärzte'"/>
			</xsl:when>
			<xsl:when test="$input='112'">
				<xsl:value-of select="'Leistungserbringer,Spitäler'"/>
			</xsl:when>
			<xsl:when test="$input='100'">
				<xsl:value-of select="'Kostenträger'"/>
			</xsl:when>
			<xsl:when test="$input='115'">
				<xsl:value-of select="'Leistungserbringer,Labore'"/>
			</xsl:when>
			<xsl:when test="$input='131'">
				<xsl:value-of select="'Leistungserbringer,MediData'"/>
			</xsl:when>
			<xsl:when test="$input='120'">
				<xsl:value-of select="'Leistungserbringer,Andere'"/>
			</xsl:when>
			<xsl:when test="$input='113'">
				<xsl:value-of select="'Leistungserbringer,Apotheken'"/>
			</xsl:when>
			<xsl:when test="$input='116'">
				<xsl:value-of select="'Leistungserbringer,Physiotherapeuten'"/>
			</xsl:when>
			<xsl:when test="$input='117'">
				<xsl:value-of select="'Leistungserbringer,Spitex'"/>
			</xsl:when>
			<xsl:when test="$input='118'">
				<xsl:value-of select="'Leistungserbringer,Transport und Rettung'"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="'Leistungserbringer,Unbekannt'"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:template name="vmf:vmf2_Inputtoresult">
		<xsl:param name="input" select="/.."/>
		<xsl:choose>
			<xsl:when test="$input='102'">
				<xsl:value-of select="''"/>
			</xsl:when>
			<xsl:when test="$input='100'">
				<xsl:value-of select="''"/>
			</xsl:when>
			<xsl:when test="$input='101'">
				<xsl:value-of select="',Hauptsitz'"/>
			</xsl:when>
			<xsl:when test="$input='103'">
				<xsl:value-of select="',IT'"/>
			</xsl:when>
			<xsl:when test="$input='104'">
				<xsl:value-of select="',Andere'"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="''"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
	<xsl:template match="/">
		<mlxmldata>
			<xsl:attribute name="xsi:noNamespaceSchemaLocation" namespace="http://www.w3.org/2001/XMLSchema-instance">C:/devtemp/Multilevel2/mlxml/MediPort/delight_address_container.xsd</xsl:attribute>
			<xsl:attribute name="application">MediPort Partner XML</xsl:attribute>
			<crm_address>
				<xsl:attribute name="updatecheck">
					<xsl:value-of select="string(floor(number('1')))"/>
				</xsl:attribute>
				<xsl:attribute name="modifyexisting">
					<xsl:value-of select="string(floor(number('0')))"/>
				</xsl:attribute>
				<xsl:for-each select="AdrBook">
					<xsl:attribute name="count">
						<xsl:value-of select="string(count(Partner))"/>
					</xsl:attribute>
				</xsl:for-each>
				<xsl:for-each select="AdrBook/Partner">
					<crm_address_item>
						<xsl:attribute name="zsrnr">
							<xsl:value-of select="string(floor(number(string(@ZSR))))"/>
						</xsl:attribute>
						<xsl:attribute name="zip">
							<xsl:value-of select="string(floor(number(string(@ZIP))))"/>
						</xsl:attribute>
						<xsl:attribute name="title">
							<xsl:value-of select="string(@Title)"/>
						</xsl:attribute>
						<xsl:attribute name="talkto">
							<xsl:value-of select="string(@Salutation)"/>
						</xsl:attribute>
						<xsl:attribute name="surname">
							<xsl:value-of select="string(@FirstName)"/>
						</xsl:attribute>
						<xsl:attribute name="postbox">
							<xsl:value-of select="string(@POBOX)"/>
						</xsl:attribute>
						<xsl:attribute name="phone2">
							<xsl:value-of select="string(@Phone)"/>
						</xsl:attribute>
						<xsl:attribute name="name">
							<xsl:value-of select="string(@LastName)"/>
						</xsl:attribute>
						<xsl:attribute name="medwingln">
							<xsl:value-of select="string(floor(number(string(@EAN))))"/>
						</xsl:attribute>
						<xsl:attribute name="internet2">
							<xsl:value-of select="string(@URL)"/>
						</xsl:attribute>
						<xsl:attribute name="faxnumber2">
							<xsl:value-of select="string(@Fax)"/>
						</xsl:attribute>
						<xsl:attribute name="email2">
							<xsl:value-of select="string(@Email)"/>
						</xsl:attribute>
						<xsl:attribute name="department">
							<xsl:value-of select="string(@Department)"/>
						</xsl:attribute>
						<xsl:attribute name="crm_address_source">MediPort</xsl:attribute>
						<xsl:attribute name="crm_address_ident">
							<xsl:value-of select="string(floor(number(string(@ID))))"/>
						</xsl:attribute>
						<xsl:variable name="var1_resultof_vmf__Inputtoresult">
							<xsl:call-template name="vmf:vmf1_Inputtoresult">
								<xsl:with-param name="input" select="floor(number(string(@OrgRole)))"/>
							</xsl:call-template>
						</xsl:variable>
						<xsl:variable name="var2_resultof_vmf__Inputtoresult">
							<xsl:call-template name="vmf:vmf2_Inputtoresult">
								<xsl:with-param name="input" select="string(floor(number(string(@OrgType))))"/>
							</xsl:call-template>
						</xsl:variable>
						<xsl:attribute name="crm_address_groups_tree">
							<xsl:value-of select="concat($var1_resultof_vmf__Inputtoresult, $var2_resultof_vmf__Inputtoresult)"/>
						</xsl:attribute>
						<xsl:attribute name="countryid--sourcefield">shortdescra2</xsl:attribute>
						<xsl:attribute name="countryid">
							<xsl:value-of select="string(@Country)"/>
						</xsl:attribute>
						<xsl:attribute name="companyname">
							<xsl:value-of select="string(@Organisation)"/>
						</xsl:attribute>
						<xsl:attribute name="city">
							<xsl:value-of select="string(@City)"/>
						</xsl:attribute>
						<xsl:attribute name="bsvno">
							<xsl:value-of select="string(@BSV)"/>
						</xsl:attribute>
						<xsl:attribute name="adress">
							<xsl:value-of select="string(@Street)"/>
						</xsl:attribute>
					</crm_address_item>
				</xsl:for-each>
			</crm_address>
		</mlxmldata>
	</xsl:template>
</xsl:stylesheet>
