<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:template match="/">
		<html>
			<head>
				<title>
					<xsl:value-of select="Log/@LogonName" /> - Message Log
				</title>
			</head>
			<body>
				<h2 style="font-family:Arial;">Message Log for
				 <span style="color: #339933"><xsl:value-of select="Log/@LogonName" /></span>
				</h2>
				<p><div id="cstart" style="font-family: tahoma; font-size: 110%; color: #ffffff;
						background-color: #545454; border: 2px solid #000000; padding: 0.2%;">
				Conversation started
				<xsl:value-of select="Log/Message/@Date"/> at <xsl:value-of select="Log/Message/@Time"/>
				</div></p>
				
				<xsl:for-each select="Log/Message">
					<xsl:if test="(preceding-sibling::Message[position()=1]/@SessionID != @SessionID)">
						<p><div id="cstart" style="font-family: tahoma; font-size: 110%; color: #ffffff;
						background-color: #545454; border: 2px solid #000000; padding: 0.2%;">
						Conversation started
						<xsl:value-of select="@Date"/> at <xsl:value-of select="@Time"/>
						</div></p>
					</xsl:if>

					<span style="font-family: MS Shell Dlg; color: #545454;">
					<xsl:value-of select="From/User/@FriendlyName"/> says:
					</span>
						<div style="margin-left: 1.5%;"><span>
						<xsl:attribute name="style">
							<xsl:value-of select="Text/@Style"/>
						</xsl:attribute>
						<xsl:value-of select="Text"/>
					</span></div>
				</xsl:for-each>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>
