home | career | drupal | java | mac | mysql | perl | scala | uml | unix  
<xsl:choose> <xsl:when test="@holds_messages = 'true'"> <TD COLSPAN="{/USERMODEL/STATEDATA/VAR[@name='max folder depth']/@value - $level - 1}"> <A HREF="{$base}/folder/list?session-id={$session-id}&folder-id={@id}&part=1"> </TD> <TD> <FONT COLOR="green">/ messages </TD> </xsl:when> <xsl:otherwise> <TD COLSPAN="{/USERMODEL/STATEDATA/VAR[@name='max folder depth']/@value - $level - 1}"> <STRONG> </TD> <TD> cannot contain messages </TD> </xsl:otherwise> </xsl:choose> </TR> <xsl:for-each select="FOLDER"> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:template> <!-- Create an appropriate number of before a folder, depending on the level --> <xsl:template name="recurse-folder"> <xsl:param name="level"/> <xsl:if test="$level>0"> <TD> <xsl:variable name="levelneu" select="$level - 1"/> <xsl:call-template name="recurse-folder"> <xsl:with-param name="level" select="$levelneu"/> </xsl:call-template> </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="UTF-8"?>
<!--
 * 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" encoding="UTF-8"/>
  
    <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 : Mailbox List
	<META CONTENT="AUTHOR" VALUE="Sebastian Schaffert"/>
      </HEAD>
      
      <BODY bgcolor="#ffffff">
	<CENTER>
	
	<P>
	  <H3>Welcome to your mailbox, .
	</P>
	<P>
	  This is the <xsl:apply-templates select="/USERMODEL/USERDATA/INTVAR[@name='login count']"/> 
	  time you log in since 
	  <xsl:apply-templates select="/USERMODEL/STATEDATA/VAR[@name='first login']"/>. 
	  Your <B>last login was on 
	  <B>.
	</P>
	<P>
	  Your Mailbox contains the following folders 
	  (total messages are in <FONT COLOR="green">green, 
	  new messages in <FONT COLOR="red">red) (Help):
<CENTER> <P> <A HREF="{$base}/mailbox?session-id={$session-id}&force-refresh=1">Force refresh - Click this to force a refresh of the folder information. </P> <TABLE WIDTH="80%"> <xsl:for-each select="/USERMODEL/MAILHOST_MODEL"> <xsl:apply-templates select="."/> </xsl:for-each> </TABLE> </CENTER> </P> </BODY> </HTML> </xsl:template> <xsl:template match="/USERMODEL/USERDATA/INTVAR"> <xsl:value-of select="@value"/> </xsl:template> <xsl:template match="/USERMODEL/STATEDATA/VAR"> <xsl:value-of select="@value"/> </xsl:template> <xsl:template match="/USERMODEL/MAILHOST_MODEL"> <TR BGCOLOR="#dddddd"> <TD COLSPAN="{/USERMODEL/STATEDATA/VAR[@name='max folder depth']/@value}" WIDTH="50%"> <xsl:choose> <xsl:when test='@error != ""'> <FONT COLOR="red"> (Error: ) </xsl:when> <xsl:otherwise> <STRONG> </xsl:otherwise> </xsl:choose> </TD> <TD WIDTH="50%"> <STRONG>Host: </TD> </TR> <xsl:for-each select="FOLDER[@subscribed='true']"> <xsl:apply-templates select="."/> </xsl:for-each> </xsl:template> <xsl:template match="FOLDER"> <xsl:variable name="level" select="count(ancestor::FOLDER)"/> <TR> <xsl:call-template name="recurse-folder"> <xsl:with-param name="level" select="$level"/> </xsl:call-template> <TD>


my book on functional programming

 

new blog posts

 

Copyright 1998-2019 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.