alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7"> <xsl:value-of select="@description"/> <xsl:text disable-output-escaping="yes">&nbsp; </TD> </TR> </xsl:if> <TR> <TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Type: <TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7"> </TR> <TR> <TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Size: <TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7"> bytes </TR> <xsl:if test="@type='image' and /USERMODEL/USERDATA/BOOLVAR[@name='show images']/@value = 'yes'"> <TR> <TD COLSPAN="2" bgcolor="#A6B1C0"> <IMG SRC="{$base}/showmime/{@filename}?session-id={$session-id}&msgid={ancestor::MESSAGE/@msgid}"/> </TD> </TR> </xsl:if> </TABLE> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="CONTENT"> <xsl:choose> <xsl:when test="../@type = 'html'"> <xsl:apply-templates select="*"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="." disable-output-escaping="yes" /> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template name="navigation"> <TABLE width="100%" border="0" cellspacing="0" cellpadding="0"> <TR> <xsl:choose> <xsl:when test="@msgnr > 1"> <TD width="5%" bgcolor="#697791" valign="middle" align="center"> <A HREF="{$base}/folder/showmsg?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr - 1}"> <IMG SRC="{$imgbase}/images/back.gif" BORDER="0"/> </A> </TD> <TD width="30%" bgcolor="#697791" valign="middle"> <A HREF="{$base}/folder/showmsg?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr - 1}"> Previous message </A> </TD> </xsl:when> <xsl:otherwise> <TD width="5%" bgcolor="#697791" valign="middle" align="center">   </TD> <TD class="testoBianco" width="30%" bgcolor="#697791" valign="middle">   </TD> </xsl:otherwise> </xsl:choose> <TD width="30%" bgcolor="#697791" valign="middle" align="center"> <A HREF="{$base}/folder/list?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&part={/USERMODEL/CURRENT[@type='folder']/@list_part}"> <IMG SRC="{$imgbase}/images/up.gif" BORDER="0"/> <BR/>message list </A> </TD> <xsl:variable name="current_folder" select="/USERMODEL/CURRENT[@type='folder']/@id"/> <xsl:choose> <xsl:when test="@msgnr < /USERMODEL/MAILHOST_MODEL//FOLDER[@id=$current_folder]/MESSAGELIST/@total"> <TD width="30%" bgcolor="#697791" valign="middle" align="right"> <A HREF="{$base}/folder/showmsg?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr + 1}"> <SPAN class="testoBianco">Next message </A> </TD> <TD width="5%" bgcolor="#697791" valign="middle" align="center"> <A HREF="{$base}/folder/showmsg?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr + 1}"> <IMG SRC="{$imgbase}/images/next.gif" BORDER="0"/> </A> </TD> </xsl:when> <xsl:otherwise> <TD width="30%" bgcolor="#697791" valign="middle" align="right">   </TD> <TD width="5%" bgcolor="#697791" valign="middle" align="center">   </TD> </xsl:otherwise> </xsl:choose> </TR> </TABLE> </xsl:template> <xsl:template match="DATE"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="SUBJECT"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="TO"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="CC"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="REPLY-TO"> <xsl:value-of select="."/> </xsl:template> <xsl:template match="FROM"> <xsl:choose> <xsl:when test="contains(.,'<')"> <xsl:value-of select="substring-before(.,'<')"/>, <xsl:value-of select="substring-before(substring-after(.,'<'),'>')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:template> <!-- The following three sections deal with displaying HTML code from HTML attachments. Elements marked "malicious" will get a special treatment --> <xsl:template match="@*|node()"> <xsl:choose> <xsl:when test="not(@malicious)"> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:when> <xsl:otherwise> <TABLE BORDER="1" WIDTH="100%" CELLSPACING="0" CELLPADDING="0"> <TR> <TD BGCOLOR="#FF9933"> Untrusted HTML element removed: <xsl:value-of select="@malicious"/> </TD> </TR> <TR> <TD bgcolor="#3399FF" > <xsl:apply-templates select="." mode="quote"/> </TD> </TR> </TABLE> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="node()" mode="quote"> <xsl:choose> <xsl:when test="name(.)"> <<xsl:value-of select="name(.)"/> <xsl:text> <xsl:if test="./node()"> > <xsl:apply-templates select="node()" mode="quote"/> </<xsl:value-of select="name(.)"/> </xsl:if> > </xsl:when> <xsl:otherwise> <xsl:value-of select="."/> </xsl:otherwise> </xsl:choose> </xsl:template> <xsl:template match="@*" mode="quote"> <xsl:if test="name(.) != 'malicious'"> <xsl:text> ="" </xsl:if> </xsl:template> </xsl:stylesheet>

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 * Copyright (C) 2000 Sebastian Schaffert
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="html" indent="no"/>
  
    <xsl:variable name="imgbase" select="/USERMODEL/STATEDATA/VAR[@name='img base uri']/@value"/>
    <xsl:variable name="base" select="/USERMODEL/STATEDATA/VAR[@name='base uri']/@value"/>
    <xsl:variable name="session-id" select="/USERMODEL/STATEDATA/VAR[@name='session id']/@value"/>

    <xsl:template match="/">

    <HTML>
      <HEAD>
        <TITLE>WebMail Mailbox for : Showing message 
	<META CONTENT="AUTHOR" VALUE="Sebastian Schaffert"/>
	<link rel="stylesheet" href="{$base}/passthrough/webmail.css"/>
      </HEAD>
      
      <BODY bgcolor="#B5C1CF" topmargin="5" leftmargin="0" marginwidth="0" marginheight="5">
<IMG SRC="{$imgbase}/images/icona_mail.gif" BORDER="0" hspace="5" align="absmiddle"/>Showing message (Help)
	<xsl:variable name="current_msg" select="/USERMODEL/CURRENT[@type='message']/@id"/>
	<xsl:variable name="current_folder" select="/USERMODEL/CURRENT[@type='folder']/@id"/>
	<xsl:apply-templates select="/USERMODEL/MAILHOST_MODEL//FOLDER[@id=$current_folder]//MESSAGE[@msgid=$current_msg]"/>
      </BODY>
    </HTML>
  </xsl:template>

  <xsl:template match="MESSAGE">

    <xsl:call-template name="navigation"/>    

    <TABLE width="100%" border="0" cellspacing="2" cellpadding="4">
      <TR>
	<TD colspan="2" bgcolor="A6B1C0" height="22">
          <TABLE width="100%" border="0" cellpadding="0" cellspacing="0">
	    <TR>
	      <TD class="testoGrande">
		<xsl:apply-templates select="HEADER/SUBJECT"/>
	      </TD>	     
	    </TR>
	  </TABLE>
	</TD>
      </TR>
      <TR>
	<TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">From:
	</TD>
	<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7">
	  <xsl:apply-templates select="HEADER/FROM"/>
	</TD>
      </TR>
      <TR>
	<TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">To:
	</TD>
	<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7">
	  <xsl:for-each select="HEADER/TO">
	    <xsl:apply-templates select="."/>
	  </xsl:for-each>
	</TD>
      </TR>
      <TR>
	<TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Reply-To:
	</TD>
	<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7">
	  <xsl:apply-templates select="HEADER/REPLY_TO"/>
	  <xsl:text disable-output-escaping="yes">&nbsp;
	</TD>
      </TR>
      <TR>
	<TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">CC:
	</TD>
	<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7">
	  <xsl:for-each select="HEADER/CC">
	    <xsl:apply-templates select="."/>
	  </xsl:for-each>
	  <xsl:text disable-output-escaping="yes">&nbsp;
	</TD>
      </TR>
      <TR>
	<TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Date:
	</TD>
	<TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7">
	  <xsl:apply-templates select="HEADER/DATE"/>
	</TD>
      </TR>
      <TR>
	<TD COLSPAN="4" bgcolor="A6B1C0" ALIGN="right" class="testoNero">
	  <A HREF="{$base}/compose?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr}&reply=1">reply to this message... - 
	  <A HREF="{$base}/compose?session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}&message-nr={@msgnr}&forward=1">forward this message...
	</TD>
      </TR>
    </TABLE>

    <xsl:for-each select="PART">
     
      <P class="testoMesg">
	<xsl:apply-templates select="."/>
      </P>
	
    </xsl:for-each>
    
    <TABLE WIDTH="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="A6B1C0">
      <TR>
        <FORM ACTION="{$base}/folder/list?flag=1&session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}" METHOD="POST">
	    <TD align="center" class="testoNero">
	      <INPUT TYPE="HIDDEN" NAME="CH%{@msgnr}" VALUE="on"/>
	      <SELECT NAME="MARK" class="testoNero">
		<OPTION VALUE="MARK">set
		<OPTION VALUE="UNMARK">remove
	      </SELECT>
	      <STRONG>message flag
	      <SELECT NAME="MESSAGE FLAG" class="testoNero">
		<OPTION VALUE="DELETED">deleted
		<OPTION VALUE="SEEN">seen
		<OPTION VALUE="ANSWERED">answered
		<OPTION VALUE="RECENT">recent
		<OPTION VALUE="DRAFT">draft
	      </SELECT>
	      <INPUT TYPE="SUBMIT" NAME="flagmsgs" VALUE="Perform!" class="testoNero"/>
	    </TD>
	  </FORM>
	  <FORM ACTION="{$base}/folder/showmsg?flag=1&session-id={$session-id}&folder-id={/USERMODEL/CURRENT[@type='folder']/@id}" METHOD="POST">
	    <TD align="center" class="testoNero">
	      <INPUT TYPE="HIDDEN" NAME="CH%{@msgnr}" VALUE="on"/>
	      <SELECT NAME="COPYMOVE" class="testoNero">
		<OPTION VALUE="COPY">copy
		<OPTION VALUE="MOVE">move
	      </SELECT>	   
	      message to folder
	      <SELECT NAME="TO" class="testoNero">
		<xsl:for-each select="/USERMODEL/MAILHOST_MODEL//FOLDER">
		  <OPTION value="{@id}">
		</xsl:for-each>
	      </SELECT>
	      <INPUT TYPE="SUBMIT" NAME="copymovemsgs" VALUE="Perform!" class="testoNero"/>
	    </TD>
         </FORM>
       </TR>
    </TABLE>
   
    
    <xsl:call-template name="navigation"/>
    
  </xsl:template>
  
  <xsl:template match="PART">
    <xsl:choose>
      <xsl:when test="@type='text' and @hidden='true'" />
      <xsl:when test="@type='text' and not(@hidden='true')">
	<PRE>
	  <xsl:for-each select="*">
	    <xsl:apply-templates select="."/>
	  </xsl:for-each>
	</PRE>
      </xsl:when>
      <xsl:when test="@type='html'">
	<xsl:for-each select="*">
	  <xsl:apply-templates select="."/>
	</xsl:for-each>
      </xsl:when>
      <xsl:when test="@type='multi'">
	<xsl:for-each select="PART">
	  <CENTER>

MIME part


<xsl:apply-templates select="."/> </xsl:for-each> </xsl:when> <xsl:otherwise> <TABLE width="100%" border="0" cellspacing="2" cellpadding="4"> <TR> <TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Attached file </TD> <TD height="22" class="testoNero" width="87%" bgcolor="#D1D7E7"> <A HREF="{$base}/showmime/{@filename}?session-id={$session-id}&msgid={ancestor::MESSAGE/@msgid}"> </TD> </TR> <xsl:if test="@description != ''"> <TR> <TD height="22" class="testoGrande" width="13%" bgcolor="#E2E6F0">Description:
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.