<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:simple="http://my.netscape.com/rdf/simple/0.9/" xmlns:rss="http://purl.org/rss/1.0/"
	xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:atom="http://purl.org/atom/ns#"
	xmlns:atom1="http://www.w3.org/2005/Atom" xmlns:foaf="http://xmlns.com/foaf/0.1/"
	xmlns:admin="http://webns.net/mvcb/" xmlns:icbm="http://postneo.com/icbm"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	xmlns:enc="http://purl.oclc.org/net/rss_2.0/enc#"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:unic="http://www.uni-c.dk/namespace/">
	<xsl:output method="html"/>
	
	<xsl:param name="ListSize" select="10"/>
	
	<xsl:template match="/">
		<xsl:apply-templates select="/rdf:RDF[rss:channel or simple:channel]"/>
		<xsl:apply-templates select="/rss[@version]/channel"/>
		<xsl:apply-templates select="/redirect/newLocation"/>
		<xsl:apply-templates select="/atom:feed[@version='0.3']"/>
		<xsl:apply-templates select="/atom1:feed"/>
	</xsl:template>
	
	<xsl:template match="rss/channel">
		<xsl:call-template name="listItem"/>
	</xsl:template>
	
	<xsl:template match="/atom:feed|/atom1:feed">
		<div class="box norm">
			<h4 class="box-first-h"> Atom </h4>
			<p> Visning kun muligt med Uni-C RSS-feeds </p>
		</div>
	</xsl:template>
	
	<xsl:template match="/rdf:RDF">
		<div class="box norm">
			<h4 class="box-first-h"> RDF </h4>
			<p> Visning kun muligt med Uni-C RSS-feeds </p>
		</div>
	</xsl:template>
	
	<!--#####################      FUNCTION 	#####################-->
	<xsl:template name="listItem">
		<xsl:for-each select="item">
			<xsl:if test="$ListSize >= position()">
				<div class="box cald">
					<div class="box-i">
						<h4 class="box-first-h dt">
							<xsl:element name="abbr">
								<xsl:attribute name="class">dtstart</xsl:attribute>
								<xsl:attribute name="title"><xsl:call-template name="listUnicFdate1"
								/>T000000Z</xsl:attribute>
								<xsl:element name="span">
									<xsl:attribute name="class">dtstart</xsl:attribute>
									<xsl:attribute name="title"><xsl:call-template
										name="listUnicFdate1"/>T000000Z</xsl:attribute>
									<xsl:call-template name="listUnicFdate2"/>
								</xsl:element>
							</xsl:element> &#160;-&#160; <xsl:element name="abbr">
								<xsl:attribute name="class">dtstart</xsl:attribute>
								<xsl:attribute name="title"><xsl:call-template name="listUnicTdate1"
								/>T000000Z</xsl:attribute>
								<xsl:element name="span">
									<xsl:attribute name="class">dtstart</xsl:attribute>
									<xsl:attribute name="title"><xsl:call-template
										name="listUnicTdate1"/>T000000Z</xsl:attribute>
									<xsl:call-template name="listUnicTdate2"/>
								</xsl:element>
							</xsl:element>
						</h4>
						<h5 class="inline summary">
							<a href="{link}">
								<xsl:value-of select="title" disable-output-escaping="yes"/>
							</a>
						</h5>
						<br/>
						<xsl:choose>
							<xsl:when test="count(./content:encoded) > 0">
								<xsl:value-of select="content:encoded" disable-output-escaping="yes"
								/>
							</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="description" disable-output-escaping="yes"/>
							</xsl:otherwise>
						</xsl:choose>
						<p class="box-f">
							<a href="{link}" title="{title}"
								>Read&#160;more&#160;...</a>
						</p>
					</div>
				</div>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>
	
	<!--#####################      FUNCTION 	#####################-->
	<xsl:template name="listUnicFdate1">
		<xsl:variable name="fdate1">
			<xsl:for-each select="unic:news">
				<xsl:value-of select="@fdate"/>
			</xsl:for-each>
		</xsl:variable>
		<xsl:value-of select="$fdate1"/>
	</xsl:template>
	
	<!--#####################      FUNCTION 	#####################-->
	<xsl:template name="listUnicFdate2">
		<xsl:variable name="fdate1">
			<xsl:for-each select="unic:news">
				<xsl:value-of select="@fdate"/>
			</xsl:for-each>
		</xsl:variable>
		<xsl:variable name="year" select="substring($fdate1, 1, 4)"/>
		<xsl:variable name="month" select="substring($fdate1, 5, 2)"/>
		<xsl:variable name="day" select="substring($fdate1, 7, 2)"/>
		<xsl:value-of select="$day"/><xsl:text>/</xsl:text><xsl:value-of select="$month"
		/>&#160;<xsl:value-of select="$year"/>
	</xsl:template>
	
	<!--#####################      FUNCTION 	#####################-->
	<xsl:template name="listUnicTdate1">
		<xsl:variable name="tdate1">
			<xsl:for-each select="unic:news">
				<xsl:value-of select="@tdate"/>
			</xsl:for-each>
		</xsl:variable>
		<xsl:value-of select="$tdate1"/>
	</xsl:template>
	
	<!--#####################      FUNCTION 	#####################-->
	<xsl:template name="listUnicTdate2">
		<xsl:variable name="tdate1">
			<xsl:for-each select="unic:news">
				<xsl:value-of select="@tdate"/>
			</xsl:for-each>
		</xsl:variable>
		<xsl:variable name="year" select="substring($tdate1, 1, 4)"/>
		<xsl:variable name="month" select="substring($tdate1, 5, 2)"/>
		<xsl:variable name="day" select="substring($tdate1, 7, 2)"/>
		<xsl:value-of select="$day"/><xsl:text>/</xsl:text><xsl:value-of select="$month"
		/>&#160;<xsl:value-of select="$year"/>
	</xsl:template>
</xsl:stylesheet>

