﻿<?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"
	version="1.0">

	<xsl:param name="category"></xsl:param>
	<xsl:param name="title"></xsl:param>
	<xsl:param name="path"></xsl:param>
	<xsl:param name="url"></xsl:param>
	<xsl:param name="items"></xsl:param>
	<xsl:param name="height"></xsl:param>
	<xsl:param name="citates"></xsl:param>
	<xsl:param name="limit" select="100"/>
	<xsl:param name="titleLimit" select="30"/>
	<xsl:strip-space elements="true"/>
	<xsl:output omit-xml-declaration="yes" />
	<xsl:variable name="apos" select='"&apos;"'/>

	<xsl:template match='//rs:data'>
		<h3 class="ms-standardheader ms-WPTitle'">
			<xsl:value-of select='@ows_LinkTitle' disable-output-escaping='yes'  />
		</h3>
		<table border='0' cellpadding='2' cellspacing='0' width='100%'>
			<tbody>
				<div class="wccNewsOneTwo">
					<xsl:apply-templates select='z:row'>
						<xsl:sort select="@ows_Datum" order="descending"/>
					</xsl:apply-templates>
				</div>
				<xsl:variable name="rows" select="z:row" />
				<xsl:if test="count($rows) &lt; 1">
					<div style="padding:10px;">Er zijn geen nieuwsberichten aanwezig in deze categorie.</div>
				</xsl:if>
			</tbody>
		</table>
	</xsl:template>

	<xsl:template match='z:row'>
		<xsl:if test="position() &lt; 3">
			<div class="wccNewsText"
			 onmouseover="this.className='wccNewsTextHover';" onmouseout="this.className='wccNewsText';">
				<xsl:attribute name="onclick">
					<xsl:value-of select="concat('document.location=', $apos, '/Lists/Nieuwsberichten/DispFormWindexCC.aspx?ID=', @ows_ID, '&amp;Source=', $path, $apos)" />
				</xsl:attribute>
				<xsl:choose>
					<xsl:when test="position() = 1">
						<xsl:attribute name="id">wccNewsOne</xsl:attribute>
					</xsl:when>
					<xsl:otherwise>
						<xsl:attribute name="id">wccNewsTwo</xsl:attribute>
					</xsl:otherwise>
				</xsl:choose>
				<xsl:value-of select='number(substring(@ows_Datum,9,2))'/>
				<xsl:variable name="mo">
					<xsl:value-of select='substring(@ows_Datum,6,2)'/>
				</xsl:variable>
				<xsl:choose>
					<xsl:when test="$mo = '01'"> januari </xsl:when>
					<xsl:when test="$mo = '02'"> februari </xsl:when>
					<xsl:when test="$mo = '03'"> maart </xsl:when>
					<xsl:when test="$mo = '04'"> april </xsl:when>
					<xsl:when test="$mo = '05'"> mei </xsl:when>
					<xsl:when test="$mo = '06'"> juni </xsl:when>
					<xsl:when test="$mo = '07'"> juli </xsl:when>
					<xsl:when test="$mo = '08'"> augustus </xsl:when>
					<xsl:when test="$mo = '09'"> september </xsl:when>
					<xsl:when test="$mo = '10'"> oktober </xsl:when>
					<xsl:when test="$mo = '11'"> november </xsl:when>
					<xsl:when test="$mo = '12'"> december </xsl:when>
				</xsl:choose>
				<xsl:value-of select='substring(@ows_Datum,1,4)'/>
				<br/>
				<span class="wccNewsHeader">
					<xsl:value-of select="@ows_LinkTitle"/>
				</span>
				<br />
				<div class="wccNewsBody">
					<xsl:value-of select="@ows_Body" disable-output-escaping="yes"/>
				</div>
			</div>
		</xsl:if>

		<xsl:if test="position() = 3 or position() = 4">
			<table width="100%"><tr><td>
			<div class="wccNewsText"
				 onmouseover="this.className='wccNewsTextHover';" onmouseout="this.className='wccNewsText';">
				<xsl:attribute name="onclick">
					<xsl:value-of select="concat('document.location=', $apos, '/Lists/Nieuwsberichten/DispFormWindexCC.aspx?ID=', @ows_ID, '&amp;Source=', $path, $apos)" />
				</xsl:attribute>
				<xsl:choose>
					<xsl:when test="position() = 3">
						<xsl:attribute name="id">wccNewsThree</xsl:attribute>
					</xsl:when>
					<xsl:otherwise>
						<xsl:attribute name="id">wccNewsFour</xsl:attribute>
					</xsl:otherwise>
				</xsl:choose>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td class="wccNewsTd1">
							<xsl:value-of select='number(substring(@ows_Datum,9,2))'/>
							<xsl:variable name="mo">
								<xsl:value-of select='substring(@ows_Datum,6,2)'/>
							</xsl:variable>
							<xsl:choose>
								<xsl:when test="$mo = '01'"> januari </xsl:when>
								<xsl:when test="$mo = '02'"> februari </xsl:when>
								<xsl:when test="$mo = '03'"> maart </xsl:when>
								<xsl:when test="$mo = '04'"> april </xsl:when>
								<xsl:when test="$mo = '05'"> mei </xsl:when>
								<xsl:when test="$mo = '06'"> juni </xsl:when>
								<xsl:when test="$mo = '07'"> juli </xsl:when>
								<xsl:when test="$mo = '08'"> augustus </xsl:when>
								<xsl:when test="$mo = '09'"> september </xsl:when>
								<xsl:when test="$mo = '10'"> oktober </xsl:when>
								<xsl:when test="$mo = '11'"> november </xsl:when>
								<xsl:when test="$mo = '12'"> december </xsl:when>
							</xsl:choose>
						</td>
						<td class="wccNewsTd2">
							<span class="wccNewsHeader">
								<xsl:value-of select="@ows_LinkTitle"/>
							</span>
						</td>
					</tr>
				</table>
			</div>
			</td></tr></table>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
