<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="html" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
          media-type="application/html" encoding="utf-8" omit-xml-declaration="yes" indent="no"/>
          
<xsl:template match="/">
    <span id="newsTitle">NEWS</span>
    <ul>
        <xsl:apply-templates select="news/item[@visible=1]/content[@lang='en']">
			<xsl:sort select="position()" data-type="number" order="descending"/>
	    </xsl:apply-templates>
	    
        <li class="news_title">
        	<a><xsl:attribute name="href"><xsl:value-of select="news/@link" /></xsl:attribute>more news...</a>
        </li>
    </ul>
</xsl:template>

<xsl:template match="content">
    <xsl:variable name="noOfItems" select="../../@noOfVisibleItems" />
    
    <xsl:if test="not(position() > $noOfItems)">
    <li class="news_title">
        <a>
        	<xsl:attribute name="href"><xsl:value-of select="../@link" /></xsl:attribute>
            <xsl:value-of select="short_title" />
        </a>
        <br/>
        <span class="news_date"><xsl:value-of select="../@date" /></span>
    </li>
    </xsl:if>
</xsl:template>

</xsl:stylesheet> 