<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:rs='urn:schemas-microsoft-com:rowset'
 	xmlns:z='#RowsetSchema'
	xmlns:date="http://www.ora.com/XSLTCookbook/NS/dates"
    xml:space="default" 
    xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" 
	version="1.0">

	<xsl:strip-space elements="true" />
	<xsl:output omit-xml-declaration="yes" />
	<xsl:param name="path"></xsl:param>
	<xsl:param name="url"></xsl:param>
	<xsl:param name="item"></xsl:param>

	<xsl:template match='//rs:data'>
		<link rel="stylesheet" type="text/css" href="/xslt/adverteerder.css"/>
		<div id="adverteerder">
			<xsl:apply-templates select="*[@ows_Code = $item]" mode='main' />
		</div>
	</xsl:template>

	<xsl:template match='*' mode="main">
		<xsl:choose>
			<xsl:when test="@ows_Pagina = 1">
				<div class="adverteerder-detail">
					<h1><xsl:value-of select="@ows_LinkTitle" disable-output-escaping="yes"/></h1>
					<div class="intro"><xsl:value-of select="@ows_Inleiding" disable-output-escaping="yes"/></div>
					<div class="main"><xsl:value-of select="@ows_Hoofdtekst" disable-output-escaping="yes"/></div>
				</div>
				<div class="adverteerder-marge">
					<div class="image">
						<img>
							<xsl:attribute name="src">/advertentielogo/<xsl:value-of select="@ows_Logo" disable-output-escaping="yes" /></xsl:attribute>
						</img>
					</div>
					<xsl:value-of select="@ows_Contact" disable-output-escaping="yes"/>
				</div>
			</xsl:when>
			<xsl:otherwise>Van deze adverteerder zijn (nog) geen gegevens beschikbaar...</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template name="cleanup">
		<xsl:param name="text"/>
		<xsl:choose>
			<xsl:when test="contains($text, '_')">
				<xsl:value-of select="substring-after($text,'_')"></xsl:value-of>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$text"></xsl:value-of>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>

</xsl:stylesheet>