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

	<xsl:template match="VIEW-CONTENT">
		<xsl:apply-templates select="LOG-DETAILS-CONTAINER"/>
	</xsl:template>

	<xsl:template match="LOG-DETAILS-CONTAINER">
		<fieldset class="sb-toolbar-fieldset">
			<legend class="sb-label-toolbar-title"><xsl:value-of select="@TITLE"/></legend>
			
			<table width="100%" cellpadding="5" cellspacing="0" border="0">
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='creationDate']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='level']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='logSourceId']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='userName']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='ip']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='requestUri']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='referer']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='userAgent']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
				
				<tr>
					<td>
						<xsl:apply-templates select="CONTROL[@NAME='message']" mode="TITLE-LEFT">
							<xsl:with-param name="controlClass">sb-label</xsl:with-param>
							<xsl:with-param name="titleStyle">font-weight: bold;</xsl:with-param>
						</xsl:apply-templates>
					</td>
				</tr>
			</table>	
					
		</fieldset>		
	</xsl:template>
	
	<xsl:template name="nl2br">
		<xsl:param name="string"/>
		<xsl:value-of select="normalize-space(substring-before($string,'&#10;'))" disable-output-escaping="yes"/>
		<xsl:choose>
			<xsl:when test="contains($string,'&#10;')">
				<br />
				<xsl:call-template name="nl2br">
					<xsl:with-param name="string" select="substring-after($string,'&#10;')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$string" disable-output-escaping="yes"/>
				<!--xsl:copy-of select="$string"/-->
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
	
</xsl:stylesheet>
