﻿<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="limit" select="100"/>
    <xsl:param name="titleLimit" select="30"/>
    <xsl:strip-space elements="true"/>
    <xsl:output omit-xml-declaration="yes" />
    <xsl:variable name="apos">&apos;</xsl:variable>

    <xsl:template match='//rs:data'>
        <table border="0" cellpadding="0" cellspacing="0" width="448" style="position: relative; top: -36px;">
            <tr>
                <td>
                    <xsl:apply-templates select='z:row'>
                        <xsl:sort select="@ows_Datum" order="ascending"/>
                    </xsl:apply-templates>
                    <xsl:variable name="rows" select="z:row" />
                    <xsl:if test="count($rows) &lt; 1">
                        <div class="wccNewsText">
                            Er zijn geen nieuwsberichten aanwezig in deze categorie.
                        </div>
                    </xsl:if>
                </td>
            </tr>
        </table>
    </xsl:template>

    <xsl:template match='z:row'>
        <xsl:variable name="link">
            <xsl:value-of select="substring-before(@ows_Link, ',')"/>
        </xsl:variable>
        <xsl:variable name='omenom'>
            <xsl:choose>
                <xsl:when test="position() mod 2 = 1">right</xsl:when>
                <xsl:otherwise>left</xsl:otherwise>
            </xsl:choose>
        </xsl:variable>
        <div>
            <table class="wccNewsBannerHome" height="99" width="448">
                <xsl:attribute name="style">
                    <xsl:value-of select="concat('position: absolute; background-position: ', $omenom, '; background-image: url(', $apos, substring-before(@ows_Afbeelding, ','), $apos, '); background-repeat: no-repeat;')"/>
                </xsl:attribute>
                <tr>
                    <td width="99"></td>
                    <td heigth="99" width="250" valign="middle">
                        <a class="wccNewsHeader">
                        	<xsl:if test="$link != ''">
                        		<xsl:attribute name="style">cursor: pointer</xsl:attribute>
	                            <xsl:attribute name="onclick">
	                                <xsl:choose>
	                                    <xsl:when test="@ows_Openen_x0020_in_x0020_nieuw_x002 = 1">
	                                        <xsl:value-of select="concat('window.open(', $apos, $link, $apos, ')')"/>
			                            </xsl:when>
	                                    <xsl:otherwise>
	                                        <xsl:value-of select="concat('window.location = ', $apos, $link, $apos)"/>
			                            </xsl:otherwise>
	                                </xsl:choose>
	                            </xsl:attribute>
                        	</xsl:if>
                            <xsl:value-of select='@ows_LinkTitle'/>
                        </a>
                    </td>
                    <td width="99"></td>
                </tr>
            </table>
        </div>
        <img src="/_layouts/images/void.gif" height="56"/>
    </xsl:template>
</xsl:stylesheet>
