<xsl:stylesheet version="1.0" 
	xmlns:date="http://exslt.org/dates-and-times"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="date">

<xsl:output omit-xml-declaration="yes" />

<xsl:param name="IsBlogOwner" />
<xsl:param name="RelativeUrl" />

<xsl:template match="/">
	<div class="comments">
		<h3>Links to this post</h3>
		<xsl:apply-templates select="rows/row"/>
	</div>
</xsl:template>

<xsl:template match="row">
	
	<div><xsl:attribute name="class"><xsl:choose><xsl:when test="position() mod 2 = 0">comments-author</xsl:when><xsl:otherwise>comments-visitor</xsl:otherwise></xsl:choose></xsl:attribute>
		<xsl:variable name="publishedDate" select="date:parseDate(Created, 'yyyy-MM-dd HH:mm:ss')"/><br/><br/>
		<xsl:choose>
			<xsl:when test="LinkbackType = 'Pingback'">
				<p>
					[...] <xsl:value-of select="LinkingPostExcerpt" disable-output-escaping="yes" /> [...]
				</p>	
				<br/>
				<span class="comments-intro">
					Pingback from 
						<a href="{substring-before(LinkingPost,',')}"><xsl:value-of select="BlogName"/></a>
					on <xsl:value-of select="date:format-date($publishedDate, 'dd MMM yyyy')"/>
				</span>			
			</xsl:when>
			<xsl:otherwise>
				<span class="comments-intro">
					<xsl:value-of select="substring-after(LinkingPost,', ')"/>
				</span>

				<p>
					<xsl:if test="PostExcerpt != ''">
						[...] <xsl:value-of select="LinkingPostExcerpt" disable-output-escaping="yes" /> [...]
					</xsl:if>						
				</p>
				
						
				<span class="linkbackdate">
					Trackback from 
						<a href="{substring-before(LinkingPost,',')}"><xsl:value-of select="BlogName"/></a>
					on <xsl:value-of select="date:format-date($publishedDate, 'dd MMM yyyy')"/>
				</span>
			</xsl:otherwise>
		</xsl:choose>
	</div><br/><br/>
</xsl:template>
</xsl:stylesheet>
