alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

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: edit-config.xsl,v 1.4 2001/04/15 15:24:03 agarcia3 Exp $ -->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes" method="html"/>

<xsl:template match="*|/">

<xsl:template match="text()|@*">

<xsl:template match="general">
<!-- Template global variables -->
<xsl:variable name="URL" select="configuration/general/category[@name='HTTP Headers']/data[@code='requestURI']" />
   <html>
    <head>
    <title>
    webEditor configuration Editor
    </title>
    <style type="text/css">
A:hover {
	COLOR: #ff3333
}

.bluelink {
font-family: Arial, Helvetica, sans-serif; font-size: 14px;font-weight: bold; COLOR: #006699
}

.category {
font-family: Arial, Helvetica, sans-serif; font-size: 14px;font-weight: bold; COLOR: #000000
}

    </style>
    </head>
    <body bgcolor="#ffffff">
    <center>
    	[<a href="{$URL}" class="bluelink">
		Editor Home
	</a>]

	<form method="post" action="{$URL}">
	<p/>
	<table border="0" cellspacing="0" cellpadding="0" width="605">
	  <tr>
	   <td valign="top">
     		<xsl:apply-templates select="category"/>
     		<!-- 
	   </td>
	  </tr>
     	</table>
	<br/>
	<input type="hidden" name="mode" value="config" />
	<input type="hidden" name="code" value="edit" />
	<input type="submit" name="action" value="Save" />
    </form>
    </center>
    </body>
   </html>
  </xsl:template>

<xsl:template match="data" name="data">#6699cc
<xsl:variable name="color2">#FFFFFF

<xsl:choose>
<xsl:when test="(position() mod 2) != 0">

<xsl:call-template name="row">
	<xsl:with-param name="color" select="$color1"/>
</xsl:call-template>

</xsl:when>
<xsl:when test="(position() mod 2) = 0">

<xsl:call-template name="row">
	<xsl:with-param name="color" select="$color2"/>
</xsl:call-template>

</xsl:when>
</xsl:choose>
</xsl:template>

<xsl:template match="row" name="row">#FFFFFF

<tr bgcolor="{$color}">
      <td width="30%">
      	<font face="arial" size="2"> 
    		<b>
	</font>
      </td>
      <td>
      	<font face="arial" size="2"> 
	<xsl:text disable-output-escaping="yes">&nbsp;
	<xsl:choose>
	<xsl:when test="@code='editionMode'">

	<select name="editionMode">	
	<xsl:call-template name="option-element">
	  		<xsl:with-param name="name">rich
			<xsl:with-param name="value">rich
			<xsl:with-param name="selected" select="self::node()"/>
	</xsl:call-template>

	<xsl:call-template name="option-element">
	  		<xsl:with-param name="name">simple
			<xsl:with-param name="value">simple
			<xsl:with-param name="selected" select="self::node()"/>
	</xsl:call-template>
	</select>

	</xsl:when>
	<xsl:otherwise>
	<input type="text" name="{@code}" size="50" value="{.}"/>
	</xsl:otherwise>
	</xsl:choose>

	</font>
      </td>
</tr>

<xsl:template match="category" name="category">
<p>

<table BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="600">
<tr>
<td valign="top" bgcolor="#336699">

<table BORDER="0" CELLPADDING="1" CELLSPACING="1" WIDTH="600">
<tr>
      <td width="30%" bgColor="#eeeeee" colspan="2" align="center">
      	<font class="category"> 
		Configuration Values (webEditor 0.3)
	</font>
      </td>
</tr>
<tr>
      <td>
      	<font face="arial" size="2"> 
    		<xsl:apply-templates/>
	</font>
      </td>
</tr>
</table>

</td>
</tr>
</table>

</p>
</xsl:template>

<xsl:template name="option-element">
<xsl:param name="name">/
<xsl:param name="value">/
<xsl:param name="selected">/
	<xsl:choose>
	<xsl:when test="$selected=$value">
		<option value="{$value}" selected="selected">
	</xsl:when>
	<xsl:otherwise>
		<option value="{$value}">
	</xsl:otherwise>
	</xsl:choose>

</xsl:template>


</xsl:stylesheet>
... 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.