<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <xsl:output method="xml" indent="yes" encoding="utf-8" />
  <xsl:decimal-format name="european" decimal-separator="," grouping-separator="." />
  <xsl:param name="mode" />
  <xsl:variable name="Rev">
    <xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)" />
  </xsl:variable>
  <xsl:template match="facilitor">
  <xsl:for-each select="melding">
    <facilitor>
	  <xsl:choose>
	  <xsl:when test="@type='response'">
	    <xsl:copy-of select="."/>
	  </xsl:when>
	  <xsl:otherwise>
      <xsl:element name="melding">
        <xsl:attribute name="key">
          <xsl:value-of select="@key"/></xsl:attribute>
        <xsl:attribute name="type">insert</xsl:attribute>
        <datum>
          <xsl:value-of select="datum"/></datum>
        <melder>
          <xsl:value-of select="melder"/>
        </melder>
        <stdmelding>41</stdmelding>
        <omschrijving>
Melder:	<xsl:value-of select="melder"/>
Telefoonnummer:	<xsl:value-of select="telefoonnummer"/>
Emailadres:	<xsl:value-of select="emaildadres"/>
Kwis: <xsl:value-of select="kwis"/>
Vakgroep: <xsl:value-of select="vakgroep"/>
Melding: <xsl:value-of select="stdmelding1"/>
Melding2: <xsl:value-of select="stdmelding2"/>
Omschrijving: <xsl:value-of select="omschrijving"/>
Locatie: <xsl:value-of select="locatie"/>
Ruimte: <xsl:value-of select="ruimte"/>
		</omschrijving>
 		<xsl:element name="kenmerk">
 			<xsl:attribute name="naam">Werkbon/Opdracht nr. klant</xsl:attribute>
			<xsl:value-of select="@key"/>
		</xsl:element>
        <xsl:copy-of select="bijlagen"/>
      </xsl:element>
	  </xsl:otherwise>
	  </xsl:choose>
    </facilitor>
	</xsl:for-each>
  </xsl:template>


	<!-- Inpakken 'bon' in SOAP envelope
	     PutOrders voegt de tag SOAPEnvelope toe roept vervolgens deze stylesheet aan -->
	<xsl:template match="SOAPEnvelope">
		<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
			<soap:Body>
        <xsl:copy-of select="./node()"/>				
			</soap:Body>
		</soap:Envelope>
	</xsl:template>


	<!-- Uitpakken SOAP envelope -->
	<xsl:template match="soap:Envelope">
		<soapResult>
			<xsl:copy-of select="soap:Body/node()"/>
		</soapResult>
	</xsl:template>

	<!-- Decoderen XML response -->
	<xsl:template match="soapResult">
		<Result>
			<xsl:choose>
		  	<xsl:when test="facilitor/melding/returncode = 0"></xsl:when>
				<xsl:otherwise>
			  Foutmelding:<xsl:value-of select="facilitor/melding/returncode"/> - <xsl:value-of select="facilitor/melding/returntekst"/>
			</xsl:otherwise>
			</xsl:choose>
		</Result>
	</xsl:template>


 
</xsl:stylesheet>
<!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. -->