|
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"?>
<!-- $Id: index.xsl,v 1.18 2001/04/24 19:50:34 agarcia3 Exp $ -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="html"/>
<!-- Written by Alfredo Garcia "agarcia@mundofree.com" -->
<xsl:template match="homePage">
<!-- Template global variables -->
<xsl:variable name="BASE_URL">/webEditor/editor_1/docs
<xsl:variable name="URL" select="configuration/general/category[@name='HTTP Headers']/data[@code='requestURI']" />
<xsl:variable name="PUBLISH_DOC" select="configuration/general/category[@name='directories']/data[@code='docRoot']" />
<html>
<head>
<title>webEditor Content Management
<link rel="stylesheet" href="{$BASE_URL}/styles/style.css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#006600" vlink="#006600">
<div align="center">
<br/>
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="15" valign="top" bgcolor="#006600"> |
<td width="94" bgcolor="#006600" align="center" valign="middle" class="pieblanco">
<xsl:text disable-output-escaping="yes">
</td>
<td width="129" bgcolor="#006600" align="center">
<xsl:text disable-output-escaping="yes">
</td>
<td width="394" bgcolor="#82c245">
<td width="105" bgcolor="#82c245">
<td width="13" bgcolor="#82c245" valign="top" align="right">
</tr>
</table>
<!-- End Header-->
<!-- Begin Navigation Barr-->
<table width="750" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="112" bgcolor="#006600" align="center" valign="top">
<table width="90%" border="0" cellspacing="2" cellpadding="1">
<tr align="right">
<td class="navegation">NAVEGATION
</tr>
<tr align="right" bgcolor="#82C245">
<td class="navegation">New Document
</tr>
<tr align="right" bgcolor="#82C245">
<td class="navegation">Published Documents
</tr>
<tr align="right">
<td bgcolor="#82C245" class="navegation">Show Config
</tr>
<tr align="right">
<td bgcolor="#82C245" class="navegation">Edit Config
</tr>
</table>
<p>
<form method="post" action="{$URL}">
<table width="90%" border="0" cellspacing="2" cellpadding="1">
<tr align="right">
<td bgcolor="#82C245" class="navegation" align="center">Publish
</tr>
<tr align="right" width="72" height="22">
<td bgcolor="#82C245" class="navegation" align="center">
<input type="image" border="0" src="{$BASE_URL}/images/go.jpg" alt="Publish" name="Publish"/>
</td>
</tr>
</table>
<input type="hidden" value="composition" name="mode"/>
<input type="hidden" value="publish" name="code"/>
</form>
</p>
<br/>
</td>
<td width="10">
<td width="521" valign="top">
<table width="500">
<tr>
<td>
<xsl:apply-templates select="docContent">
<xsl:with-param name="URL" select="$URL"/>
<xsl:with-param name="BASE_URL" select="$BASE_URL"/>
</xsl:apply-templates>
</td>
</tr>
</table>
</td>
<td width="117" valign="top" align="center" bgcolor="#82C245">
<xsl:text disable-output-escaping="yes">
</td>
</tr>
</table>
</div>
</body>
</html>
</xsl:template>
<xsl:template match="docContent">
<p>
<xsl:apply-templates>
<xsl:with-param name="URL" select="$URL"/>
<xsl:with-param name="BASE_URL" select="$BASE_URL"/>
</xsl:apply-templates>
</p>
</xsl:template>
<xsl:template match="article">
<xsl:apply-templates select="content">
<xsl:with-param name="URL" select="$URL"/>
<xsl:with-param name="BASE_URL" select="$BASE_URL"/>
<xsl:with-param name="docID" select="docID"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="content">
<p>
<xsl:apply-templates select="art_lead"/>
<xsl:apply-templates select="art_title">
<xsl:with-param name="URL" select="$URL"/>
<xsl:with-param name="docID" select="$docID"/>
</xsl:apply-templates>
<xsl:apply-templates select="art_begin"/>
<xsl:call-template name="menu">
<xsl:with-param name="URL" select="$URL"/>
<xsl:with-param name="BASE_URL" select="$BASE_URL"/>
<xsl:with-param name="docID" select="$docID"/>
<xsl:with-param name="order" select="../../@order"/>
<xsl:with-param name="size" select="../../../@size"/>
</xsl:call-template>
</p>
</xsl:template>
<xsl:template match="art_lead">
<font class="lead">
<xsl:apply-templates select="image"/>
<xsl:value-of select="text()" disable-output-escaping="yes" />
</font>
</xsl:template>
<xsl:template match="art_title">
<br>
<a class="bigtitle" href="{$URL}?mode=presentation&code=showDoc&docID={$docID}">
<xsl:apply-templates select="image"/>
<xsl:value-of select="text()" disable-output-escaping="yes" />
</a>
</br>
</xsl:template>
<xsl:template match="art_subtitle">
<font class="text">
<b>
<xsl:apply-templates select="image"/>
<xsl:value-of select="text()" disable-output-escaping="yes" />
</b>
</font>
</xsl:template>
<xsl:template match="art_begin">
<font class="text">
<xsl:apply-templates select="image"/>
<xsl:value-of select="text()" disable-output-escaping="yes" />
</font>
</xsl:template>
<xsl:template match="art_body">
<font class="text">
<xsl:apply-templates select="image"/>
<xsl:value-of select="text()" disable-output-escaping="yes" />
</font>
</xsl:template>
<xsl:template name="menu">
<xsl:param name="docID">0
<xsl:param name="order">0
<xsl:param name="size">0
<br>
<table border="0" width="50%">
<tr>
<td>
<a href="{$URL}?mode=edit&docID={$docID}">Edit
</td>
<td>
<a href="{$URL}?mode=composition&code=delete&docID={$docID}">Delete
</td>
<td>
<xsl:choose>
<xsl:when test="$order=1">
<img height="8" width="16" border="0" alt="First Article" src="{$BASE_URL}/images/flecharriba2.gif"/>
</xsl:when>
<xsl:otherwise>
<a href="{$URL}?mode=composition&code=rise&docID={$docID}">
</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="$order=$size">
<img height="8" width="16" border="0" alt="Last Article" src="{$BASE_URL}/images/flechaabajo2.gif"/>
</xsl:when>
<xsl:otherwise>
<a href="{$URL}?mode=composition&code=lower&docID={$docID}">
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
</table>
</br>
</xsl:template>
<xsl:template match="image">
<xsl:apply-templates select="image_content"/>
</xsl:template>
<xsl:template match="image_content">
<xsl:variable name="image_src" select="art_image"/>
<xsl:variable name="image_footer" select="art_image_footer"/>
<xsl:variable name="image_alt" select="art_image_alt"/>
<xsl:variable name="image_link" select="art_image_link"/>
<xsl:variable name="image_align" select="art_image_align"/>
<table border="0" cellpadding="0" cellspacing="3" align="{$image_align}">
<tr>
<td>
<xsl:choose>
<xsl:when test="$image_link=' '">
<img src="{$image_src}" border="0" alt="{$image_alt}" />
</xsl:when>
<xsl:otherwise>
<a href="{$image_link}" border="0">
</xsl:otherwise>
</xsl:choose>
</td>
<tr>
<td valign="top">