<?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="feedbackurl"/>    
  <xsl:param name="aonumber"/>  

  <xsl:template match="/">
  <xsl:output encoding="UTF-8" />

  <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/eventinfo/textspan[@pEventid='span1']"/><p/>
      <xsl:apply-templates select="notification/eventinfo/textspan[@pEventid='span2']"/><br/>

	  <p/><hr/><p/>
    </body>
  </html>
  </xsl:template>

 
  <xsl:template match="textspan">
    <xsl:param name="outputFormat" select="'HTML'"/>
	<xsl:apply-templates select="feedbackurl|feedbacklink|aonumber|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="feedbackurl">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><xsl:value-of select="$feedbackurl"/></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="$feedbackurl"/></xsl:if>
  </xsl:template>

  <xsl:template match="aonumber">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><span tabindex="0"><b><xsl:value-of select="$aonumber"/></b></span></xsl:if>
    <xsl:if test="not($outputFormat='HTML')"><xsl:value-of select="$aonumber"/></xsl:if>
  </xsl:template>

  <xsl:template match="feedbacklink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$feedbackurl}"><xsl:attribute name="title"><xsl:value-of select="text()"/></xsl:attribute><xsl:value-of select="text()"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:value-of select="text()"/> - <xsl:value-of select="$feedbackurl"/></xsl:if>
  </xsl:template>
  
</xsl:stylesheet>
