<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  version="1.0">

<xsl:output 
  method="text" 
  encoding="UTF-8" 
  omit-xml-declaration="yes" 
  indent="no"/>

<xsl:strip-space elements="*"/>

<xsl:template name="SrcTgtDescription">
  <xsl:param name="Node"/>
  <xsl:choose>
    <xsl:when test="$Node/disk">QT_TRANSLATE_NOOP("QObject", "Hard Disk") <xsl:value-of select="$Node/disk/param[@name='number']/@valuedescription"/>
    </xsl:when>
  
    <xsl:when test="$Node/partition">
      <xsl:choose>
        <xsl:when test="normalize-space($Node/partition/param[@name='letter']/@valuedescription)">QT_TRANSLATE_NOOP("QObject", "Volume") <xsl:value-of select="$Node/partition/param[@name='letter']/@valuedescription"/> QT_TRANSLATE_NOOP("QObject", "on hard disk") <xsl:value-of select="$Node/partition/param[@name='disk']/@valuedescription"/>
        </xsl:when>
		<xsl:otherwise>QT_TRANSLATE_NOOP("QObject", "Unmounted volume") <xsl:value-of select="$Node/partition/param[@name='number']/@valuedescription"/> QT_TRANSLATE_NOOP("QObject", "on hard disk") <xsl:value-of select="$Node/partition/param[@name='disk']/@valuedescription"/>
  			</xsl:otherwise>  
      </xsl:choose>
    </xsl:when>
  
    <xsl:when test="$Node/archive">QT_TRANSLATE_NOOP("QObject", "Archive") "<xsl:value-of select="$Node/archive/param[@name='archivename']/@valuedescription"/>"</xsl:when>
  
  </xsl:choose>
</xsl:template>

<xsl:template name="TextDetails">
<xsl:text>******************************************&#xa;</xsl:text>
<xsl:value-of select="@description"/><xsl:text>&#xa;</xsl:text>

<xsl:if test="source">
	QT_TRANSLATE_NOOP("QObject", "Source:")
	<xsl:text>&#x9;</xsl:text><xsl:call-template name="SrcTgtDescription">
		<xsl:with-param name="Node" select="source"/>
	</xsl:call-template>
	<xsl:text>&#xa;</xsl:text>
</xsl:if>

<xsl:if test="target">
	QT_TRANSLATE_NOOP("QObject", "Target:")
	<xsl:text>&#x9;</xsl:text><xsl:call-template name="SrcTgtDescription">
		<xsl:with-param name="Node" select="target"/>
	</xsl:call-template>
	<xsl:text>&#xa;</xsl:text>
</xsl:if>

<xsl:if test="params">
	QT_TRANSLATE_NOOP("QObject", "Parameters:")
	<xsl:for-each select="params/param">
	<xsl:text>&#x9;</xsl:text><xsl:value-of select="@description"/>: <xsl:value-of select="@valuedescription"/><xsl:text>&#xa;</xsl:text><xsl:text>&#x9;</xsl:text>
	</xsl:for-each>
</xsl:if>

<xsl:if test="error">
	<xsl:text>&#x9;</xsl:text>QT_TRANSLATE_NOOP("QObject", "The operation has failed:")
	<xsl:text>&#x9;</xsl:text><xsl:value-of select="error/@description"/> (<xsl:value-of select="error/@code"/>)
</xsl:if>
<xsl:text>&#xa;</xsl:text>

</xsl:template>

<xsl:template name="HTMLDetails">

  <li>
    <h4><xsl:value-of select="@description"/></h4>
      
      <xsl:if test="source">
		  <b>QT_TRANSLATE_NOOP("QObject", "Source:")</b><br/>
          <xsl:call-template name="SrcTgtDescription">
            <xsl:with-param name="Node" select="source"/>
          </xsl:call-template>
      <br/>
      </xsl:if>

      <xsl:if test="target">
		  <b>QT_TRANSLATE_NOOP("QObject", "Target:")</b><br/>
          <xsl:call-template name="SrcTgtDescription">
            <xsl:with-param name="Node" select="target"/>
          </xsl:call-template>
			<br/>
      </xsl:if>

	    <xsl:if test="params">
        <b>QT_TRANSLATE_NOOP("QObject", "Parameters:")</b><br/>
        <xsl:for-each select="params/param">
          <xsl:value-of select="@description"/>: <xsl:value-of select="@valuedescription"/><br/>
        </xsl:for-each>
	    </xsl:if>
  </li>
  
  <br/>
  <xsl:if test="error">
    <b>QT_TRANSLATE_NOOP("QObject", "The operation has failed:")</b>&#xa;
    <xsl:value-of select="error/@description"/> (<xsl:value-of select="error/@code"/>)

  </xsl:if>

</xsl:template>

<xsl:template match="/report">

QT_TRANSLATE_NOOP("QObject", "Full E-mail notification report.")

----------------------------------------------------------------------------------
QT_TRANSLATE_NOOP("QObject", "System info:")
----------------------------------------------------------------------------------

QT_TRANSLATE_NOOP("QObject", "Computer Name: ")<xsl:value-of select="computer"/>
<xsl:text>&#xa;</xsl:text><xsl:value-of select="OS"/>

----------------------------------------------------------------------------------
QT_TRANSLATE_NOOP("QObject", "Summary:")
----------------------------------------------------------------------------------

QT_TRANSLATE_NOOP("QObject", "Generated: ")<xsl:value-of select="generated"/><xsl:text>&#xa;</xsl:text>

<xsl:choose>
<xsl:when test="error">
QT_TRANSLATE_NOOP("QObject", "Not the all operations have been applied.")
QT_TRANSLATE_NOOP("QObject", "The following error had occured: ")<xsl:value-of select="error/@description"/> (<xsl:value-of select="error/@code"/>)
</xsl:when>
<xsl:otherwise>
QT_TRANSLATE_NOOP("QObject", "All operations have been applied successfully.")
</xsl:otherwise>
</xsl:choose>
----------------------------------------------------------------------------------
QT_TRANSLATE_NOOP("QObject", "The following operations have been performed:")
----------------------------------------------------------------------------------

<xsl:for-each select="action[@type='physical']">
  <xsl:call-template name="TextDetails"/>
</xsl:for-each>
----------------------------------------------------------------------------------
QT_TRANSLATE_NOOP("QObject", "You have requested full e-mail reports from <ProductName>")
QT_TRANSLATE_NOOP("QObject", "Please change e-mail options to get short reports or to stop getting the reports.")

</xsl:template>

</xsl:stylesheet>