craigmcc    01/01/19 17:08:57

  Modified:    src/doc/stylesheets userGuide.xsl
               src/doc/userGuide building_controller.xml building_model.xml
                        building_view.xml index.xml introduction.xml
                        resources.xml
  Added:       src/doc/userGuide project.xml
  Log:
  Clean up the stylesheet for the User's Guide so that the pages are
  visually similar to the remainder of the Struts documentation, and
  include quick links to the major sections.
  
  TODO: There are still some spacing issues on some of the <pre> sections.
  I suspect it is due to someone's editors inserting tabs instead of spaces.
  
  Revision  Changes    Path
  1.3       +152 -48   jakarta-struts/src/doc/stylesheets/userGuide.xsl
  
  Index: userGuide.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/stylesheets/userGuide.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- userGuide.xsl     2001/01/10 20:20:21     1.2
  +++ userGuide.xsl     2001/01/20 01:08:56     1.3
  @@ -1,59 +1,163 @@
   <?xml version="1.0" encoding="ISO-8859-1"?>
  -<!-- Content Stylesheet for Struts Documentation -->
  -<!-- $Id: userGuide.xsl,v 1.2 2001/01/10 20:20:21 craigmcc Exp $ -->
  +<!-- Content Stylesheet for Struts User's Guide -->
  +<!-- $Id: userGuide.xsl,v 1.3 2001/01/20 01:08:56 craigmcc Exp $ -->
   
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     version="1.0">
   
  +
     <!-- Output method -->
     <xsl:output method="html" indent="no"/>
     
  +
  +  <!-- Defined variables -->
  +  <xsl:variable name="body-bg"   select="'#ffffff'"/>
  +  <xsl:variable name="body-fg"   select="'#000000'"/>
  +  <xsl:variable name="body-link" select="'#023264'"/>
  +  <xsl:variable name="banner-bg" select="'#023264'"/>
  +  <xsl:variable name="banner-fg" select="'#ffffff'"/>
  +
  +
  +  <!-- Process an entire document into an HTML page -->
     <xsl:template match="document">
  -  
  -  <html>
  -  <head>
  -  <title><xsl:value-of select="./properties/title" /></title>
  -  </head>
  -  <body>
  -  
  -             <xsl:apply-templates />
  -  
  -  </body>
  -  </html>
  -  
  +    <xsl:variable name="project"
  +                select="document('../userGuide/project.xml')/project"/>
  +    <html>
  +    <head>
  +    <meta name="author" content="{properties/author/.}"/>
  +    <!-- <link rel="stylesheet" type="text/css" href="default.css"/> -->
  +    <xsl:choose>
  +      <xsl:when test="properties/title">
  +        <title><xsl:value-of select="properties/title"/></title>
  +      </xsl:when>
  +      <xsl:when test="body/title">
  +        <title><xsl:value-of select="body/title"/></title>
  +      </xsl:when>
  +      <xsl:otherwise>
  +        <title><xsl:value-of select="$project/title"/></title>
  +      </xsl:otherwise>
  +    </xsl:choose>
  +    </head>
  +
  +    <body bgcolor="{$body-bg}" text="{$body-fg}" link="{$body-link}"
  +          alink="{$body-link}" vlink="{$body-link}">
  +
  +    <table border="0" width="100%" cellspacing="5">
  +
  +      <tr><td colspan="2">
  +        <a href="http://jakarta.apache.org">
  +        <img src="../images/jakarta-logo.gif" align="left" border="0"/>
  +        </a>
  +        <img src="../images/struts.gif" align="right" border="0"/>
  +      </td></tr>
  +
  +      <tr><td colspan="2">
  +        <hr/>
  +      </td></tr>
  +
  +      <tr>
  +        <td width="120" valign="top">
  +          <xsl:apply-templates select="$project"/>
  +        </td>
  +
  +        <td valign="top">
  +          <xsl:apply-templates select="body"/>
  +        </td>
  +      </tr>
  +
  +      <tr><td colspan="2">
  +        <hr/>
  +      </td></tr>
  +
  +      <tr><td colspan="2">
  +        <div align="center"><font color="{$body-link}" size="-1"><em>
  +        Copyright &#169; 2000, Apache Software Foundation
  +        </em></font></div>
  +        <img src="../images/struts-power.gif" align="right" border="0"/>
  +      </td></tr>
  +
  +    </table>
  +    </body>
  +    </html>
  +
     </xsl:template>
  -  
  -  
  -     <xsl:template match="chapter">
  -                     
  -             <xsl:element name="a">
  -                     <xsl:attribute name="name"><xsl:value-of select="@href" 
/></xsl:attribute>
  -             </xsl:element>
  -             <h2><xsl:value-of select="@name" /></h2>
  -             
  -             <xsl:apply-templates select="section" />
  -     </xsl:template>
  -                     
  -     <xsl:template match="section">
  -             <xsl:element name="a">
  -                     <xsl:attribute name="name"><xsl:value-of select="@href" 
/></xsl:attribute>
  -             </xsl:element>
  -             <h3><xsl:value-of select="@name" /></h3>
  -<!--
  -                <xsl:copy>
  -                    <xsl:apply-templates select="*|@" />
  -                </xsl:copy>
  --->
  -                 <xsl:apply-templates/>
  -     </xsl:template>
  -
  -        <xsl:template match="properties">
  -        </xsl:template>
  -        
  -          <!-- Process everything else by just passing it through -->
  -          <xsl:template match="*|@*">
  -            <xsl:copy>
  -              <xsl:apply-templates select="@*|*|text()"/>
  -            </xsl:copy>
  -          </xsl:template>
  +
  +
  +  <!-- Process an entire chapter (assumes one chapter per page) -->
  +  <xsl:template match="chapter">
  +
  +    <xsl:element name="a">
  +      <xsl:attribute name="name"><xsl:value-of select="@href" /></xsl:attribute>
  +    </xsl:element>
  +    <!-- <h2><xsl:value-of select="@name" /></h2> -->
  +
  +    <xsl:apply-templates select="section" />
  +
  +  </xsl:template>
  +
  +
  +  <!-- Process a menu for the navigation bar -->
  +  <xsl:template match="menu">
  +    <table border="0" cellspacing="5">
  +      <tr>
  +        <th colspan="2" align="left">
  +          <font color="{body-link}"><strong>
  +            <xsl:value-of select="@name"/>
  +          </strong></font>
  +        </th>
  +      </tr>
  +      <xsl:apply-templates/>
  +    </table>
  +  </xsl:template>
  +
  +
  +  <!-- Process a menu item for the navigation bar -->
  +  <xsl:template match="item">
  +    <tr>
  +      <td align="center" width="15"></td>
  +      <td>
  +        <font size="-1">
  +        <xsl:variable name="href">
  +          <xsl:value-of select="@href"/>
  +        </xsl:variable>
  +        <a href="{$href}"><xsl:value-of select="@name"/></a>
  +        </font>
  +      </td>
  +    </tr>
  +  </xsl:template>
  +
  +
  +  <!-- Process a documentation section -->
  +  <xsl:template match="section">
  +    <xsl:choose>
  +      <xsl:when test="@href">
  +        <xsl:variable name="href">
  +          <xsl:value-of select="@href"/>
  +        </xsl:variable>
  +        <a name="{$href}"></a>
  +      </xsl:when>
  +    </xsl:choose>
  +    <table border="0" cellspacing="5" cellpadding="5" width="100%">
  +      <tr><td bgcolor="{$banner-bg}">
  +        <font color="{$banner-fg}" face="arial,helvetica,sanserif" size="+1">
  +          <strong><xsl:value-of select="@name"/></strong>
  +        </font>
  +      </td></tr>
  +      <tr><td>
  +        <blockquote>
  +          <xsl:apply-templates/>
  +        </blockquote>
  +      </td></tr>
  +    </table>
  +  </xsl:template>
  +
  +
  +  <!-- Process everything else by just passing it through -->
  +  <xsl:template match="*|@*">
  +    <xsl:copy>
  +      <xsl:apply-templates select="@*|*|text()"/>
  +    </xsl:copy>
  +  </xsl:template>
  +
  +
   </xsl:stylesheet>
  
  
  
  1.6       +1 -1      jakarta-struts/src/doc/userGuide/building_controller.xml
  
  Index: building_controller.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/building_controller.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- building_controller.xml   2001/01/12 19:58:51     1.5
  +++ building_controller.xml   2001/01/20 01:08:56     1.6
  @@ -4,7 +4,7 @@
     <properties>
       <author>Craig R. McClanahan</author>
       <author>Mike Schachter</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Building Controller Components</title>
     </properties>
     
     <body>  
  
  
  
  1.7       +1 -1      jakarta-struts/src/doc/userGuide/building_model.xml
  
  Index: building_model.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/building_model.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- building_model.xml        2001/01/12 19:58:51     1.6
  +++ building_model.xml        2001/01/20 01:08:56     1.7
  @@ -4,7 +4,7 @@
     <properties>
       <author>Craig R. McClanahan</author>
       <author>Mike Schachter</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Building Model Components</title>
     </properties>
     
     <body>  
  
  
  
  1.10      +1 -1      jakarta-struts/src/doc/userGuide/building_view.xml
  
  Index: building_view.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/building_view.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- building_view.xml 2001/01/18 00:04:52     1.9
  +++ building_view.xml 2001/01/20 01:08:56     1.10
  @@ -4,7 +4,7 @@
     <properties>
       <author>Craig R. McClanahan</author>
       <author>Mike Schachter</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Building View Components</title>
     </properties>
     
     <body>  
  
  
  
  1.2       +2 -2      jakarta-struts/src/doc/userGuide/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/index.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.xml 2001/01/20 00:32:43     1.1
  +++ index.xml 2001/01/20 01:08:56     1.2
  @@ -6,14 +6,14 @@
       <author>Mike Schachter</author>
       <author>Larry McCay</author>
       <author>Ted Husted</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Table of Contents</title>
     </properties>
   
     <body>
   
       <chapter name="0. Contents" href="contents">
   
  -      <section name="0.1 Table of Contents" href="toc">
  +      <section name="Table of Contents" href="toc">
   
           <ul>
               <li><a href="introduction.html">1. Introduction</a>
  
  
  
  1.8       +1 -1      jakarta-struts/src/doc/userGuide/introduction.xml
  
  Index: introduction.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/introduction.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- introduction.xml  2001/01/20 00:32:43     1.7
  +++ introduction.xml  2001/01/20 01:08:56     1.8
  @@ -6,7 +6,7 @@
       <author>Mike Schachter</author>
       <author>Larry McCay</author>
       <author>Ted Husted</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Introduction</title>
     </properties>
   
     <body>
  
  
  
  1.3       +1 -1      jakarta-struts/src/doc/userGuide/resources.xml
  
  Index: resources.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/src/doc/userGuide/resources.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- resources.xml     2001/01/11 02:41:34     1.2
  +++ resources.xml     2001/01/20 01:08:56     1.3
  @@ -3,7 +3,7 @@
   
     <properties>
       <author>Mike Schachter</author>
  -    <title>The Struts Framework Project</title>
  +    <title>The Struts User's Guide - Resources</title>
     </properties>
   
     <body>
  
  
  
  1.1                  jakarta-struts/src/doc/userGuide/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <project name="Struts User's Guide"
           href="http://jakarta.apache.org/struts/userGuide"
          image="../images/struts.gif">
  
      <title>Struts User's Guide</title>
  
      <menu name="Quick Links">
        <item name="Home"                  href="../index.html"/>
        <item name="Table of Contents"     href="index.html"/>
        <item name="Introduction"          href="introduction.html"/>
        <item name="Model Components"      href="building_model.html"/>
        <item name="View Components"       href="building_view.html"/>
        <item name="Controller Components" href="building_controller.html"/>
        <item name="Resources"             href="resources.html"/>
      </menu>
  
  </project>
  
  
  

Reply via email to