<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	
	<!-- xslt setup -->
	
	<xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
	<xsl:strip-space elements="whisper"/>
	
	<!-- param -->
	
	<xsl:param name="timestamp">0</xsl:param>
	
	<!-- ignore -->
	
	<xsl:template match="text()"/>
	
	<!-- main template -->
	
	<xsl:template match="index">
		<main>
			<xsl:apply-templates select="whisper[@timestamp > $timestamp]">
				<xsl:sort select="@timestamp" order="ascending"/>
			</xsl:apply-templates>
		</main>
	</xsl:template>

	<xsl:template match="whisper">
		<div data-username="{ @username }" data-timestamp="{ @timestamp }" data-lifespan="{ @lifespan }" class="level-01">
			<div><xsl:value-of select="@username"/></div>
			<div class="content"><xsl:value-of select="."/></div>
		</div>
	</xsl:template>
</xsl:stylesheet>