You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by jm...@apache.org on 2005/02/17 03:30:18 UTC

svn commit: r154112 - in struts/taglib/trunk: LICENSE.CheckStyle conf/ conf/qa/ conf/qa/CheckStyle.xml maven.xml struts.jsl

Author: jmitchell
Date: Wed Feb 16 18:30:16 2005
New Revision: 154112

URL: http://svn.apache.org/viewcvs?view=rev&rev=154112
Log:
clean up taglib. it now builds and installs the taglib jar

Added:
    struts/taglib/trunk/LICENSE.CheckStyle   (with props)
    struts/taglib/trunk/conf/
    struts/taglib/trunk/conf/qa/
    struts/taglib/trunk/conf/qa/CheckStyle.xml
    struts/taglib/trunk/struts.jsl   (with props)
Modified:
    struts/taglib/trunk/maven.xml

Added: struts/taglib/trunk/LICENSE.CheckStyle
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/LICENSE.CheckStyle?view=auto&rev=154112
==============================================================================
--- struts/taglib/trunk/LICENSE.CheckStyle (added)
+++ struts/taglib/trunk/LICENSE.CheckStyle Wed Feb 16 18:30:16 2005
@@ -0,0 +1,19 @@
+/\*\s*
+ \*\s*\$Header.*\$
+ \*\s*\$Revision.*\$
+ \*\s*\$Date.*\$
+ \*\s*
+ \*\s*Copyright \d{4}(-\d{4}|,\d{4})* The Apache Software Foundation\.
+ \*\s*
+ \*\s*Licensed under the Apache License, Version 2\.0 \(the "License"\);
+ \*\s*you may not use this file except in compliance with the License\.
+ \*\s*You may obtain a copy of the License at
+ \*\s*
+ \*\s*http://www\.apache\.org/licenses/LICENSE\-2\.0
+ \*\s*
+ \*\s*Unless required by applicable law or agreed to in writing, software
+ \*\s*distributed under the License is distributed on an "AS IS" BASIS,
+ \*\s*WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
+ \*\s*See the License for the specific language governing permissions and
+ \*\s*limitations under the License\.
+ \*/\s*

Propchange: struts/taglib/trunk/LICENSE.CheckStyle
------------------------------------------------------------------------------
    svn:executable = *

Added: struts/taglib/trunk/conf/qa/CheckStyle.xml
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/conf/qa/CheckStyle.xml?view=auto&rev=154112
==============================================================================
--- struts/taglib/trunk/conf/qa/CheckStyle.xml (added)
+++ struts/taglib/trunk/conf/qa/CheckStyle.xml Wed Feb 16 18:30:16 2005
@@ -0,0 +1,130 @@
+<?xml version="1.0"?>
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.1//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_1.dtd">
+
+
+<!--
+  
+  These checks still need to be Voted on for Validator, but
+  at least serve to cut down on some of the noise. 
+
+
+  A Checkstyle configuration that checks against the recommendations
+  in Joshua Bloch, Effective Java (highliy recommended read!)
+
+  This file does NOT duplicate the checks for whitespace settings,
+  placement of curly braces, etc.  Only the rules that are explicitly
+  mentioned in the book are enforced.
+
+  Currently the amount of rules that can be automatically checked by
+  Checkstyle is not very large, but adding more checks of this quality
+  is a high priority goal for the development team.
+
+-->
+
+<module name="Checker">
+
+   <module name="TreeWalker">
+
+    <!-- Item 4 - Avoid creating duplicate objects -->
+    <module name="IllegalInstantiation">
+      <property name="classes" value="java.lang.Boolean, java.lang.String"/>
+    </module>
+
+    <!-- Item 6 - Avoid finalizers -->
+    <!-- this will not find violations that contain linebreaks -->
+    <module name="GenericIllegalRegexp">
+      <property name="format"
+                value="((public)|(protected))\s+void\s+finalize\(\s*\)"/>
+    </module>
+
+    <!-- Item 8 - Always override hashCode when you override equals -->
+    <module name="EqualsHashCode"/>
+
+    <!-- Item 12 - Make all fields private -->
+    <module name="VisibilityModifier"/>
+
+    <!-- Item 15 - Design and document for inheritance or else prohibit it -->
+    <!-- the module actually implements a very strict rule, it would be
+         interesting to know whether Joshua meant what checkstyle implements.
+         We feel this implementation is well suited as a warning,
+         i.e. if you get error messages from this check you should be
+         able to name a good reason to implement your code the way you do it,
+         especially if you are designing a library and not an application. -->
+    <module name="DesignForExtension">
+      <property name="severity" value="warning"/>
+    </module>
+
+    <!-- Item 17 - Use interfaces only to define types -->
+    <module name="InterfaceIsType"/>
+
+    <!-- Item 25 - Design method signatures carefully -->
+    <!-- Avoid long parameter lists -->
+    <module name="ParameterNumber">
+      <property name="max" value="3"/>
+    </module>
+
+    <!-- Item 26 - Use overloading judiciously -->
+    <!-- rfe #659735 -->
+
+    <!-- Item 27 - Return zero-length array, not nulls -->
+    <!-- no rfe yet -->
+
+    <!-- Item 28 - Write doc comments for all exposed API elements -->
+    <module name="JavadocType">
+      <property name="scope" value="protected"/>
+    </module>
+    <module name="JavadocMethod"> <!-- also covers Item 44 -->
+      <property name="scope" value="protected"/>
+    </module>
+    <module name="JavadocVariable">
+      <property name="scope" value="protected"/>
+    </module>
+
+    <!-- Item 29 - Minimize the scope of local variables -->
+    <!-- no rfe yet -->
+
+
+    <!-- Item 38 - Adhere to generally accepted naming conventions -->
+    <module name="PackageName">
+      <!-- no uppercase letters, between 2 and 10 characters -->
+      <property name="format" value="^[a-z]+(\.[a-z][a-z0-9]{1,9})*$"/>
+    </module>
+    <module name="TypeName"/>
+    <module name="ConstantName"/>
+    <module name="LocalFinalVariableName"/>
+    <module name="LocalVariableName"/>
+    <module name="MemberName"/>
+    <module name="MethodName"/>
+    <module name="ParameterName"/>
+    <module name="StaticVariableName"/>
+
+    <!-- Item 47 - Don't ignore exceptions -->
+    <module name="EmptyBlock">
+      <property name="tokens" value="LITERAL_CATCH"/>
+      <!-- require a comment, change to stmt to require a statement -->
+      <property name="option" value="text"/>
+    </module>
+
+    <!-- Item 50 - Never invoke wait outside a loop -->
+    <!-- rfe #712798 -->
+
+    <!-- Item 57 - Provide a readResolve method when necessary -->
+    <!-- no rfe yet -->
+    
+    <!-- don't allow tabs -->
+    <module name="TabCharacter"/>
+
+    <!-- enforce License Header using a RegExp file to allow some variations
+         like the years in copyrights or values of SVN variables. -->
+    <module name="RegexpHeader">
+       <property name="headerFile" value="LICENSE.CheckStyle"/>
+    </module>
+
+  </module>
+
+  <!-- enforce package documentation -->
+  <module name="PackageHtml"/>
+  
+</module>

Modified: struts/taglib/trunk/maven.xml
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/maven.xml?view=diff&r1=154111&r2=154112
==============================================================================
--- struts/taglib/trunk/maven.xml (original)
+++ struts/taglib/trunk/maven.xml Wed Feb 16 18:30:16 2005
@@ -2,6 +2,10 @@
   xmlns:j="jelly:core"
   xmlns:ant="jelly:ant">
 
+  <postGoal name="dist">
+    <attainGoal name="jar:install"/>
+  </postGoal>
+   
   <preGoal name="xdoc:jelly-transform">
     <attainGoal name="html2xdoc"/>
 
@@ -36,14 +40,6 @@
       </ant:fileset>
     </ant:copy>
 
-    <!-- Copy configuration files -->
-    <j:set var="docsDest" value="${maven.docs.dest}"/>
-    <ant:copy todir="${maven.dist.bin.assembly.dir}/conf">
-      <ant:fileset dir="./conf/share">
-        <ant:include name="*.xml"/>
-        <ant:include name="*.dtd"/>
-      </ant:fileset>
-    </ant:copy>
   </postGoal>
 
 
@@ -58,14 +54,6 @@
       </ant:fileset>
     </ant:copy>
 
-    <!-- Copy configuration files -->
-    <j:set var="docsDest" value="${maven.docs.dest}"/>
-    <ant:copy todir="${maven.dist.src.assembly.dir}/conf">
-      <ant:fileset dir="./conf/share">
-        <ant:include name="*.xml"/>
-        <ant:include name="*.dtd"/>
-      </ant:fileset>
-    </ant:copy>
   </postGoal>
 
 

Added: struts/taglib/trunk/struts.jsl
URL: http://svn.apache.org/viewcvs/struts/taglib/trunk/struts.jsl?view=auto&rev=154112
==============================================================================
--- struts/taglib/trunk/struts.jsl (added)
+++ struts/taglib/trunk/struts.jsl Wed Feb 16 18:30:16 2005
@@ -0,0 +1,507 @@
+<?xml version="1.0"?>
+<!-- $Id: struts.jsl 51220 2003-12-11 20:08:07Z sraeburn $ -->
+<jsl:stylesheet select="$doc"
+  xmlns:define="jelly:define"
+  xmlns:j="jelly:core"
+  xmlns:jsl="jelly:jsl"
+  xmlns:log="jelly:log"
+  xmlns:util="jelly:util"
+  xmlns:x="jelly:xml"
+  xmlns:doc="doc"
+  xmlns="dummy" trim="false">
+  <jsl:template match="document" trim="false">
+    <j:useBean var="navbean" class="org.apache.maven.NavBean"/>
+    <j:set var="location" value="${outFile.substring(destdir.length())}"/>
+    <util:replace var="location" oldChar="\" newChar="/" value="${location}"/>
+
+    <!-- Stores location for publish date / version -->
+    <j:set var="date">${maven.xdoc.date}</j:set>
+      
+    <j:setProperties 
+        object="${navbean}"
+        document="${doc}"
+        location="${location}"/>
+    
+    <x:doctype name="html"
+      publicId="-//W3C//DTD XHTML 1.0 Transitional//EN"
+      systemId="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
+
+    <html>
+      <head>
+        <j:set var="docTitle">
+          <x:expr select="./properties/title"/>
+        </j:set>
+        <x:if select="$nav/title">
+          <title>
+            <x:expr select="$nav/title"/> - ${docTitle}
+          </title>
+        </x:if>
+        <x:if select="not($nav/title)">
+          <title>${pom.name} - ${docTitle}</title>
+        </x:if>
+        
+        <style type="text/css"><![CDATA[
+          @import url("${relativePath}/style/struts.css");
+          @import url("${relativePath}/style/maven.css");
+        ]]></style>
+        
+        <util:file var="projectCssFile" name="${maven.docs.src}/style/project.css"/>
+        <j:if test="${projectCssFile.exists()}">
+          <style type="text/css"><![CDATA[
+            @import url("${relativePath}/style/project.css");
+          ]]></style>
+        </j:if>
+        
+        <!-- FIXME: once someone works out how to stop this breaking
+        <x:element name="script"><x:attribute name="type">text/javascript</x:attribute>
+          if (document.layers) {
+                document.writeln(''+
+                '<link rel="stylesheet" type="text/css" href="${relativePath}/style/ns4_only.css" media="screen" /><link rel="stylesheet" type="text/css" href="${relativePath}/style/maven_ns4_only.css" media="screen"/>');
+              }
+            </x:element>
+        -->
+        <link rel="stylesheet" type="text/css" href="${relativePath}/style/print.css" media="print"/>
+        <meta http-equiv="Content-Type" content="text/html; charset=${outputencoding}"></meta>
+        <x:forEach var="author" select="./properties/author">
+          <meta name="author" content="${author.text}"/>
+          <meta name="email" content="${author.attribute('email').value}"/>
+        </x:forEach>
+        
+        <jsl:applyTemplates select="$doc/document/head/*"/>
+        
+      </head>
+
+      <x:element name="body"><j:whitespace trim="true">
+        <x:attribute name="class">composite</x:attribute>
+        <x:forEach var="attr" select="$doc/document/body/@*">
+          <x:attribute name="${attr.name}">${attr.value}</x:attribute>
+        </x:forEach>
+        </j:whitespace>
+
+        <div id="banner">
+          <table border="0" cellspacing="0" cellpadding="8" width="100%">
+            <tr>
+              <!-- organization logo -->
+              <td>
+                <j:set var="logo" value="${pom.organization.logo}"/>
+                <j:if test="${!empty(logo)}">
+                  <!-- set url to org or project url -->
+                  <j:set var="url" value="${pom.organization.url}"/>
+                  <j:if test="${!empty(url)}">
+                    <j:set var="home" value="${pom.organization.url}"/>
+                  </j:if>
+                  <j:if test="${empty(url)}">
+                    <j:set var="home" value="${pom.url}"/>
+                  </j:if>
+                  <!-- set image to relative or complete -->
+                  <j:set var="image" value="${pom.organization.logo}"/>
+                  <j:if test="${!image.startsWith('http://')}">
+                    <j:set var="image" value="${relativePath}${image}"/>
+                  </j:if>
+                  <a href="${home}">
+                    <img src="${image}" align="left" alt="${pom.organization.name}" border="0"/>
+                  </a>
+                </j:if>
+              </td>
+
+              <!-- project logo and link -->
+              <td>
+                <div align="right" id="login">
+                  <j:set var="logo" value="${pom.logo}"/>
+                  <j:if test="${logo != null and logo != ''}">
+                    <!-- set image to relative or complete -->
+                    <j:set var="image" value="${pom.logo}"/>
+                    <j:if test="${!image.startsWith('http://')}">
+                      <j:set var="image" value="${relativePath}${image}"/>
+                    </j:if>
+
+                    <a href="${pom.url}">
+                      <img src="${image}" align="right" alt="${pom.name}" border="0"/>
+                    </a>
+                  </j:if>
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+        <div id="breadcrumbs">
+          <table border="0" cellspacing="0" cellpadding="4" width="100%">
+            <tr>
+              <j:if test="${date == 'left'}">
+                <j:set var="version" value="${maven.xdoc.version}"/>
+                <td>Last published: ${build.date}
+                  <j:if test="${!empty(version)}">| Doc for ${version}</j:if>
+                </td>
+              </j:if>
+              <td>
+                <div align="right">
+                  <j:if test="${date == 'right'}">
+                    Last published: ${build.date}
+                    <x:if select="$nav/body/links">|</x:if>
+                  </j:if>
+                  <!-- render links -->
+                  <x:if select="$nav/body/links">
+                    <jsl:applyTemplates select="$nav/body/links"/>
+                  </x:if>
+                  <x:if select="not($nav/body/links)">
+                    <!-- FIXME &nbsp; -->
+                  </x:if>
+                </div>
+              </td>
+            </tr>
+          </table>
+        </div>
+        <!-- Body of the page -->
+        <table border="0" cellspacing="0" cellpadding="8" width="100%"> <!--id="main" -->
+          <tr valign="top">
+            <td id="leftcol" width="20%">
+              <div id="navcolumn">
+                <j:if test="${date == 'navigation-top'}">
+                  <div>
+                    <small>Last published: ${build.date}</small>
+                  </div>
+                </j:if>
+
+                <x:if select="$nav">
+                  <jsl:applyTemplates select="$nav/body/menu[not(@type) | @type='header'] | $nav/body/search"/>
+                </x:if>
+
+                <jsl:applyTemplates select="$projectNav/body/menu"/>
+                
+                <!-- Standard Maven Navigation -->
+                <j:set var="fileName">${file}</j:set>
+
+                <j:set var="poweredbyimage">${maven.xdoc.poweredby.image}</j:set>
+                <j:set var="poweredbytitle">${maven.xdoc.poweredby.title}</j:set>
+                <j:set var="poweredbyurl">${maven.xdoc.poweredby.url}</j:set>
+                <j:if test="${!empty(poweredbyimage)}">
+                    <div style="margin-top: 20px; width: 100%; text-align: center;">
+                        <a href="${poweredbyurl}" title="${poweredbytitle}"><img alt="${maven.xdoc.poweredby.title}" style="border: 1px solid black" src="${relativePath}/images/logos/${poweredbyimage}"/></a>
+                    </div>
+                </j:if>
+              
+                <j:if test="${date == 'navigation-bottom'}">
+                  <div>
+                    <small>Last published: ${build.date}</small>
+                  </div>
+                </j:if>
+              </div>
+            </td>
+            <td rowspan="2">
+              <div id="bodycol">
+                <!-- Insert MAIN body here -->
+                <div class="app">
+                  <!-- FIXME really shouldn't use $doc, but jelly loses it's context again -->
+                  <jsl:applyTemplates select="$doc/document/body/section"/>
+                  <jsl:applyTemplates select="$doc/document/body/glossary" />
+                  <jsl:applyTemplates select="$doc/document/body/release" />
+                  <jsl:applyTemplates select="$doc/document/body/changelog" />
+                  <jsl:applyTemplates select="$doc/document/body/taskList" />
+                  <jsl:applyTemplates select="$doc/document/body/goals" />
+                </div>
+              </div>
+            </td>
+          </tr>
+        </table>
+        <div id="footer">
+          <table style='width:100%' border="0" cellspacing="0" cellpadding="4">
+            <jsl:applyTemplates select="$nav/body/footer"/>
+            <tr>
+              <td>
+                <j:if test="${!empty(pom.organization.name)}">
+                  <j:if test="${!empty(pom.inceptionYear)}">
+                    <j:if test="${pom.inceptionYear == mavenCurrentYear}">
+                      &#169; ${mavenCurrentYear}, ${pom.organization.name}
+                    </j:if>
+                    <j:if test="${pom.inceptionYear != mavenCurrentYear}">
+                      &#169; ${pom.inceptionYear}-${mavenCurrentYear}, ${pom.organization.name}
+                    </j:if>
+                  </j:if>
+                  <j:if test="${empty(pom.inceptionYear)}">
+                    &#169; ${mavenCurrentYear}, ${pom.organization.name}
+                  </j:if>
+                </j:if>
+
+                <j:if test="${date == 'bottom'}">
+                  - Last published: ${build.date}
+                </j:if>
+              </td>
+              <j:if test="${date == 'bottom-right'}">
+                <td style='width: auto; text-align:right'>Last published: ${build.date}</td>
+              </j:if>
+            </tr>
+          </table>
+        </div>
+      </x:element>
+    </html>
+  </jsl:template>
+
+  <!-- process the properties of the doc -->
+  <jsl:template match="properties" trim="false">
+    <!-- stick head block here later -->
+  </jsl:template>
+
+  <!-- Process a menu for the navigation bar -->
+  <jsl:template match="menu" trim="false">
+    <div>
+      <strong><x:expr select="@name"/></strong>
+      <jsl:applyTemplates select="item"/>
+    </div>
+  </jsl:template>
+
+  <jsl:template match="item" trim="false">
+    <x:set var="item" select="."/>
+    <x:set var="_name" select="string(@name)"/>
+    <x:set var="_link" select="string(@href)"/>
+    <x:set var="_img" select="string(@img)"/>
+    <x:set var="_childCount" select="count(./item)"/>
+    <j:set var="_isCollapsed" value="${navbean.isCollapsed(item.get(0))}"/>
+    <j:set var="_state" value="none"/>
+    
+    <j:if test="${_childCount.intValue() gt 0}">
+        <j:if test="${!_isCollapsed}">
+          <j:set var="_state" value="expanded"/>
+        </j:if>
+        <j:if test="${_isCollapsed}">
+          <j:set var="_state" value="collapsed"/>
+        </j:if>
+    </j:if>
+           
+    
+    <div>
+      <small>
+        <j:if test="${navbean.isSelected(item.get(0))}">
+            <b><doc:itemLink name="${_name}" link="${_link}" img="${_img}" state="${_state}"/></b>
+        </j:if>
+        <j:if test="${!navbean.isSelected(item.get(0))}">
+            <doc:itemLink name="${_name}" link="${_link}" img="${_img}" state="${_state}"/>
+        </j:if>
+      </small>
+      <j:if test="${!navbean.isCollapsed(item.get(0))}">
+        <jsl:applyTemplates select="item"/>
+      </j:if>
+    </div>
+  </jsl:template>
+
+  <!-- Process the breadcrumb navbar -->
+  <jsl:template match="links" trim="false">
+    <j:set var="linkCount" value="1"/>
+    <x:forEach var="link" select="item">
+      <j:if test="${linkCount != 1}">|</j:if>
+      <j:set var="_name"><x:expr select="@name"/></j:set>
+      <j:set var="_link"><x:expr select="@href"/></j:set>
+      <doc:itemLink name="${_name}" link="${_link}"/>
+      <j:set var="linkCount" value="${1+linkCount}"/>
+    </x:forEach>
+  </jsl:template>
+
+  <!-- Google site search -->
+  <jsl:template match="search" trim="false">
+    <!-- Search code: http://www.google.com/searchcode.html -->
+    <!-- Google logos: http://www.google.com/stickers.html -->
+    <!-- Terms: http://www.google.com./services/terms_free.html -->
+    <div>
+      <strong>Search ${pom.name}</strong>
+      <form method="get" action="http://www.google.com/search">
+        <a class="navlink" href="http://www.google.com">
+          <img src="http://www.google.com/logos/Logo_25wht.gif" 
+               alt="Google" border="0" />
+        </a><p/>
+        <j:set var="siteURL" value="${pom.url}"/>
+        <!-- google fails on urls that end with / -->
+        <j:if test="${siteURL.endsWith('/')}">
+          <j:set var="URLLength" value="${siteURL.length() - 1}"/>
+          <j:set var="siteURL" value="${siteURL.substring(0, URLLength.intValue())}"/>
+        </j:if>
+        <input type="text" size="15" name="q" maxlength="255" value=""/>
+        <input type="submit" value="Go" name="btnG"/>
+        <input type="hidden" name="domains" value="${siteURL}"/>
+        <input type="hidden" id="search" name="sitesearch" value="${siteURL}"/>
+      </form>
+    </div>
+  </jsl:template>
+
+  <!-- process a documentation section -->
+  <jsl:template match="section" trim="false">
+    <div class="h3">
+      <j:set var="_sectionName"><x:expr select="@name"/></j:set>
+      <j:if test="${!empty(_sectionName)}">
+        <h3>
+          <a name="${_sectionName}">${_sectionName}</a>
+        </h3>
+      </j:if>
+      <jsl:applyTemplates select="*"/>
+    </div>
+  </jsl:template>
+
+  <jsl:template match="subsection" trim="false">
+    <div class="h4">
+      <j:set var="_sectionName"><x:expr select="@name"/></j:set>
+      <j:if test="${!empty(_sectionName)}">
+        <h4>
+          <a name="${_sectionName}">${_sectionName}</a>
+        </h4>
+      </j:if>
+      <jsl:applyTemplates select="*"/>
+    </div>
+  </jsl:template>
+
+  <jsl:template match="source" trim="false">
+    <div id="source">
+      <pre><x:expr select="."/></pre>
+    </div>
+  </jsl:template>
+
+  <jsl:template match="footer" trim="false">
+    <tr>
+      <td>
+        <jsl:applyTemplates select="*"/>
+      </td>
+    </tr>
+  </jsl:template>
+
+  <jsl:template match="table" trim="false">
+    <j:set var="rowcount" value="0"/>
+    <table cellpadding="3" cellspacing="2" border="1" width="100%">
+      <jsl:applyTemplates select="*"/>
+    </table>
+  </jsl:template>
+
+  <jsl:template match="tr" trim="false">
+    <j:choose>
+      <j:when test="${rowMode == 'a'}">
+        <j:set var="rowMode" value="b"/>
+      </j:when>
+      <j:otherwise>
+        <j:set var="rowMode" value="a"/>
+      </j:otherwise>
+    </j:choose>
+
+    <!-- copy attributes FIXME: Shouldn't this only be colspan|rowspan? -->
+    <x:element name="tr"><j:whitespace trim="true">
+      <x:attribute name="class">${rowMode}</x:attribute>
+      <x:forEach var="attr" select="@*">
+        <x:attribute name="${attr.name}">${attr.value}</x:attribute>
+      </x:forEach>
+      <jsl:applyTemplates select="*"/>
+</j:whitespace></x:element>
+  </jsl:template>
+
+  <!--************************-->
+  <!-- glossary documentation -->
+  <!--************************-->
+  <jsl:template match="glossary" trim="false">
+    <jsl:applyTemplates select="glossary-entries/glossary-entry" />
+  </jsl:template>
+      
+  <jsl:template match="glossary-entry" trim="false">
+    <strong><x:expr select="name" /></strong>
+    <br/>
+    <x:expr select="definition" />
+    <p/>
+  </jsl:template>
+
+      <!--************************-->
+      <!-- goals documentation    -->
+      <!--************************-->
+      <jsl:template match="goals" trim="false">
+        <!-- reset row alternation -->
+        <j:set var="rowMode" value="" />
+        <div class="h3">
+          <h3><a name="Goals">Goals</a></h3>
+          <table>
+            <tr width='100%'><th>Goal</th><th>Description</th></tr>
+            <jsl:applyTemplates select="goal"/>
+          </table>
+        </div>
+      </jsl:template>
+      
+      <!-- a goal -->
+        <!-- FIXME: this is copied from tr - there must be a way of
+             calling templates in jsl? -->
+      <jsl:template match="goal" trim="false">
+        <j:choose>
+          <j:when test="${rowMode == 'a'}">
+            <j:set var="rowMode" value="b"/>
+          </j:when>
+          <j:otherwise>
+            <j:set var="rowMode" value="a"/>
+          </j:otherwise>
+        </j:choose>
+        
+        <x:element name="tr"><j:whitespace trim="true">
+          <x:attribute name="class">${rowMode}</x:attribute>
+          <j:set var="_goalName"><x:expr select="./name" /></j:set>
+          <td width='20%'><a name="${_goalName}">${_goalName}</a></td>
+          <td width='80%'><jsl:applyTemplates select="description" /></td>
+</j:whitespace></x:element>
+      </jsl:template>   
+      
+      <jsl:template match="description">
+        <jsl:copy trim="false">
+          <jsl:applyTemplates trim="false"/>
+        </jsl:copy>
+      </jsl:template>
+
+      <!--************************-->
+      <!-- changelog documentation-->
+      <!--************************-->
+      <jsl:template match="changelog" trim="false">
+        <j:set var="rowMode" value="" />
+        <table width="100%">
+          <tr>
+            <th>Date</th><th>Author</th><th>Files/Message</th>
+          </tr>
+          <jsl:applyTemplates select="changelog-entry" />
+        </table>
+      </jsl:template>
+
+      <!-- transform a changelog entry -->
+      <!-- FIXME: tr code copied from above -->
+      <jsl:template match="changelog-entry" trim="false">
+        <j:choose>
+          <j:when test="${rowMode == 'a'}">
+            <j:set var="rowMode" value="b"/>
+          </j:when>
+          <j:otherwise>
+            <j:set var="rowMode" value="a"/>
+          </j:otherwise>
+        </j:choose>
+        
+        <x:element name="tr"><j:whitespace trim="true">
+          <x:attribute name="class">${rowMode}</x:attribute>
+          
+          <td><x:expr select="date" /> <x:expr select="time" /></td>
+          <td><x:expr select="author"/></td>
+          <td><jsl:applyTemplates select="*" />
+            <pre><x:expr select="msg"/></pre>
+          </td>
+</j:whitespace></x:element>
+      </jsl:template>
+
+      <jsl:template match="file">
+        <j:set var="url">${pom.repository.url}<x:expr select="name"/></j:set>
+        <j:set var="revUrl">${url}?<x:expr select="revision"/>&amp;content-type=text/vnd.viewcvs-markup</j:set>
+        <a href="${url}"><x:expr select="name"/></a> - 
+        <a href="${revUrl}">v<x:expr select="revision"/></a>
+        <br/>
+      </jsl:template>
+
+  <!-- remove the space at the end of parsed "a" anchors -->
+  <jsl:template match="a" trim="false">
+    <jsl:copy trim="true">
+      <jsl:applyTemplates trim="true"/>
+    </jsl:copy>
+  </jsl:template>
+
+  <!-- copy any other elements through -->
+  <jsl:template match="*" trim="false"><jsl:copy trim="false">
+      <jsl:applyTemplates trim="false"/></jsl:copy></jsl:template>
+
+   <!-- element values don't pass through as text -->
+   <jsl:template match="@*"/>
+
+   <!-- CDATA and text nodes pass-thru -->
+   <jsl:template match="text()"><x:expr select="."/></jsl:template>
+
+</jsl:stylesheet>

Propchange: struts/taglib/trunk/struts.jsl
------------------------------------------------------------------------------
    svn:executable = *



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org