<?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="subscriptionname"/>
  <xsl:param name="notificationtext"/>
  <xsl:param name="eventid"/>
  <xsl:param name="eventname"/>
  <xsl:param name="resourcename"/>
  <xsl:param name="resourceiscollection"/>
  <xsl:param name="resourceurl"/>
  <xsl:param name="parenturl"/>
  <xsl:param name="contentaccessurl"/>
  <xsl:param name="folderaccessurl"/>
  <xsl:param name="deleteurl"/>
  <xsl:param name="administrationurl"/>
  <xsl:param name="mailto"/>
  <xsl:param name="newresourcelink"/>    
  <xsl:param name="isowner"/>
  <xsl:param name="headline"/>  
  <xsl:param name="resourcedescription"/>
  <xsl:param name="contenttype"/>  

  <xsl:template xml:space="preserve" match="/"><xsl:output encoding="UTF-8" /><xsl:apply-templates select="notification/eventinfo/textspan[@pEventid=$eventid and @isCollection=$resourceiscollection]"><xsl:with-param name="outputFormat" select="'plaintextsms'"/></xsl:apply-templates> <xsl:value-of select="$notificationtext"/></xsl:template>
  
  <xsl:template match="textspan">
    <xsl:param name="outputFormat" select="'HTML'"/>
	<xsl:apply-templates select="resourcename|newresourcelink|headline|subscriptionname|notificationtext|eventid|eventname|parenturl|contentaccessurl|folderaccessurl|deleteurl|administrationurl|mailto|subscriptionlink|resourcelink|parentlink|deletelink|administerlink|mailtolink|resourcedescription|contenttype|text()"><xsl:with-param name="outputFormat" select="$outputFormat"/></xsl:apply-templates>
  </xsl:template>
  
  <xsl:template match="resourcename">
	 <xsl:value-of select="$resourcename"/>
  </xsl:template>
  
  <xsl:template match="newresourcelink">
	 <xsl:value-of select="$newresourcelink"/>
  </xsl:template>  

  <xsl:template match="subscriptionname">
	 <xsl:value-of select="$subscriptionname"/>
  </xsl:template>

  <xsl:template match="notificationtext">
	 <xsl:value-of select="$notificationtext"/>
  </xsl:template>

  <xsl:template match="eventid">
	 <xsl:value-of select="$eventid"/>
  </xsl:template>

  <xsl:template match="eventname">
	 <xsl:value-of select="$eventname"/>
  </xsl:template>

  <xsl:template match="resourceurl">
	 <xsl:value-of select="$resourceurl"/>
  </xsl:template>

  <xsl:template match="parenturl">
	 <xsl:value-of select="$parenturl"/>
  </xsl:template>

  <xsl:template match="contentaccessurl">
	 <xsl:value-of select="$contentaccessurl"/>
  </xsl:template>

  <xsl:template match="folderaccessurl">
	 <xsl:value-of select="$folderaccessurl"/>
  </xsl:template>

  <xsl:template match="deleteurl">
	 <xsl:value-of select="$deleteurl"/>
  </xsl:template>

  <xsl:template match="administrationurl">
	 <xsl:value-of select="$administrationurl"/>
  </xsl:template>

  <xsl:template match="mailto">
	 <xsl:value-of select="$mailto"/>
  </xsl:template>
  
  <xsl:template match="headline">
	 <xsl:value-of select="$headline"/>
  </xsl:template>  
  
  <xsl:template match="resourcedescription">
	 <xsl:value-of select="$resourcedescription"/>
  </xsl:template>  
  
  <xsl:template match="contenttype">
	 <xsl:value-of select="$contenttype"/>
  </xsl:template>  
  
  <xsl:template match="subscriptionlink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$administrationurl}"><xsl:value-of select="$subscriptionname"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:value-of select="$subscriptionname"/> (<xsl:value-of select="$administrationurl"/>)</xsl:if>
    <xsl:if test="$outputFormat='plaintextsms'"><xsl:value-of select="$subscriptionname"/></xsl:if>
  </xsl:template>
  
  <xsl:template match="resourcelink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$contentaccessurl}"><xsl:value-of select="$resourcename"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:value-of select="$resourcename"/> (<xsl:value-of select="$contentaccessurl"/>)</xsl:if>
    <xsl:if test="$outputFormat='plaintextsms'"><xsl:value-of select="$resourcename"/></xsl:if>
  </xsl:template>

  <xsl:template match="newresourcelink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$contentaccessurl}"><xsl:value-of select="$newresourcelink"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:value-of select="$newresourcelink"/> (<xsl:value-of select="$contentaccessurl"/>)</xsl:if>
    <xsl:if test="$outputFormat='plaintextsms'"><xsl:value-of select="$newresourcelink"/></xsl:if>
  </xsl:template>

  <xsl:template match="parentlink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$contentaccessurl}"><xsl:value-of select="$parenturl"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:value-of select="$parenturl"/> (<xsl:value-of select="$contentaccessurl"/>)</xsl:if>
    <xsl:if test="$outputFormat='plaintextsms'"><xsl:value-of select="$parenturl"/></xsl:if>
  </xsl:template>
  
  <xsl:template match="deletelink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$deleteurl}"><xsl:apply-templates select="text()"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:apply-templates select="text()"/> (<xsl:value-of select="$deleteurl"/>)</xsl:if>
  </xsl:template>
  
  <xsl:template match="administerlink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$administrationurl}"><xsl:apply-templates select="text()"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:apply-templates select="text()"/> (<xsl:value-of select="$administrationurl"/>)</xsl:if>
  </xsl:template>
  
  <xsl:template match="mailtolink">
    <xsl:param name="outputFormat" select="'HTML'"/>
    <xsl:if test="$outputFormat='HTML'"><a href="{$mailto}"><xsl:apply-templates select="text()"/></a></xsl:if>
    <xsl:if test="$outputFormat='plaintext'"><xsl:apply-templates select="text()"/> (<xsl:value-of select="$mailto"/>)</xsl:if>
  </xsl:template>
  
</xsl:stylesheet>
