<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" version="1.0">
	<xsl:output method="xml" encoding="utf-8" indent="yes"/>
	<xsl:decimal-format name="european" decimal-separator="." grouping-separator=","/>
	<xsl:param name="mode"/>
	<xsl:variable name="Rev">
		<!-- Revision van deze xsl -->
		<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
	</xsl:variable>


	<xsl:template match="melding">
		<xsl:for-each select="tracking/track">
			<xsl:if test="datum/timestamp &gt; //facilitor/getinfo/begintimestamp and datum/timestamp &lt; //facilitor/getinfo/eindtimestamp">
				<xsl:if test="../../melder/key = 5">
				<xsl:element name="opdracht">
					<xsl:attribute name="key">
						<xsl:value-of select="../../externnr"/>
					</xsl:attribute>
					<xsl:attribute name="type">update</xsl:attribute>

					<xsl:element name="status">
						<xsl:choose>
							<xsl:when test="code = 'MLDACP'">ORDACP</xsl:when>
							<xsl:when test="code = 'MLDAFM'">ORDAFM</xsl:when>
							<xsl:when test="code = 'MLDREJ'">ORDCAN</xsl:when>
						</xsl:choose>
					</xsl:element>
					<xsl:element name="mut_datum">
						<xsl:value-of select="concat(datum/jaar,'-', datum/maand ,'-', datum/dag, ' ', datum/tijd)"/>
					</xsl:element>
					<xsl:element name="opmerking">
						<xsl:value-of select="../../opmerking"/>
					</xsl:element>
				</xsl:element>
				</xsl:if>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>

	<!-- envelope met daarin de gewenste 'payload' -->
	<xsl:template match="facilitor">
		<facilitor>
			<xsl:apply-templates select="melding"/>
		</facilitor>
	</xsl:template>

	<!-- Root -->
	<xsl:template match="/">
		<xsl:apply-templates select="facilitor"/>
	</xsl:template>
</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\TEMP\AAITmelding22083.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->