<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:x="DAV:" xmlns:y="SAP:">
  <xsl:output method='html'/>
  <xsl:param name="notificationtext"/>
  <xsl:param name="eventid"/>
  <xsl:param name="headline"/>
  <xsl:template match="/">
  <xsl:output encoding="UTF-8" />

<xsl:comment xml:space="preserve">

<xsl:apply-templates select="notification/greeting/textspan"><xsl:with-param name="outputFormat" select="'plaintext'"/></xsl:apply-templates>

<xsl:apply-templates select="notification/message/textspan"><xsl:with-param name="outputFormat" select="'plaintext'"/></xsl:apply-templates>

<xsl:apply-templates select="notification/warning/textspan"><xsl:with-param name="outputFormat" select="'plaintext'"/></xsl:apply-templates>
<xsl:apply-templates select="notification/txtwarning/textspan"><xsl:with-param name="outputFormat" select="'plaintext'"/></xsl:apply-templates>

</xsl:comment>

    <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title><xsl:apply-templates select="notification/title/textspan"/></title>
      </head>
      <body>
        <b><xsl:apply-templates select="notification/greeting/textspan"/></b><hr/>
		  <xsl:apply-templates select="notification/message/textspan"/>
		  
        <p/>
	    <hr/><small><xsl:apply-templates select="notification/warning/textspan"/></small><p/>
      </body>
    </html>
  </xsl:template>
  
  <xsl:template match="textspan">
    <xsl:param name="outputFormat" select="'HTML'"/>
	<xsl:apply-templates select="notificationtext|headline|eventid|text()"><xsl:with-param name="outputFormat" select="$outputFormat"/></xsl:apply-templates>
  </xsl:template>
  
  <xsl:template match="text()">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><xsl:value-of select="."/></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="."/></xsl:if>
  </xsl:template>

  <xsl:template match="notificationtext">
	 <xsl:value-of select="$notificationtext"/>
  </xsl:template>

  <xsl:template match="headline">
	 <xsl:value-of select="$headline"/>
  </xsl:template>

  <xsl:template match="eventid">
	 <xsl:value-of select="$eventid"/>
  </xsl:template>
  
  <xsl:template match="notificationtext">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><xsl:value-of select="$notificationtext"/></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="$notificationtext"/></xsl:if>
  </xsl:template>

  <xsl:template match="headline">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><xsl:value-of select="$headline"/></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="$headline"/></xsl:if>
  </xsl:template>

  <xsl:template match="eventid">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><xsl:value-of select="$eventid"/></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="$eventid"/></xsl:if>
  </xsl:template>


  
</xsl:stylesheet>
