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

<!-- Sector Dumps -->
  <xsl:output 
      method="html" 
      version="4.2" 
      encoding="UTF-8" 
      omit-xml-declaration="yes" 
      indent="yes"/>
   <xsl:template name="AddZeros">
    <xsl:param name="index" />
	<xsl:choose>
        <xsl:when test="string-length($index) = 1">
          <xsl:value-of select="concat('000000000000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 2">
          <xsl:value-of select="concat('00000000000000', $index)" />
        </xsl:when>
		<xsl:when test="string-length($index) = 3">
          <xsl:value-of select="concat('0000000000000', $index)" />
        </xsl:when>
		<xsl:when test="string-length($index) = 4">
          <xsl:value-of select="concat('000000000000', $index)" />
        </xsl:when>
		<xsl:when test="string-length($index) = 5">
          <xsl:value-of select="concat('00000000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 6">
          <xsl:value-of select="concat('0000000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 7">
          <xsl:value-of select="concat('000000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 8">
          <xsl:value-of select="concat('00000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 9">
          <xsl:value-of select="concat('0000000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 10">
          <xsl:value-of select="concat('000000', $index)" />
        </xsl:when>    
        <xsl:when test="string-length($index) = 11">
          <xsl:value-of select="concat('00000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 12">
          <xsl:value-of select="concat('0000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 13">
          <xsl:value-of select="concat('000', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 14">
          <xsl:value-of select="concat('00', $index)" />
        </xsl:when>
        <xsl:when test="string-length($index) = 15">
          <xsl:value-of select="concat('0', $index)" />
        </xsl:when>        
      </xsl:choose>
	</xsl:template>
	  
  <xsl:template name="ConvertDecToHex">
    <xsl:param name="index" />
	<xsl:param name="EntryCount" select="number(0)" />
	<xsl:choose>
        <xsl:when test="($index + $EntryCount) = 0">
          <xsl:value-of select="0" />
        </xsl:when>
        <xsl:otherwise>
	
	<xsl:if test="$index > 0">
    <xsl:call-template name="ConvertDecToHex">
        <xsl:with-param name="index" select="floor($index div 16)" />
    		<xsl:with-param name="EntryCount" select="number($EntryCount + 1)" />
    </xsl:call-template>
      <xsl:choose>
        <xsl:when test="$index mod 16 &lt; 10">
          <xsl:value-of select="$index mod 16" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:choose>
            <xsl:when test="$index mod 16 = 10">A</xsl:when>
            <xsl:when test="$index mod 16 = 11">B</xsl:when>
            <xsl:when test="$index mod 16 = 12">C</xsl:when>
            <xsl:when test="$index mod 16 = 13">D</xsl:when>
            <xsl:when test="$index mod 16 = 14">E</xsl:when>
            <xsl:when test="$index mod 16 = 15">F</xsl:when>
            <xsl:otherwise>A</xsl:otherwise>
          </xsl:choose>
        </xsl:otherwise>
      </xsl:choose>
	  </xsl:if >
	   </xsl:otherwise>
    </xsl:choose>
  </xsl:template>	

<xsl:template name="AlignHex2Dec">
    <xsl:param name="index"/>
	<xsl:param name="ShouldAddZeros"/>
    <xsl:variable name="firstHex">
                <xsl:call-template name="ConvertDecToHex">
			       <xsl:with-param name="index" select="number($index)"/>
		        </xsl:call-template>
            </xsl:variable>   
            0x<xsl:variable name="firstHexval">
				<xsl:choose>
				    <xsl:when test="$ShouldAddZeros='true'">
            <xsl:call-template name="AddZeros">
			    <xsl:with-param name="index" select="$firstHex" />
		    </xsl:call-template>    
					</xsl:when>
					<xsl:otherwise>
					    <xsl:value-of select="$firstHex" />
					</xsl:otherwise>
				</xsl:choose>
            </xsl:variable>
            <xsl:value-of select="$firstHexval" />
</xsl:template>

<xsl:template name="tokenize">
    <xsl:param name="text"/>
	<xsl:param name="currentRow"/>
	<xsl:variable name="currentRowHexValue">
		<xsl:call-template name="ConvertDecToHex">
			<xsl:with-param name="index" select="$currentRow" />
		</xsl:call-template>
	</xsl:variable>
	<xsl:variable name="currentRowHex">
		<xsl:call-template name="AddZeros">
			<xsl:with-param name="index" select="$currentRowHexValue" />
		</xsl:call-template>
	</xsl:variable>
	
    <xsl:choose>
		<xsl:when test="string-length($text) &lt; 1" />
        <xsl:when test="string-length($text) &lt; 47">
            <tr class="dump">
              <td align="center"><b>
		         <xsl:value-of select="$currentRowHex" />: </b>
              </td>
              <td>
				<xsl:value-of select="$text"/>
              </td>
			</tr>
        </xsl:when>
        <xsl:otherwise>
            <tr class="dump">
              <td align="center"><b>
				<xsl:value-of select="$currentRowHex" />:</b>
              </td>
              <td>
				<xsl:value-of select="substring($text, 1, 47)"/>
              </td>
			</tr>
            <xsl:call-template name="tokenize">
                <xsl:with-param name="text" select="substring($text, 49, string-length($text)-47)"/>
				<xsl:with-param name="currentRow" select="number($currentRow) + 16"/>
            </xsl:call-template>
        </xsl:otherwise>
    </xsl:choose>
</xsl:template>

<!-- Size formatting from bytes -->
<xsl:template name="format-bsize">
    <xsl:param name="StSize"/>
    <xsl:variable name="Size" select="number($StSize)"/>
         <xsl:choose>
             <xsl:when test="$Size >= (1024*1024*1024*1024)">
                 <xsl:value-of select="format-number($Size div (1024*1024*1024*1024), '#.00')"/> QT_TRANSLATE_NOOP("QObject", "TB")
             </xsl:when>
             <xsl:when test="$Size >= (1024*1024*1024) and $Size &lt; (1024*1024*1024*1024)">
             <xsl:value-of select="format-number($Size div (1024*1024*1024), '#.00')"/> QT_TRANSLATE_NOOP("QObject", "GB")
             </xsl:when>
             <xsl:when test="$Size >= (1024*1024) and $Size &lt; (1024*1024*1024)">
                 <xsl:value-of select="format-number($Size div (1024*1024), '#.00')"/> QT_TRANSLATE_NOOP("QObject", "MB")
             </xsl:when>
             <xsl:when test="$Size >= 1024 and $Size &lt; (1024*1024)">
                 <xsl:value-of select="format-number($Size div 1024, '#.00')"/> QT_TRANSLATE_NOOP("QObject", "KB")
             </xsl:when>
             <xsl:otherwise>
                 <xsl:value-of select="format-number($Size, '#.00')"/> QT_TRANSLATE_NOOP("QObject", "B")
             </xsl:otherwise>
         </xsl:choose>
</xsl:template>

<!-- Duration -->
<xsl:template name="format-duration">
    <xsl:param name="StDuration"/>
    <xsl:variable name="seconds" select="number($StDuration)"/>
        <xsl:variable name="days" select="floor($seconds div (24*3600))"/>
        <xsl:if test="$days > 0">
        <xsl:value-of select="format-number($days, '#')"/>.</xsl:if><xsl:value-of select="format-number(floor($seconds div (60*60)) mod 24, '00')"/>
        <xsl:value-of select="format-number(floor($seconds div 60) mod 60, ':00')"/>
        <xsl:value-of select="format-number($seconds mod 60, ':00')"/>
</xsl:template>

<!-- Wipe Date -->
<xsl:template name="format-wipedate">
    <xsl:param name="WipeDate"/>
    <xsl:value-of select="substring($WipeDate, 1, 10)"/>
</xsl:template>

<!--choose root node-->
<xsl:template match="/">

<html> 

<head>
<meta http-equiv="Content-Type" content="text/html;" />
<title>QT_TRANSLATE_NOOP("QObject", "Wipe report")</title>
   <style rel="stylesheet" type="text/css">
        h2 {
          margin-top: 0.83em;
          margin-bottom: 0.0em;
        }
        table {
          font-family: SegoeUI, 'Segoe UI', "Open Sans",Helvetica;
        }
		.dump {
		  line-height: 1.33;
		  font-family: monospace, courier; 
		  font-size: 12px; 
		  background: #f5f5f5
		}
    </style>
</head>

<body>

<table width="100%" border="0"> 
  
    <tr><td align="left" valign="center" colspan="2">
    <img src="logo.svg"></img>
	</td></tr>  
    <tr><td height="70" class="header" align="center" colspan="2"><h1 style="font-family:SegoeUI,Arial,Sans Serif;font-size:21.5pt;">QT_TRANSLATE_NOOP("QObject", "Data Sanitization Report")</h1></td></tr>
    <tr><td colspan="2"></td></tr>
    
    <tr><td colspan="2"><nobr><h2>QT_TRANSLATE_NOOP("QObject", "Customer Information")</h2></nobr></td></tr>
	<tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>   
   <tr>
        <td width="40%">QT_TRANSLATE_NOOP("QObject", "Person:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='CustomerName']"/></b></td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Company:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='CompanyName']"/></b></td>
    </tr>
	<tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Company address:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='CompanyAddress']"/></b></td>
    </tr>
    <tr><td colspan="2"></td></tr>
    
    
    <tr><td colspan="2"><h2>QT_TRANSLATE_NOOP("QObject", "Report Information")</h2></td></tr>
	<tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Status:")</td>
        <td>
            <xsl:variable name="Status" select="(/data/properties/property[@name='Status'])"/>
             <xsl:choose>
             <xsl:when test="$Status = 'Successful'">
                <font color="green"><b>QT_TRANSLATE_NOOP("QObject", "Successful")</b></font>
             </xsl:when>
              <xsl:when test="$Status = 'Failed'">
                 <font color="red"><b>QT_TRANSLATE_NOOP("QObject", "Failed")</b></font>
             </xsl:when>
             <xsl:otherwise>
                 <font color="orange"><b><xsl:value-of select="$Status"/></b></font>
             </xsl:otherwise>
            </xsl:choose>
        </td>
    </tr>
    <tr>
        <td><nobr>QT_TRANSLATE_NOOP("QObject", "Report date:")</nobr></td>
        <td>
             <b><xsl:call-template name="format-wipedate">
             <xsl:with-param name="WipeDate" select="/data/properties/property[@name='WipeDate']"/>
             </xsl:call-template></b>
        </td>
    </tr>
    <tr>
        <td><nobr>QT_TRANSLATE_NOOP("QObject", "Tool name:")</nobr></td>
        <td><b><xsl:value-of select="/data/properties/property[@name='ToolName']"/></b></td>
    </tr>
    <tr>
        <td><nobr>QT_TRANSLATE_NOOP("QObject", "Service tag:")</nobr></td>
        <td><b><xsl:value-of select="/data/properties/property[@name='ServiceTag']"/></b></td>
    </tr>
    <tr>
        <td><nobr>QT_TRANSLATE_NOOP("QObject", "Report ID:")</nobr></td>
        <td><b><xsl:value-of select="/data/properties/property[@name='ReportID']"/></b></td>
    </tr>
    <tr><td colspan="2"></td></tr>
    

	<xsl:variable name="IsincludeSystemInfo" select="(/data/properties/property[@name='includeSystemInfo'])"/>
	<xsl:choose>
	<xsl:when test="$IsincludeSystemInfo = 'true'">
    <tr><td colspan="2"><h2>QT_TRANSLATE_NOOP("QObject", "System Information")</h2></td></tr>
	<tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
    <xsl:if test="/data/properties/property[@name='SysInfoComputerName']">
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Computer name:")</td>
        <td>
             <b><xsl:value-of select="/data/properties/property[@name='SysInfoComputerName']"/></b>
        </td>
    </tr>
	</xsl:if>
	<xsl:if test="/data/properties/property[@name='SysInfoOsVersion']">
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Operating system:")</td>
        <td>
             <b><xsl:value-of select="/data/properties/property[@name='SysInfoOsVersion']"/></b>
        </td>
    </tr>
	</xsl:if>
	<xsl:if test="/data/properties/property[@name='SysInfoProductId']">
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Product ID:")</td>
        <td>
             <b><xsl:value-of select="/data/properties/property[@name='SysInfoProductId']"/></b>
        </td>
    </tr> 
	</xsl:if>
	<xsl:if test="/data/properties/property[@name='SysInfoBiosVersion']">
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "BIOS Version:")</td>
        <td>
             <b><xsl:value-of select="/data/properties/property[@name='SysInfoBiosVersion']"/></b>
        </td>
    </tr> 
	</xsl:if>
	<xsl:if test="/data/properties/property[@name='SysInfoBiosDate']">
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "BIOS Date:")</td>
        <td>
             <b><xsl:value-of select="/data/properties/property[@name='SysInfoBiosDate']"/></b>
        </td>
    </tr> 	
	</xsl:if>
    <tr><td colspan="2"></td></tr>
	</xsl:when>
	</xsl:choose>
	
	
    <tr><td colspan="2"><nobr><h2>QT_TRANSLATE_NOOP("QObject", "Wipe Information")</h2></nobr></td></tr>
    <tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
	<tr>
    <td>QT_TRANSLATE_NOOP("QObject", "Operation:")</td>
    <td>
        <xsl:variable name="FreeSpaceOnly" select="/data/properties/property[@name='FreeSpaceOnly']"/>
        <xsl:choose>
	    	<xsl:when test="$FreeSpaceOnly = 'No'">
               <b>QT_TRANSLATE_NOOP("QObject", "Wipe out all the data")</b>
            </xsl:when>
            <xsl:otherwise>
                <b>QT_TRANSLATE_NOOP("QObject", "Wipe free space")</b>
            </xsl:otherwise>
        </xsl:choose>    
    </td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Wipe object:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='WipeObject']"/></b></td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Serial number:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='SerialNumber']"/></b></td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Model number:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='ModelNumber']"/></b></td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Disk ID:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='DiskID']"/></b></td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Object size:")</td> 
        <td>
        <b><xsl:call-template name="format-bsize">
             <xsl:with-param name="StSize" select="/data/properties/property[@name='ObjectSize']"/>
        </xsl:call-template></b>
        </td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Start time:")</td>
        <td><b><xsl:value-of select="/data/properties/property[@name='StartTime']"/></b></td>
   </tr>
   <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Duration:")</td> 
        <td>
        <b><xsl:call-template name="format-duration">
             <xsl:with-param name="StDuration" select="/data/properties/property[@name='Duration']"/>
        </xsl:call-template></b>
        </td>
    </tr>
    <tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Wipe stamp:")</td> 
        <td>
             <xsl:variable name="WipeStamp" select="/data/properties/property[@name='SetWipeStamp']"/>
             <xsl:choose>
	    	 <xsl:when test="$WipeStamp = 'No'">
               <b>QT_TRANSLATE_NOOP("QObject", "Not created")</b>
            </xsl:when>
            <xsl:otherwise>
               <b>QT_TRANSLATE_NOOP("QObject", "Created")</b>
            </xsl:otherwise>
        </xsl:choose> 
        </td>
    </tr>
	<xsl:variable name="SystemID" select="/data/properties/property[@name='SystemID']"/>
    <xsl:choose>
    <xsl:when test="$SystemID != '' and /data/properties/property[@name='SystemID']">  
    <tr>           
                <td>QT_TRANSLATE_NOOP("QObject", "System ID:")</td>
                <td>
                    <b><xsl:value-of select="/data/properties/property[@name='SystemID']"/></b>
                </td>
    </tr>
	</xsl:when>
    </xsl:choose> 
    <tr><td colspan="2"></td></tr>


    <tr><td colspan="2"><h2>QT_TRANSLATE_NOOP("QObject", "Algorithm Information")</h2></td></tr>
    <tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
	<tr>
        <td><nobr>QT_TRANSLATE_NOOP("QObject", "Wipe method:")</nobr></td>
        <td><b><xsl:value-of select="/data/properties/property[@name='WipeMethod']"/></b></td>
    </tr>
	<xsl:variable name="PassCount" select="number(/data/properties/property[@name='PassCount'])"/>
    <xsl:choose>
    <xsl:when test="$PassCount != 0">
	<tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass count:")</nobr>
        </td>
        <td>
             <b><xsl:value-of select="$PassCount"/></b>
        </td>
    </tr>	
	</xsl:when>
    </xsl:choose>
	
 	
	<tr>
	    <td colspan="2">
<table width="50%" border="0"> 	
	<xsl:variable name="Mask1" select="number(/data/properties/property[@name='Mask1'])"/>
    <xsl:choose>
    <xsl:when test="$Mask1 &lt;256">
    <tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass:")</nobr> 
		</td>
        <td>		
			 <b><xsl:value-of select="/data/properties/property[@name='PassCount1']"/></b>
		</td>
        <td>		
			 <nobr>QT_TRANSLATE_NOOP("QObject", "Mask:")</nobr> 
		</td>
		<td>	 
			 <b><xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='Mask1']"/>
				<xsl:with-param name="ShouldAddZeros" select="'false'"/>
             </xsl:call-template></b>
        </td>	
    </tr>	
	</xsl:when>
    </xsl:choose>
	<xsl:variable name="Mask2" select="number(/data/properties/property[@name='Mask2'])"/>
    <xsl:choose>
    <xsl:when test="$Mask2 &lt;256">
	<tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass: ")</nobr> 
		</td>
        <td>		
			 <b><xsl:value-of select="/data/properties/property[@name='PassCount2']"/></b>
		</td>
        <td>		
			 <nobr>QT_TRANSLATE_NOOP("QObject", "    Mask: ")</nobr> 
		</td>
		<td>	 
			 <b><xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='Mask2']"/>
				<xsl:with-param name="ShouldAddZeros" select="'false'"/>
             </xsl:call-template></b>
        </td>
    </tr>
    </xsl:when>
    </xsl:choose>	
	<xsl:variable name="Mask3" select="number(/data/properties/property[@name='Mask3'])"/>
    <xsl:choose>
    <xsl:when test="$Mask3 &lt;256">
	<tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass: ")</nobr> 
		</td>
        <td>		
			 <b><xsl:value-of select="/data/properties/property[@name='PassCount3']"/></b>
		</td>
        <td>		
			 <nobr>QT_TRANSLATE_NOOP("QObject", "    Mask: ")</nobr> 
		</td>
		<td>	 
			 <b><xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='Mask3']"/>
				<xsl:with-param name="ShouldAddZeros" select="'false'"/>
             </xsl:call-template></b>
        </td>
    </tr>
	</xsl:when>
    </xsl:choose>
	<xsl:variable name="Mask4" select="number(/data/properties/property[@name='Mask4'])"/>
    <xsl:choose>
    <xsl:when test="$Mask4 &lt;256">
	<tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass: ")</nobr> 
		</td>
        <td>		
			 <b><xsl:value-of select="/data/properties/property[@name='PassCount4']"/></b>
		</td>
        <td>		
			 <nobr>QT_TRANSLATE_NOOP("QObject", "    Mask: ")</nobr> 
		</td>
		<td>	 
			 <b><xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='Mask4']"/>
				<xsl:with-param name="ShouldAddZeros" select="'false'"/>
             </xsl:call-template></b>
        </td>
    </tr>
    </xsl:when>
    </xsl:choose>	
</table></td></tr>


    <xsl:variable name="Mask1" select="number(/data/properties/property[@name='Mask1'])"/>	
	<xsl:variable name="GroupPasses" select="number(/data/properties/property[@name='GroupPasses'])"/>			
    <xsl:choose>
    <xsl:when test="$Mask1 &lt;256">
	<tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Pass count for the group of patterns: ")</nobr> 
        </td>
		<td>
			 <b><xsl:value-of select="/data/properties/property[@name='GroupPasses']"/></b>
		</td>
    </tr>
	</xsl:when>
    </xsl:choose>
	<xsl:variable name="VerifyPassesCount" select="number(/data/properties/property[@name='VerifyPassesCount'])"/>
    <xsl:choose>
    <xsl:when test="$VerifyPassesCount != 0">
    <tr>
        <td>
             <nobr>QT_TRANSLATE_NOOP("QObject", "Verify passes count:")</nobr>
        </td>
        <td>
             <b><xsl:value-of select="$VerifyPassesCount"/></b>
        </td>
    </tr>
	</xsl:when>
    </xsl:choose>
    <tr>
		<td><nobr>QT_TRANSLATE_NOOP("QObject", "Percentage of sectors to check:")</nobr></td>
        <td><b><xsl:value-of select="/data/properties/property[@name='PercentageOfSectorsToCheck']"/>%</b></td>            
    </tr>
    <tr><td colspan="2"></td></tr> 


    <tr><td colspan="2"><nobr><h2>QT_TRANSLATE_NOOP("QObject", "Bad Block Information")</h2></nobr></td></tr>
    <tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
	<tr>
        <td>QT_TRANSLATE_NOOP("QObject", "Total bad blocks:")</td>
         <td>
            <xsl:variable name="TotalBadBlocks" select="number(/data/properties/property[@name='TotalBadBlocks'])"/>
             <xsl:choose>
             <xsl:when test="$TotalBadBlocks = 0">
                <b>QT_TRANSLATE_NOOP("QObject", "No bad blocks found")</b>
             </xsl:when>
             <xsl:otherwise>
                 <b><xsl:value-of select="$TotalBadBlocks"/></b>
             </xsl:otherwise>
            </xsl:choose>
        </td>
    </tr>
</table>

<xsl:variable name="DumpNeeded" select="(/data/properties/property[@name='IsDumpNeeded'])"/>
<xsl:choose>
<xsl:when test="$DumpNeeded = 'true'">
<table> 
    <tr><td colspan="2"></td></tr>    
    <tr><td colspan="2"><nobr><h2>QT_TRANSLATE_NOOP("QObject", "Dump")</h2></nobr></td></tr>
    <tr><td colspan="2">
		<img src="line.svg" width="100" />
	</td></tr>
	<tr>
        <td><b>QT_TRANSLATE_NOOP("QObject", "First sector:")</b></td>
        <td>
            <xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='FirstSector']"/>
				<xsl:with-param name="ShouldAddZeros" select="'true'"/>
           </xsl:call-template>
        </td>
    </tr>
          <xsl:call-template name="tokenize">
	          <xsl:with-param name="text" select="/data/properties/property[@name='FirstSectorDump']"/>
	          <xsl:with-param name="currentRow" select="16"/>
           </xsl:call-template>
    <tr>
         <td><b>QT_TRANSLATE_NOOP("QObject", "Middle sector:")</b></td>
        <td>
            <xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='MiddleSector']"/>
				<xsl:with-param name="ShouldAddZeros" select="'true'"/>
           </xsl:call-template>
        </td>
    </tr>
           <xsl:call-template name="tokenize">
	          <xsl:with-param name="text" select="/data/properties/property[@name='MiddleSectorDump']"/>
	          <xsl:with-param name="currentRow" select="16"/>
           </xsl:call-template>
    <tr>
         <td><b>QT_TRANSLATE_NOOP("QObject", "End sector:")</b></td>
        <td>
            <xsl:call-template name="AlignHex2Dec">
                <xsl:with-param name="index" select="/data/properties/property[@name='EndSector']"/>
				<xsl:with-param name="ShouldAddZeros" select="'true'"/>
           </xsl:call-template>
        </td>
    </tr>
           <xsl:call-template name="tokenize">
	          <xsl:with-param name="text" select="/data/properties/property[@name='EndSectorDump']"/>
	          <xsl:with-param name="currentRow" select="16"/>
           </xsl:call-template>
</table>
</xsl:when>
</xsl:choose>

<xsl:variable name="SignatureNeeded" select="(/data/properties/property[@name='IsSignatureNeeded'])"/>
<xsl:choose>
<xsl:when test="$SignatureNeeded = 'true'">
<table  width="100%" border="0"> 
    <tr><td colspan="2"></td></tr>  
	
	<tr>
			<td colspan="2">
				<span style="margin-top: 50; display: block"><b>QT_TRANSLATE_NOOP("QObject", "Hereby is confirmed that the wipe operation has been carried out according to instructions given by the software provider")</b></span>
			</td>
	</tr>
	<tr><td colspan="2"></td></tr> 
	<tr>
	    <td colspan="2">
				<table	cellspacing="0" cellpadding="0" width="80%" border="0">
					<tr>
						<td height="5">
								<span style="margin-top: 50; display: block"><hr align = "center" width = "200"></hr></span>
						</td>
						<td height="5">
								<span style="margin-top: 50; display: block"><hr align = "center" width = "200"></hr></span>
						</td>
					</tr>
					<tr>
						<td valign="top" align="center">
								QT_TRANSLATE_NOOP("QObject", "Wipe executive")
						</td>
						<td valign="bottom" align="center">
								QT_TRANSLATE_NOOP("QObject", "Supervisor")
						</td>
					</tr>
                </table>
		</td>
	</tr>
</table>
</xsl:when>
</xsl:choose>

</body>

</html>

</xsl:template>


</xsl:stylesheet>