<?xml version="1.0" encoding="Windows-1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>

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

<xsl:template match="/">MSG_TYPE;OPDRACHTNR;EXTERNNR;ACTIE;ACTIEDATUM;STATUS;SOORT_CALL;CATEGORIE;SUBCATEGORIE;
<xsl:for-each select="incident">
<xsl:variable name="opdrachtspatie"><xsl:value-of select="substring-after(korte_omschrijving, 'Facilitor opdracht: Opdracht nr.')"/> x</xsl:variable>
<xsl:variable name="opdrachtnummer"><xsl:value-of select="substring-before($opdrachtspatie, ' ')"/></xsl:variable>
<xsl:variable name="tekst_oms"><xsl:call-template name="StrReplace"><xsl:with-param name="string" select="actie"/><xsl:with-param name="str1" select="'&#13;&#10;'"/><xsl:with-param name="str2" select="'%%0A'"/></xsl:call-template></xsl:variable>
<xsl:variable name="tekst_800">&quot;<xsl:call-template name="escape_quote"><xsl:with-param name="string" select="substring($tekst_oms,1,800)"/></xsl:call-template>&quot;</xsl:variable>
<xsl:choose>
<xsl:when test="afgemeld='Ja' or afgemeld='Yes'">AFM;<xsl:value-of select="$opdrachtnummer"/>;<xsl:value-of select="incidentnummer"/>;<xsl:value-of select="$tekst_800"/>;<xsl:value-of select="datum_afgemeld"/>;<xsl:value-of select="status"/>;<xsl:value-of select="Soort_call"/>;<xsl:value-of select="Categorie"/>;<xsl:value-of select="Subcategorie"/>
</xsl:when>
<xsl:otherwise>UPD;<xsl:value-of select="$opdrachtnummer"/>;<xsl:value-of select="incidentnummer"/>;<xsl:value-of select="$tekst_800"/>;<xsl:value-of select="datum_aangemeld"/>;<xsl:value-of select="status"/>;<xsl:value-of select="Soort_call"/>;<xsl:value-of select="Categorie"/>;<xsl:value-of select="Subcategorie"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
	</xsl:template>

	<xsl:template name="StrReplace">
    <xsl:param name="string"/>
    <xsl:param name="str1"/>
    <xsl:param name="str2"/>
    <xsl:choose>
      <xsl:when test="contains($string, $str1)">
        <xsl:value-of select="substring-before($string, $str1)"/><xsl:value-of select="$str2"/>
        <xsl:call-template name="StrReplace">
          <xsl:with-param name="string" select="substring-after($string, $str1)"/>
          <xsl:with-param name="str1" select="$str1"/>
					<xsl:with-param name="str2" select="$str2"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$string"/>
      </xsl:otherwise>
    </xsl:choose>
  </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. --><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. -->