<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:output method="text" encoding="windows-1252" indent="yes"/>
	<xsl:decimal-format name="european" decimal-separator="," grouping-separator="."/>

	<xsl:variable name="Rev">
		<!-- Revision van deze did.xsl -->
		<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
	</xsl:variable>

	<!--xsl:template name="linebreaks">
		<xsl:param name="string"/>
		<xsl:choose>
			<xsl:when test="contains($string, '&#xA;')">
				<xsl:value-of select="substring-before($string, '&#xA;')"/>
				<br/>
				<xsl:call-template name="linebreaks">
					<xsl:with-param name="string" select="substring-after($string, '&#xA;')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$string"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template-->

	<xsl:template match="opdracht">
				<!-- Define - "brute force" - variable to determine dienst -->
				<xsl:variable name="afd4">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/parent/omschrijving"/>
				</xsl:variable>
				<xsl:variable name="afd3">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/omschrijving"/>
				</xsl:variable>
				<xsl:variable name="afd2">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/omschrijving"/>
				</xsl:variable>
				<xsl:variable name="afd1">
					<xsl:value-of select="melding/voor/afdeling/parent/omschrijving"/>
				</xsl:variable>
				<xsl:variable name="afd0">
					<xsl:value-of select="melding/voor/afdeling/omschrijving"/>
				</xsl:variable>
				<xsl:variable name="dienst">
					<xsl:choose>
						<xsl:when test="$afd4!=''">
							<xsl:value-of select="$afd4"/>
						</xsl:when>
						<xsl:when test="$afd3!=''">
							<xsl:value-of select="$afd3"/>
						</xsl:when>
						<xsl:when test="$afd2!=''">
							<xsl:value-of select="$afd2"/>
						</xsl:when>
						<xsl:when test="$afd1!=''">
							<xsl:value-of select="$afd1"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="$afd0"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="mobiel">
					<xsl:choose>
						<xsl:when test="melding/voor/mobiel!=''">
							<xsl:value-of select="melding/voor/mobiel"/>
						</xsl:when>
						<xsl:when test="melding/kenmerk[@naam='Telefoon mobiel']!=''">
							<xsl:value-of select="melding/kenmerk[@naam='Telefoon mobiel']"/>
						</xsl:when>
						<xsl:otherwise>onbekend</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<!-- Define - "brute force" - variables to determine/find ICT contactpersonen -->
				<xsl:variable name="lev0">
					<xsl:value-of select="melding/voor/afdeling/kenmerk[@key='1020']"/>
				</xsl:variable>
				<xsl:variable name="lev1">
					<xsl:value-of select="melding/voor/afdeling/parent/kenmerk[@key='1020']"/>
				</xsl:variable>
				<xsl:variable name="lev2">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/kenmerk[@key='1020']"/>
				</xsl:variable>
				<xsl:variable name="lev3">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/kenmerk[@key='1020']"/>
				</xsl:variable>
				<xsl:variable name="lev4">
					<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/parent/kenmerk[@key='1020']"/>
				</xsl:variable>
				<xsl:variable name="ictcp1">
					<xsl:choose>
						<xsl:when test="$lev0!=''">
							<xsl:value-of select="melding/voor/afdeling/kenmerk[@key='1020']"/>
						</xsl:when>
						<xsl:when test="$lev1!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/kenmerk[@key='1020']"/>
						</xsl:when>
						<xsl:when test="$lev2!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/kenmerk[@key='1020']"/>
						</xsl:when>
						<xsl:when test="$lev3!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/kenmerk[@key='1020']"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/parent/kenmerk[@key='1020']"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="ictcp2">
					<xsl:choose>
						<xsl:when test="$lev0!=''">
							<xsl:value-of select="melding/voor/afdeling/kenmerk[@key='1021']"/>
						</xsl:when>
						<xsl:when test="$lev1!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/kenmerk[@key='1021']"/>
						</xsl:when>
						<xsl:when test="$lev2!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/kenmerk[@key='1021']"/>
						</xsl:when>
						<xsl:when test="$lev3!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/kenmerk[@key='1021']"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/parent/kenmerk[@key='1021']"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="ictcp3">
					<xsl:choose>
						<xsl:when test="$lev0!=''">
							<xsl:value-of select="melding/voor/afdeling/kenmerk[@key='1022']"/>
						</xsl:when>
						<xsl:when test="$lev1!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/kenmerk[@key='1022']"/>
						</xsl:when>
						<xsl:when test="$lev2!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/kenmerk[@key='1022']"/>
						</xsl:when>
						<xsl:when test="$lev3!=''">
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/kenmerk[@key='1022']"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="melding/voor/afdeling/parent/parent/parent/parent/kenmerk[@key='1022']"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
				<xsl:variable name="melding">
					<xsl:choose>
						<xsl:when test="melding/stdmelding/omschrijving='Account derden aanvragen'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:when test="melding/stdmelding/omschrijving='Account derden opzeggen'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:when test="melding/stdmelding/omschrijving='Nieuwe medewerker'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:when test="melding/stdmelding/omschrijving='Opzeggen medewerker'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:when test="melding/stdmelding/omschrijving='Anti-RSI aanvragen'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:when test="melding/stdmelding/omschrijving='Draagbare werkplek aanvragen'">
							<xsl:value-of select="substring-before(omschrijving, '&#xD;&#xA;')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="melding/stdmelding/omschrijving"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:variable>
Facilitor#: <xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/>
Klant: <xsl:value-of select="melding/voor/oslogin"/>
E-mailadres klant: <xsl:value-of select="melding/voor/email"/>
Dienst klant: <xsl:value-of select="$dienst"/>
Afdeling klant: <xsl:value-of select="melding/voor/afdeling/naam6"/>
Telefoon klant: <xsl:value-of select="melding/voor/telefoonnr"/>
Mobiel klant: <xsl:value-of select="$mobiel"/>
Ingevoerd door: <xsl:value-of select="melding/tracking/track[code='MLDNEW']/user/naam_full"/>
ICT contactpersoon 1 klant: <xsl:value-of select="$ictcp1"/>
ICT contactpersoon 2 klant: <xsl:value-of select="$ictcp2"/>
ICT contactpersoon 3 klant: <xsl:value-of select="$ictcp3"/>
Geaccepteerd door: <xsl:value-of select="melding/tracking/track[code='MLDACP']/user/naam_full"/>
Gefiatteerd door: <xsl:value-of select="tracking/track[code='ORDFOK']/user/naam_full"/>
Vakgroep: <xsl:value-of select="melding/discipline/omschrijving"/>
Melding: <xsl:value-of select="$melding"/>&#xA0;-&#xA0;<xsl:value-of select="omschrijving"/>
				<!--table border="0" width="100%">
					<tr>
						<td>Facilitor#: <xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/><br/>
Klant: <xsl:value-of select="melding/voor/oslogin"/><br/>
E-mailadres klant: <xsl:value-of select="melding/voor/email"/><br/>
Dienst klant: <xsl:value-of select="$dienst"/><br/>
Afdeling klant: <xsl:value-of select="melding/voor/afdeling/naam6"/><br/>
Telefoon klant: <xsl:value-of select="melding/voor/telefoonnr"/><br/>
Mobiel klant: <xsl:value-of select="$mobiel"/><br/>
Ingevoerd door: <xsl:value-of select="melding/tracking/track[code='MLDNEW']/user/naam_full"/><br/>
ICT contactpersoon 1 klant: <xsl:value-of select="$ictcp1"/><br/>
ICT contactpersoon 2 klant: <xsl:value-of select="$ictcp2"/><br/>
ICT contactpersoon 3 klant: <xsl:value-of select="$ictcp3"/><br/>
Geaccepteerd door: <xsl:value-of select="melding/tracking/track[code='MLDACP']/user/naam_full"/><br/>
Gefiatteerd door: <xsl:value-of select="tracking/track[code='ORDFOK']/user/naam_full"/><br/>
Vakgroep: <xsl:value-of select="melding/discipline/omschrijving"/><br/>
Melding: <xsl:value-of select="$melding"/>&#xA0;-&#xA0;<xsl:call-template name="linebreaks"><xsl:with-param name="string" select="omschrijving"/></xsl:call-template>
						</td>
					</tr>
				</table-->
	</xsl:template>

	<xsl:template match="/">
		<xsl:apply-templates select="facilitor"/>
	</xsl:template>

	<xsl:template match="facilitor">
		<xsl:apply-templates select="opdracht"/>
	</xsl:template>
</xsl:stylesheet>
