﻿<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="report_common.xslt"/>
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes" media-type="text/html; charset=utf-8"/>

	<xsl:include href="report_antispam_presentation.xslt"/>
	<xsl:include href="report_antivirus_presentation.xslt"/>
	<xsl:include href="report_attachmentblocking_presentation.xslt"/>
	<xsl:include href="report_contentfilter_presentation.xslt"/>
	<xsl:include href="report_webthreatprotection_presentation.xslt"/>
	<xsl:include href="report_traffic_presentation.xslt"/>
  <xsl:include href="report_datalossprevetion_presentation.xslt"/>

  <xsl:variable name="localization"      select="document('localization.xml')/strings/group[@name='report']//string"/>
	<xsl:variable name="virus_type"        select="document('localization.xml')/strings/group[@name='virus_types']//string"/>
	<xsl:variable name="pr_content_filter" select="document('pr_status.xml')/pr/content_filtering"/>
  <xsl:variable name="pr_dlp_filter"     select="document('pr_status.xml')/pr/dlp_filtering"/>
	<xsl:variable name="pr_anti_spam"      select="document('pr_status.xml')/pr/anti_spam"/>
	<xsl:variable name="actions"           select="document('action_descriptions.xml')/action_description//action"/>
	<xsl:variable name="pr_ers"            select="document('pr_status.xml')/pr/ers"/>

	<xsl:template match="/">
		<html>
			<head>
				<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
				<title>Consolidated Report</title>
				<style>
          body 			{FONT-SIZE: 10px;COLOR: #000000;FONT-FAMILY: "Verdana", "Arial", "Helvetica", "sans-serif"; margin:0px; padding-top:0px; BACKGROUND-COLOR: #ffffff;}
          a:link			{COLOR: #000000;TEXT-DECORATION: underline;}
          a:visited		{COLOR: #000000;TEXT-DECORATION: underline;}
          a:hover			{COLOR: #ff0000;TEXT-DECORATION: none;}
          img				{BORDER: 0px;VERTICAL-ALIGN: middle;}
          td				{FONT-SIZE: 10px;COLOR: #000000;}
          .content-title 	{FONT-WEIGHT: bold;FONT-SIZE: 13px;COLOR: #333333;}
          .tableheader	{BORDER-TOP: #ffffff 1px solid;BORDER-LEFT: #ffffff 1px solid;BORDER-BOTTOM: #999999 1px solid;PADDING-LEFT: 5px;FONT-WEIGHT: bold;HEIGHT: 22px;COLOR: #5b593d;BACKGROUND-COLOR: #dddcc5;}
          .border			{BORDER: #666666 1px solid;}
          .grey			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;PADDING-BOTTOM: 1px;PADDING-TOP: 1px;BORDER-RIGHT: #ffffff 1px solid;BORDER-BOTTOM: #999999 1px solid;HEIGHT: 22px;BACKGROUND-COLOR: #d4d4d4;}
          .grey-end		{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;PADDING-BOTTOM: 1px;PADDING-TOP: 1px;BORDER-BOTTOM: #999999 1px solid;HEIGHT: 22px;BACKGROUND-COLOR: #d4d4d4;}
          .grey2			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;PADDING-BOTTOM: 1px;PADDING-TOP: 1px;BORDER-RIGHT: #ffffff 1px solid;BORDER-BOTTOM: #999999 1px solid;BORDER-TOP: #999999 1px solid;HEIGHT: 22px;BACKGROUND-COLOR: #d4d4d4;}
          .grey2-end		{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;PADDING-BOTTOM: 1px;PADDING-TOP: 1px;BORDER-BOTTOM: #999999 1px solid;BORDER-TOP: #999999 1px solid;HEIGHT: 22px;BACKGROUND-COLOR: #d4d4d4;}
          .data1			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;HEIGHT: 18;BACKGROUND-COLOR: #ffffff;}
          .data1b			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;HEIGHT: 18;BACKGROUND-COLOR: #ffffff;BORDER-RIGHT: #cccccc 1px solid;}
          .data2			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;HEIGHT: 18;BACKGROUND-COLOR: #ececdb;}
          .data2b			{PADDING-RIGHT: 3px;PADDING-LEFT: 3px;HEIGHT: 18;BACKGROUND-COLOR: #ececdb;BORDER-RIGHT: #cccccc 1px solid;}
        </style>
      </head>
      <body>
        <div align="center">
          <a name="top-of-page"/>
          <xsl:call-template name="report-banner"/>
          <table width="98%" border="0" cellspacing="0" cellpadding="0"  align="center">
            <xsl:call-template name="report-head">
              <xsl:with-param name="template_name" select="report/template_name"/>
            </xsl:call-template>
            <xsl:for-each select="//data">
              <tr>
                <td>
                  <a>
                    <xsl:attribute name="name">
                      <xsl:value-of select="./@name"/>
                    </xsl:attribute>
                  </a>
                </td>
              </tr>
              <tr>
                <td>
                  <xsl:apply-templates select="."/>
                </td>
              </tr>
              <tr>
                <td>
                  <xsl:call-template name="report-data-end"/>
                </td>
              </tr>
            </xsl:for-each>
            <xsl:call-template name="report-foot"/>
          </table>
        </div>
      </body>
    </html>
  </xsl:template>

  <!--|| TEMPLATE : report-banner || -->
  <xsl:template name="report-banner">
     <table width="98%" border="0" cellpadding="0" cellspacing="0">
      <tr>
      	<td height="44" width="530"><img src="../../images/ap_toplogo.gif"/></td>
    	<td height="44" width="100%" align="center"><img src="../../images/ap_topbg.gif" height="44" width="100%"/></td>
        <td height="44" width="100%" align="center"><img src="../../images/ap_topbg.gif" height="44" width="100%"/></td> 
     </tr></table>
  </xsl:template>

<!--|| TEMPLATE : report-head ||-->
	<xsl:template name="report-head">
		<xsl:param name="template_name"/>
		<a name="top-of-page"/>
		<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0">
				<tr><td class="content-title" height="25"><xsl:value-of select="$template_name"/></td>
					<td align="right">
						<div id="divToolbar"></div></td></tr>
				</table></td></tr>
		<tr><td height="1" background="../../images/dot.gif" style="background-position:center;background-repeat:repeat-x;"></td></tr>
		<tr><td height="10"></td></tr>
		<!--||Report Highlights||-->
		<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
				<tr><td class="tableheader" colspan="2">
						<xsl:value-of select="$localization[@name='report_highlights']"/></td></tr>
				<tr><td class="grey" width="30%">
						<xsl:value-of select="$localization[@name='description']"/></td>
					<td class="grey-end">
						<xsl:value-of select="$localization[@name='information']"/></td></tr>
				<tr><td class="data1b">
						<xsl:value-of select="$localization[@name='server_name']"/></td>
					<td class="data1">
						<xsl:value-of select="/report/server_FQDN"/></td></tr>
				<tr><td class="data2b">
						<xsl:value-of select="$localization[@name='date_generate']"/></td>
					<td class="data2">
						<xsl:call-template name="format_datetime_string"><xsl:with-param name="datetime_string" select="/report/generate_time"/></xsl:call-template></td></tr>
				<tr><td class="data1b">
						<xsl:value-of select="$localization[@name='date_from']"/></td>
					<td class="data1">
						<xsl:call-template name="format_datetime_string"><xsl:with-param name="datetime_string" select="/report/begin_time"/></xsl:call-template></td></tr>
				<tr><td class="data2b">
						<xsl:value-of select="$localization[@name='date_to']"/></td>
					<td class="data2">
						<xsl:call-template name="format_datetime_string"><xsl:with-param name="datetime_string" select="/report/end_time"/></xsl:call-template></td></tr>
				<tr><td class="data1b">
						<xsl:value-of select="$localization[@name='report_type']"/></td>
					<td class="data1">
						<xsl:call-template name="report-dataset-list"/></td></tr>
				</table></td></tr>
		<tr><td height="25" align="center"><a href="#top-of-page"><xsl:value-of select="$localization[@name='back_to_top']"/></a></td></tr>
		<!--||Table of Contents||-->
		<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
				<tr><td class="grey-end" colspan="2"><b><xsl:value-of select="$localization[@name='table_of_contents']"/></b></td></tr>
				<xsl:call-template name="report-data-list"/>
				</table></td></tr>
		<tr><td height="25" align="center"><a href="#top-of-page"><xsl:value-of select="$localization[@name='back_to_top']"/></a></td></tr>
	</xsl:template>


<!--|| TEMPLATE : report-foot ||-->
	<xsl:template name="report-foot">
	</xsl:template>


<!--|| TEMPLATE : report-data-end ||-->
	<xsl:template name="report-data-end">
		<tr><td height="25" align="center"><a href="#top-of-page"><xsl:value-of select="$localization[@name='back_to_top']"/></a></td></tr>
	</xsl:template>


<!--|| TEMPLATE : report-dataset-list ||-->
	<xsl:template name="report-dataset-list">
		<xsl:for-each select="/report//dataset">
			<xsl:value-of select="$localization[@name=current()/@name]"/>
			<xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if>
		</xsl:for-each>
	</xsl:template>


<!--|| TEMPLATE : report-data-list ||-->
	<xsl:template name="report-data-list">
		<xsl:for-each select="//dataset">
			<xsl:variable name="all-data" select="data"/>
			<xsl:if test="@name != 'SUMMARY_REPORT'">
				<tr>
					<td colspan="2" class="data2">
						<b><xsl:value-of select="$localization[@name=current()/@name]"/></b>
					</td>
				</tr>
			</xsl:if>
			<xsl:for-each select="./data">
				<xsl:if test="position() mod 2 = 1">
					<tr>
						<xsl:variable name="pos" select="position()"/>
						<td width="50%" class="data1b">
							<a><xsl:attribute name="href">#<xsl:value-of select="$all-data[$pos]/@name"/></xsl:attribute>
							<xsl:value-of select="$localization[@name=$all-data[$pos]/@name]"/></a></td>
						<td width="50%" class="data1">
							<a><xsl:attribute name="href">#<xsl:value-of select="$all-data[$pos+1]/@name"/></xsl:attribute>
							<xsl:value-of select="$localization[@name=$all-data[$pos+1]/@name]"/></a></td>
					</tr>
				</xsl:if>
			</xsl:for-each>
		</xsl:for-each>
	</xsl:template>


<!--*********************************************
 The report items template
**********************************************-->
<!--|| TEMPLATE : schema default template (render as heading and columns) ||-->
	<xsl:template match="schema">
			<thead>
				<tr>
					<td class="tableheader">
						<xsl:attribute name="colspan">
							<xsl:value-of select="@field_count"/>
						</xsl:attribute>
						<xsl:value-of select="$localization[@name=current()/../@name]"/>
					</td>
				</tr>
				<tr>
					<xsl:for-each select=".//field/@name">
						<td>
							<xsl:attribute name="class">grey<xsl:if test="position()=last()">-end</xsl:if></xsl:attribute>
							<xsl:attribute name="width"><xsl:value-of select="100 div last()"/>%</xsl:attribute>
							<xsl:choose>
								<xsl:when test="$localization[@name=current()]"><xsl:value-of select="$localization[@name=current()]"/></xsl:when>
								<xsl:otherwise><font color="red"><xsl:value-of select="."/></font></xsl:otherwise>
							</xsl:choose>
						</td>
					</xsl:for-each>
				</tr>
			</thead>
	</xsl:template>

	
<!--|| TEMPLATE : data default template ||-->
	<xsl:template match="data">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<xsl:apply-templates select="schema"/>
			<tbody>
				<xsl:for-each select="datarow">
					<xsl:variable name="col-style">
						<xsl:choose>
							<xsl:when test="position() mod 2 = 1">data1</xsl:when>
							<xsl:otherwise>data2</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<tr>
						<xsl:for-each select="@*">
							<td><xsl:attribute name="class"><xsl:value-of select="$col-style"/><xsl:if test="position()!=last()">b</xsl:if></xsl:attribute>
								<xsl:value-of select="."/></td>
						</xsl:for-each>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>





<!--******************************
	Specialized templates
*******************************-->
<!--|| TEMPLATE : chart data ||-->
	<xsl:template match="/report//dataset//data[starts-with(@render_info, 'chart.curve')]">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="grey-end"><b><xsl:value-of select="$localization[@name=current()/@name]"/></b></td></tr>
			</thead>
			<tbody>
				<tr>
					<td align="center"><img alt="data chart"><xsl:attribute name="src"><xsl:value-of select="concat(@name, '.png')"/></xsl:attribute></img></td>
				</tr>
			</tbody>
		</table>
	</xsl:template>


<!--|| TEMPLATE : syssummary-items ||-->
	<xsl:template match="data[@name='report_item_syssummary']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td colspan="2" class="tableheader"><xsl:value-of select="@name"/></td>
				</tr>
			</thead>
			<tbody>
				<xsl:for-each select="datarow[1]/@*">
					<tr>
						<td><xsl:value-of select="name(.)"/></td>
						<td><xsl:value-of select="."/></td>
					</tr>
				</xsl:for-each>
			</tbody>
		</table>
	</xsl:template>


<!--|| TEMPLATE : scan-summary items ||-->
	<xsl:template match="data[@name='report_item_scansummary']">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" class="border">
			<thead>
				<tr>
					<td class="tableheader" colspan="4"><xsl:value-of select="$localization[@name=current()/@name]"/></td>
				</tr>
				<tr>
					<td class="grey"     width="40%"><xsl:value-of select="$localization[@name='scanning_type']"/></td>
					<td class="grey"     width="15%" align="right"><xsl:value-of select="$localization[@name='detected']"/></td>
					<td class="grey-end" width="15%" align="right"><xsl:value-of select="$localization[@name='percentage']"/></td>
					<td class="grey-end"><xsl:text disable-output-escaping="yes">&amp;nbsp;</xsl:text></td>
				</tr>
			</thead>
			<tbody>
				<tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='total_security_riskes']"/></td>
					<td class="data2b" align="right">
						<xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@virus_detected_count + datarow/@spyware_detected_count"/></xsl:call-template></td>
					<td class="data2"  align="right"></td>
					<td class="data2"></td>
				</tr>
				
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='virus_detected_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@virus_detected_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@virus_detected_count"/>
							<xsl:with-param name="denominator" select="datarow/@virus_detected_count + datarow/@spyware_detected_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_security_riskes']"/></td>
				</tr>
				
				
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='virus_uncleanable_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@virus_uncleanable_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@virus_uncleanable_count"/>
							<xsl:with-param name="denominator" select="datarow/@virus_detected_count + datarow/@spyware_detected_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_security_riskes']"/></td>
				</tr>
				
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='spyware_detected_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@spyware_detected_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@spyware_detected_count"/>
							<xsl:with-param name="denominator" select="datarow/@virus_detected_count + datarow/@spyware_detected_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_security_riskes']"/></td>
				</tr>
				
				
				<tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='total_message_count']"/></td>
					<td class="data2b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data2"  align="right"></td>
					<td class="data2"></td>
				</tr>
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='attachment_blocked_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@attachment_blocked_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@attachment_blocked_count"/>
							<xsl:with-param name="denominator" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_messages']"/></td>
				</tr>
        <tr style="display:none">
					<td class="data2b"><xsl:value-of select="$localization[@name='total_message_count']"/></td>
					<td class="data2b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data2"  align="right"></td>
					<td class="data2"  align="right"></td>
				</tr>
				<xsl:if test="$pr_content_filter != 'FS_HIDE'">
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='content_filtered_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@content_filtered_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@content_filtered_count"/>
							<xsl:with-param name="denominator" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_messages']"/></td>
				</tr>
				</xsl:if>
        <xsl:if test="$pr_dlp_filter != 'FS_HIDE'">
          <tr>
            <td class="data1b">
              <xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
              <xsl:value-of select="$localization[@name='dlp_filtered_count']"/>
            </td>
            <td class="data1b" align="right">
              <xsl:call-template name="format_number">
                <xsl:with-param name="num" select="datarow/@dlp_filtered_count"/>
              </xsl:call-template>
            </td>
            <td class="data1"  align="right">
              <xsl:call-template name="format_percentage">
                <xsl:with-param name="numerator" select="datarow/@dlp_filtered_count"/>
                <xsl:with-param name="denominator" select="datarow/@total_message_count"/>
              </xsl:call-template>
            </td>
            <td class="data1">
              <xsl:value-of select="$localization[@name='of_total_messages']"/>
            </td>
          </tr>
        </xsl:if>
				<xsl:if test="$pr_anti_spam != 'FS_HIDE'">
				<xsl:variable name="spam_detected_count_exist"		select="boolean(datarow/@spam_detected_count)"/>
        <xsl:if test="$spam_detected_count_exist">
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='spam_detected_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@spam_detected_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@spam_detected_count"/>
							<xsl:with-param name="denominator" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_messages']"/></td>
				</tr>
				</xsl:if>
				<xsl:variable name="phish_detected_count_exist"		select="boolean(datarow/@phish_detected_count)"/>
        <xsl:if test="$phish_detected_count_exist">
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='phish_detected_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@phish_detected_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@phish_detected_count"/>
							<xsl:with-param name="denominator" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_messages']"/></td>
				</tr>
				</xsl:if>
        <xsl:variable name="false_positive_count_exist"		select="boolean(datarow/@false_positive_count)"/>
        <xsl:if test="$false_positive_count_exist">
				<tr>
					<td class="data1b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='false_positive_count']"/></td>
					<td class="data1b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@false_positive_count"/></xsl:call-template></td>
					<td class="data1"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@false_positive_count"/>
							<xsl:with-param name="denominator" select="datarow/@spam_detected_count"/></xsl:call-template></td>
					<td class="data1"><xsl:value-of select="$localization[@name='of_total_spams']"/></td>
				</tr>
        </xsl:if>
        <xsl:if test="$pr_ers != 'FS_HIDE'">
        <xsl:variable name="ers_count_exist"		select="boolean(datarow/@ers_count)"/>
        <xsl:if test="$ers_count_exist">
				<tr>
					<td class="data2b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='ers_count']"/></td>
					<td class="data2b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@ers_count"/></xsl:call-template></td>
					<td class="data2"  align="right"></td>
					<td class="data2"></td>
				</tr>
				</xsl:if>
				</xsl:if>
				</xsl:if>
				<xsl:variable name="suspicious_url_count_exist"		select="boolean(datarow/@url_detected_count)"/>
				<xsl:if test="$suspicious_url_count_exist">
				    <tr>
					<td class="data2b"><xsl:text disable-output-escaping="yes">&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</xsl:text>
						<xsl:value-of select="$localization[@name='url_detected_count']"/></td>
					<td class="data2b" align="right"><xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@url_detected_count"/></xsl:call-template></td>
					<td class="data2"  align="right">
						<xsl:call-template name="format_percentage">
							<xsl:with-param name="numerator" select="datarow/@url_detected_count"/>
							<xsl:with-param name="denominator" select="datarow/@total_message_count"/></xsl:call-template></td>
					<td class="data2"><xsl:value-of select="$localization[@name='of_total_messages']"/></td>
				    </tr>
				</xsl:if>
				<tr>
					<td class="data2b"><xsl:value-of select="$localization[@name='total_unscannable_entity_count']"/></td>
					<td class="data2b" align="right">
						<xsl:call-template name="format_number"><xsl:with-param name="num" select="datarow/@unscannable_entity_count"/></xsl:call-template></td>
					<td class="data2"  align="right"></td>
					<td class="data2"></td>
				</tr>
			</tbody>
		</table>
	</xsl:template>


</xsl:stylesheet>
