<?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" encoding="Windows-1252"/>

<xsl:variable name="new_line" select="'&#xA;'"/>

	<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="/">
<xsl:if test="FACILITOR/PCHD/PERSLID">AFDELINGSCODE;PERSOONACHTERNAAM;TUSSENVOEGSEL;VOORLETTERS;VOORNAAM;TITEL_AANHEF;TELEFOONNUMMER;MOBIEL;EMAIL;APIKEY;FUNCTIE;PERSONEELSNUMMER;LOGINNAAM;GESLACHT;DIENSTVERBAND<xsl:value-of select="$new_line"/></xsl:if>
<xsl:for-each select="FACILITOR/PCHD/PERSLID">
<xsl:value-of select="PRS_AFDELING_NAAM"/>;<xsl:value-of select="PRS_PERSLID_NAAM"/>;<xsl:value-of select="PRS_PERSLID_TUSSENVOEGSEL"/>;<xsl:value-of select="PRS_PERSLID_VOORLETTERS"/>;<xsl:value-of select="PRS_PERSLID_VOORNAAM"/>;<xsl:value-of select="PRS_PERSLID_TITEL"/>;<xsl:value-of select="PRS_PERSLID_TELEFOONNR"/>;<xsl:value-of select="PRS_PERSLID_MOBIEL"/>;<xsl:value-of select="PRS_PERSLID_EMAIL"/>;<xsl:value-of select="PRS_PERSLID_APIKEY"/>;<xsl:value-of select="PRS_SRTPERSLID_OMSCHRIJVING"/>;<xsl:value-of select="PRS_PERSLID_NR"/>;<xsl:value-of select="PRS_PERSLID_OSLOGIN"/>;<xsl:value-of select="PRS_PERSLID_GESLACHT"/>;<xsl:value-of select="PRS_PERSLID_DIENSTVERBAND"/>;<xsl:value-of select="PRS_PERSLID_OSLOGIN2"/><xsl:value-of select="$new_line"/>
</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>
