tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/xdocs build.properties.samples style.css.in style.xsl.in AJPv13.xml style.css style.xsl
Date Sat, 01 Jun 2002 21:28:41 GMT
jfclere     2002/06/01 14:28:41

  Modified:    jk       build.xml
               jk/xdocs AJPv13.xml
  Added:       jk/xdocs build.properties.samples style.css.in style.xsl.in
  Removed:     jk/xdocs style.css style.xsl
  Log:
  Change the look of the protocol documentation.
  Change the style so that it uses the jakarta-site2 one.
  
  Revision  Changes    Path
  1.42      +47 -2     jakarta-tomcat-connectors/jk/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/build.xml,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- build.xml	26 May 2002 21:43:36 -0000	1.41
  +++ build.xml	1 Jun 2002 21:28:41 -0000	1.42
  @@ -265,6 +265,9 @@
           <delete dir="${jk.build}/classes"/>
           <delete dir="${jk.build}/lib"/>
           <delete dir="${jk.build}/javadoc"/>
  +        <delete dir="${build.docs}"/>
  +        <delete file="${source.docs}/style.css"/>
  +        <delete file="${source.docs}/style.xsl"/>
       </target>
   
       <!-- It's better to call it directly with individual tags -->
  @@ -289,14 +292,56 @@
    
       <!-- Just jump out -->
       <fail message="Cannot find the Apache Xalan XSLT processor"/>
  -  </target>                                                                     
  +  </target>
  +
  +  <!-- builds the css and xls file from the css.in and xls.in -->
  +  <target name="docs.init">
  +    <property file="${source.docs}/build.properties"/>
  +
  +    <property name="body-bg"       value="#ffffff"/>
  +    <property name="body-fg"       value="#000000"/>
  +    <property name="body-link"     value="#525D76"/>
  +    <property name="banner-bg"     value="#525D76"/>
  +    <property name="banner-fg"     value="#ffffff"/>
  +    <property name="sub-banner-bg" value="#828DA6"/>
  +    <property name="sub-banner-fg" value="#ffffff"/>
  +    <property name="table-th-bg"   value="#039acc"/>
  +    <property name="table-td-bg"   value="#a0ddf0"/>
  +    <property name="source-color"  value="#023264"/>
  +
  +    <antcall target="docs.color">
  +      <param name="sourcefile" value="${source.docs}/style.css.in"/>
  +      <param name="destfile" value="${source.docs}/style.css"/>
  +    </antcall>
  +    <antcall target="docs.color">
  +      <param name="sourcefile" value="${source.docs}/style.xsl.in"/>
  +      <param name="destfile" value="${source.docs}/style.xsl"/>
  +    </antcall>
  +  </target>
  +
  +  <target name="docs.color">
  +    <copy file="${sourcefile}" tofile="${destfile}"/>
  +    <replace file="${destfile}" token="@body-bg@"       value="${body-bg}"/>
  +    <replace file="${destfile}" token="@body-fg@"       value="${body-fg}"/>
  +    <replace file="${destfile}" token="@body-link@"     value="${body-link}"/>
  +    <replace file="${destfile}" token="@banner-bg@"     value="${banner-bg}"/>
  +    <replace file="${destfile}" token="@banner-fg@"     value="${banner-fg}"/>
  +    <replace file="${destfile}" token="@sub-banner-bg@"
  +             value="${sub-banner-bg}"/>
  +    <replace file="${destfile}" token="@sub-banner-fg@"
  +             value="${sub-banner-fg}"/>
  +    <replace file="${destfile}" token="@table-th-bg@"   value="${table-th-bg}"/>
  +    <replace file="${destfile}" token="@table-td-bg@"   value="${table-td-bg}"/>
  +    <replace file="${destfile}" token="@source-color@"
  +             value="${source-color}"/>
  +  </target>
   
     <!--
       Generate documentation from the XML sources.
     -->
     <target
         name="docs"
  -      depends="docs.check"
  +      depends="docs.check,docs.init"
         description="Create Documentation">
    
       <!-- Create the directory where we're going to store the docs -->
  
  
  
  1.4       +60 -39    jakarta-tomcat-connectors/jk/xdocs/AJPv13.xml
  
  Index: AJPv13.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/xdocs/AJPv13.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- AJPv13.xml	29 May 2002 21:52:18 -0000	1.3
  +++ AJPv13.xml	1 Jun 2002 21:28:41 -0000	1.4
  @@ -1,8 +1,9 @@
   <?xml version="1.0"?> 
  -<document title="Apache JServ Protocol version 1.3">
  +<document>
     <properties>
       <title>Apache JServ Protocol version 1.3</title>
       <author email="danmil@shore.net">danmil@shore.net</author>
  +    <author email="jfrederic.clere@fujitsu-siemens.com">Jean-Frederic Clere</author>
     </properties>
   
   <section name="Intro">
  @@ -160,16 +161,17 @@
   </dl>
   </p>
   
  +<subsection name="Packet Size">
   <p>
  -<b>Packet Size</b> <br/> According to much of the code, the max packet
  +According to much of the code, the max packet
   size is 8 * 1024 bytes (8K).  The actual length of the packet is encoded in the
   header.
   </p>
  +</subsection>
   
  +<subsection name="Packet Headers">
   <p>
  -<b>Packet Headers</b>
  -
  -<br/> Packets sent from the server to the container begin with
  +Packets sent from the server to the container begin with
   <code>0x1234</code>.  Packets sent from the container to the server begin
   with <code>AB</code> (that's the ASCII code for A followed by the ASCII
   code for B).  After those first two bytes, there is an integer (encoded as
  @@ -180,11 +182,11 @@
   
   <table>
     <tr>
  -    <td6><b>Packet Format (Server->Container)</b></td6>
  +    <th colspan="6">Packet Format (Server->Container)</th>
     </tr>
   
     <tr>
  -    <td>Byte</td>
  +    <th>Byte</th>
       <td>0</td>
       <td>1</td>
       <td>2</td>
  @@ -193,21 +195,21 @@
     </tr>
   
     <tr>
  -    <td>Contents</td>
  +    <th>Contents</th>
       <td>0x12</td>
       <td>0x34</td>
  -    <td2>Data Length (n)</td2>
  +    <td colspan="2">Data Length (n)</td>
       <td>Data</td>
     </tr>
   </table>
   
   <table>
     <tr>
  -    <td6><b>Packet Format (Container->Server)</b></td6>
  +    <th colspan="6"><b>Packet Format (Container->Server)</b></th>
     </tr>
   
     <tr>
  -    <td>Byte</td>
  +    <th>Byte</th>
       <td>0</td>
       <td>1</td>
       <td>2</td>
  @@ -216,10 +218,10 @@
     </tr>
   
     <tr>
  -    <td>Contents</td>
  +    <th>Contents</th>
       <td>A</td>
       <td>B</td>
  -    <td2>Data Length (n)</td2>
  +    <td colspan="2">Data Length (n)</td>
       <td>Data</td>
     </tr>
   </table>
  @@ -235,9 +237,9 @@
   
   <table>
     <tr>
  -    <td>Code</td>
  -    <td>Type of Packet</td>
  -    <td>Meaning</td>
  +    <th>Code</th>
  +    <th>Type of Packet</th>
  +    <th>Meaning</th>
     </tr>
     <tr>
       <td>2</td>
  @@ -256,9 +258,9 @@
   server:
   <table>
     <tr>
  -    <td>Code</td>
  -    <td>Type of Packet</td>
  -    <td>Meaning</td>
  +    <th>Code</th>
  +    <th>Type of Packet</th>
  +    <th>Meaning</th>
     </tr>
     <tr>
       <td>3</td>
  @@ -288,6 +290,7 @@
   <p>
   Each of the above messages has a different internal structure, detailed below.
   </p>
  +</subsection>
   </section>
   
   <section name="Request Packet Structure">
  @@ -337,13 +340,17 @@
   determines whether or not the container looks for another packet
   immediately.
   </p><p>
  -Details of above
  -</p><p>
  -<b>request_prefix</b><br/>
  +Detailed description of the elements of Forward Request.
  +</p>
  +<subsection name="request_prefix">
  +<p>
   For all requests, this will be 2.
   See above for details on other <A HREF="#prefix-codes">prefix codes</A>.
  -</p><p>
  -<b>method</b><br/>
  +</p>
  +</subsection>
  +
  +<subsection name="method">
  +<p>
   The HTTP method, encoded as a single byte:
   
   <source>
  @@ -369,14 +376,18 @@
   UNCHECKOUT  20
   SEARCH      21
   </source>
  +</p>
  +</subsection>
   
  -</p><p>
  -<b>protocol, req_uri, remote_addr, remote_host, server_name, server_port, is_ssl</b><br/>
  +<subsection  name="protocol, req_uri, remote_addr, remote_host, server_name, server_port,
is_ssl">
  +<p>
     These are all fairly self-explanatory.  Each of these is required, and
     will be sent for every request.
  -</p><p>
  +</p>
  +</subsection>
   
  -<b>Headers</b><br/>
  +<subsection name="Headers">
  +<p>
     The structure of <code>request_headers</code> is the following:
     First, the number of headers <code>num_headers</code> is encoded.
     Then, a series of header name <code>req_header_name</code> / value
  @@ -388,8 +399,8 @@
     is as follows (all are case-sensitive):
   </p><p>
   <table>
  -  <tr><td>
  -    Name</td><td>Code value</td><td>Code name</td>
  +  <tr><th>
  +    Name</th><th>Code value</th><th>Code name</th>
     </tr><tr><td>
       accept</td><td>0xA001</td><td>SC_REQ_ACCEPT</td>
     </tr><tr><td>
  @@ -440,9 +451,10 @@
     the request has a body (a POST request, for example), and immediately
     reads a separate packet off the input stream to get that body.
   </p>
  +</subsection>
   
  +<subsection name="Optional Information">
   <p>
  -<b>Optional Information</b><br/>
   
     The list of attributes prefixed with a <code>?</code>
     (e.g. <code>?context</code>) are all optional.  For each, there is a
  @@ -505,6 +517,7 @@
   basic security, the container will only actually do the shutdown if the
   request comes from the same machine on which it's hosted.
   </p>
  +</subsection>
   
   </section>
   
  @@ -547,13 +560,16 @@
   </p>
   <p>
   Details:
  +</p>
   
  -</p><p>
  -<b>Send Body Chunk</b><br/>
  +<subsection name="Send Body Chunk">
  +<p>
     The chunk is basically binary data, and is sent directly back to the browser.
  -</p><p>
  +</p>
  +</subsection>
   
  -<b>Send Headers</b><br/>
  +<subsection name="Send Headers">
  +<p>
     The status code and message are the usual HTTP things (e.g. "200" and "OK").
     The response header names are encoded the same way the request header names are.
     See <A HREF="#header_encoding">above</A> for details about how the the
  @@ -575,16 +591,20 @@
   </p><p> 
     After the code or the string header name, the header value is immediately
     encoded.
  -</p><p>
  +</p>
  +</subsection>
   
  -<b>End Response</b><br/>
  +<subsection name="End Response">
  +<p>
     Signals the end of this request-handling cycle.  If the
     <code>reuse</code> flag is true (==1), this TCP connection can now be used
to
     handle new incoming requests.  If <code>reuse</code> is false (anything
     other than 1 in the actual C code), the connection should be closed.
  -</p><p>
  +</p>
  +</subsection>
   
  -<b>Get Body Chunk</b><br/>
  +<subsection name="Get Body Chunk">
  +<p>
     The container asks for more data from the request (if the body was
     too large to fit in the first packet sent over).  The server will send a
     body packet back with an amount of data which is the minimum of the
  @@ -595,6 +615,7 @@
     trying to read past the end of the body), the server will send back an
     "empty" packet, whch is a body packet with a payload length of 0.
   </p>
  +</subsection>
   </section>
   
   <section name="Questions I Have">
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/xdocs/build.properties.samples
  
  Index: build.properties.samples
  ===================================================================
  #
  # Define the color of html pages.
  #
  body-bg="#ffffff"
  body-fg="#000000"
  body-link="#525D76"
  banner-bg="#525D76"
  banner-fg="#ffffff"
  sub-banner-bg="#828DA6"
  sub-banner-fg="#ffffff"
  table-th-bg="#039acc"
  table-td-bg="#a0ddf0"
  source-color="#023264"
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/xdocs/style.css.in
  
  Index: style.css.in
  ===================================================================
  body {
    margin: 0;
    font-family: "verdana", "tahoma", "arial", "helvetica", sans-serif;
  }
  
  td.logo {
    background-color: @body-bg@;
    border-style: none;
  }
  
  td.nil {
    font-size: 1px;
  }
  
  
  td.head {
    background-color: #999999;
    border-style: solid;
    border-width: 1px;
    border-color: #cccccc #666666 #666666 #cccccc;
    font-weight: bold;
    font-size: smaller;
    color: #cccccc;
    padding: 2px;
    text-align: right;
  }
  
  a.head:link {
    text-decoration: none;
    color: #cccccc;
  }
  
  a.head:visited {
    text-decoration: none;
    color: #cccccc;
  }
  
  a.head:active {
    text-decoration: underline;
    color: #ffffff;
  }
  
  a.head:hover {
    text-decoration: underline;
    color: #ffffff;
  }
  
  table.menu {
    background-color: #cccccc;
    border-style: solid;
    border-width: 1px;
    border-color: #cccccc #999999 #999999 #999999;
    font-weight: bold;
    font-size: smaller;
    color: #000000;
    padding: 2px;
    text-align: left;
    margin-left: 5px;
  }
  
  a.menu:link {
    text-decoration: none;
    color: #333333;
  }
  
  a.menu:visited {
    text-decoration: none;
    color: #333333;
  }
  
  a.menu:active {
    text-decoration: underline;
    color: #000000;
  }
  
  a.menu:hover {
    text-decoration: underline;
    color: #000000;
  }
  
  td.body {
    background-color: #ffffff;
    border-style: none;
    padding: 4px;
    text-align: justify;
  }
  
  td.section {
    background-color: @banner-bg@;
    border-style: none;
    font-weight: bold;
    font-size: bigger;
    color: @banner-fg@;
    padding: 0px;
    text-align: left;
  }
  
  p.section {
    background-color: #ffffff;
    border-style: none;
    color: #000000;
    margin-left: 20px;
    margin-right: 10px;
    text-align: justify;
  }
  
  td.section {
    background-color: @sub-banner-bg@;
    border-style: none;
    font-weight: bold;
    font-size: bigger;
    color: @sub-banner-fg@;
    padding: 0px;
    text-align: left;
  }
  
  p.todo {
    background-color: #ffffff;
    border-style: none;
    color: #000000;
    margin-left: 20px;
    margin-right: 10px;
    text-align: justify;
    font-size: smaller;
  }
  
  p.screen {
    background-color: #ffffff;
    border-style: none;
    color: #000000;
    margin-left: 10px;
    margin-right: 0px;
    text-align: left;
  }
  
  div.screen {
    margin: 10px 0px 10px 20px;
    font-size: smaller;
    color: #666666;
  }
  
  em.screen {
    font-weight: normal;
    font-style: normal;
    color: #666666;
  }
  
  b.screen {
    font-weight: normal;
    font-style: normal;
    color: #0000ff;
  }
  
  b.code {
    font-weight: normal;
    font-style: normal;
    color: @source-color@;
  }
  
  
  
  1.1                  jakarta-tomcat-connectors/jk/xdocs/style.xsl.in
  
  Index: style.xsl.in
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/TR/xhtml1/strict">
  
    <!--
      Let's start by declaring HOW this stylesheet must behave.
    -->
    <xsl:output method="html" indent="no"
      doctype-public="-//W3C//DTD HTML 4.01//EN"
      doctype-system="http://www.w3.org/TR/html4/strict.dtd"/>
  
    <!-- Defined variables (non-overrideable) -->
    <xsl:variable name="body-bg"       select="'@body-bg@'"/>
    <xsl:variable name="body-fg"       select="'@body-fg@'"/>
    <xsl:variable name="body-link"     select="'@body-link@'"/>
    <xsl:variable name="banner-bg"     select="'@banner-bg@'"/>
    <xsl:variable name="banner-fg"     select="'@banner-fg@'"/>
    <xsl:variable name="sub-banner-bg"     select="'@sub-banner-bg@'"/>
    <xsl:variable name="sub-banner-fg"     select="'@sub-banner-fg@'"/>
    <xsl:variable name="table-th-bg"   select="'@table-th-bg@'"/>
    <xsl:variable name="table-td-bg"   select="'@table-td-bg@'"/>
  
    <!--
      Match the ROOT of the source document and process its "document" element.
    -->
    <xsl:template match="/">
      <xsl:apply-templates select="document"/>
    </xsl:template>
  
    <!--
      Match the roote "document" element, let's prepare the layout of the whole
      page.
    -->
    <xsl:template match="document">
      <html>
  
        <!--
          This is the page header, we want a title from this document title
          the <meta> copyright statement and all authors in "meta" headers.
        -->
        <head>
          <title>
            <xsl:value-of select="properties/title"/>
          </title>
          <meta name="copyright" content="1999-2002 The Apache Software Foundation"/>
          <xsl:for-each select="properties/author">
            <xsl:variable name="name">
              <xsl:value-of select="."/>
            </xsl:variable>
            <xsl:variable name="email">
              <xsl:value-of select="@email"/>
            </xsl:variable>
            <meta name="author" content="{$name}"/>
            <meta name="email" content="{$email}"/>
          </xsl:for-each>
          <link rel="stylesheet" type="text/css" href="style.css"/>
          <link rel="shortcut icon" href="images/tomcat.ico"/>
        </head>
  
        <!--
          This describes the layout of the page
        -->
        <body bgcolor="{$body-bg}" text="{$body-fg}" alink="{$body-link}"
              vlink="{$body-link}" link="{$body-link}">
          <a name="TOP"/>
  
          <table border="0" cellspacing="0" cellpadding="0" width="100%">
            <!--
              An empty row (thank you stupid IE).
            -->
            <tr height="1">
              <td width="150" bgcolor="{$body-bg}" height="1" class="nil">
                <img src="images/pixel.gif" border="0" width="150" height="1" vspace="0"
hspace="0"/>
              </td>
              <td width="*" bgcolor="{$body-bg}" height="1" class="nil">
                <img src="images/pixel.gif" border="0" width="570" height="1" vspace="0"
hspace="0"/>
              </td>
            </tr>
  
            <!--
              Our first row contains the Jakarta and the WebApp logos.
            -->
            <tr>
              <td bgcolor="{$body-bg}" class="logo" colspan="2" width="*">
                <table border="0" cellspacing="0" cellpadding="0" width="100%">
                  <tr>
                    <td align="left">
                      <img src="images/jakarta.gif" border="0" width="270" height="75"
align="left"/>
                    </td>
                    <td align="right">
                      <img src="images/mod_jk.jpeg" border="0" width="400" height="75"
align="right"/>
                    </td>
                  </tr>
                </table>
              </td>
            </tr>
  
            <!--
              A Turbine-style bar with links to the ASF, Jakarta and Tomcat.
            -->
            <tr>
              <td bgcolor="#999999" class="head" align="right" width="*" colspan="2">
                <nobr>
                  <a class="head" href="http://www.apache.org/">
                    <xsl:text>Apache Software Foundation</xsl:text>
                  </a> |
                  <a class="head" href="http://jakarta.apache.org/">
                    <xsl:text>Jakarta Project</xsl:text>
                  </a> |
                  <a class="head" href="http://jakarta.apache.org/tomcat/">
                    <xsl:text>Apache Tomcat</xsl:text>
                  </a>
                </nobr>
              </td>
            </tr>
  
            <!--
              Sidebar menu in a nested table and main content.
            -->
            <tr>
              <td bgcolor="#ffffff" width="150" valign="top">
  
                <!--
                  This is the sidebar menu, we have links to all documents specified
                  in "menu.idx", and if this is the current document, we go deeper
                  and write an index of the sections as well.
                -->
                <table border="0" width="150" cellspacing="0" cellpadding="0" class="menu">
                  <!-- Empty row, thanks IE -->
                  <tr height="1">
                    <td width="10" bgcolor="#cccccc" height="1" class="nil">
                      <img src="images/pixel.gif" border="0" width="10" height="1" vspace="0"
hspace="0"/>
                    </td>
                    <td width="140" bgcolor="#cccccc" height="1" class="nil">
                      <img src="images/pixel.gif" border="0" width="140" height="1" vspace="0"
hspace="0"/>
                    </td>
                  </tr>
  
                  <!--
                    All the files we want to have processed in the final pages are
                    stored (in order) in a file called "menu.idx". We set a variable
                    name with the current URL, and then we process each "document"
                    within the index.
                  -->
                  <xsl:variable name="root" select="document-location(.)"/>
                  <xsl:for-each select="document('menu.idx')/index/document">
                    <tr>
                      <td bgcolor="#cccccc" width="150" colspan="2">
                        <nobr>
                          <a class="menu">
                            <xsl:call-template name="converturi">
                              <xsl:with-param name="href" select="@href"/>
                            </xsl:call-template>
                          </a>
                        </nobr>
                      </td>
                    </tr>
  
                    <!--
                      Slightly more complicated, we use the document-location function
                      and compare against it to see whether we are in the same file or
                      not. If we actually are, we expand to the "section" level.
                    -->
                    <xsl:if test="$root = document-location(document(@href))">
                      <xsl:for-each select="document(@href)/document/section">
                        <tr>
                          <td bgcolor="#cccccc" width="10"/>
                          <td bgcolor="#cccccc" width="140">
                            <a class="menu" href="#section_{position()}">
                              <xsl:value-of select="@name"/>
                            </a>
                          </td>
                        </tr>
                      </xsl:for-each>
                    </xsl:if>
                  </xsl:for-each>
  
                  <!--
                    The last thing to put down in the index are the API docs,
                    both for C and for Java
                  -->
                  <tr>
                    <td bgcolor="#cccccc" width="150" colspan="2">
                      <nobr>
                        <a class="menu" href="./api-java/index.html">Java API Documentation</a>
                      </nobr>
                    </td>
                  </tr>
                  <tr>
                    <td bgcolor="#cccccc" width="150" colspan="2">
                      <nobr>
                        <a class="menu" href="./api-c/">C API Documentation</a>
                      </nobr>
                    </td>
                  </tr>
                </table>
              </td>
  
              <!--
                Done with the sidebar, now, do we want some content as well or WHAT?
              -->
              <td bgcolor="#ffffff" width="*" valign="top" class="body">
                <xsl:apply-templates select="section"/>
              </td>
            </tr>
          </table>
        </body>
      </html>
    </xsl:template>
  
    <!--
      Match the "author" tag only in mode "header" (meaning that we have to
      process it for the HTML <head> element.
    -->
    <xsl:template match="author" mode="header">
      <meta name="author" content="{text()}"/>
      <meta name="email" content="{@email}"/>
    </xsl:template>
  
    <!--
      Present a canonical representation of an author.
    -->
    <xsl:template match="author">
      <a href="mailto:{@email}"><xsl:value-of select="text()"/></a>
    </xsl:template>
  
    <xsl:template match="section">
      <a name="section_{position()}">
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr>
            <td bgcolor="{$banner-bg}" class="section" valign="top" align="left">
              <img src="images/corner.gif" valign="top" align="left" hspace="0" vspace="0"
border="0"/>
                <xsl:if test="string-length(description/text()) = 0">
                  <xsl:value-of select="@name"/>
                </xsl:if>
                <xsl:value-of select="description/text()"/>
            </td>
          </tr>
        </table>
      </a>
      <xsl:apply-templates select="subsection|p|ul|img|screen|todo"/>
      <br/>
    </xsl:template>
  
    <xsl:template match="subsection">
      <a name="subsection_{position()}">
        <table border="0" cellspacing="0" cellpadding="0" width="100%">
          <tr>
            <td bgcolor="{$sub-banner-bg}" class="subsection" valign="top" align="left">
              <img src="images/corner.gif" valign="top" align="left" hspace="0" vspace="0"
border="0"/>
                <xsl:if test="string-length(description/text()) = 0">
                  <xsl:value-of select="@name"/>
                </xsl:if>
                <xsl:value-of select="description/text()"/>
            </td>
          </tr>
        </table>
      </a>
      <xsl:apply-templates select="p|ul|img|screen|todo"/>
      <br/>
    </xsl:template>
  
    <xsl:template match="todo">
      <p class="todo">
        This paragraph has not been written yet, but <b>you</b> can contribute
to it.
        <xsl:if test="string-length(@note) > 0">
          The original author left a note attached to this TO-DO item:
          <b><xsl:value-of select="@note"/></b>
        </xsl:if>
      </p>
    </xsl:template>
  
    <xsl:template match="p">
      <p class="section"><xsl:apply-templates select="author|code|source|table|ul|br|b|a|text()"/></p>
    </xsl:template>
  
    <xsl:template match="b">
      <b><font color="#333333"><xsl:apply-templates select="text()"/></font></b>
    </xsl:template>
  
    <xsl:template match="br">
      <br/>
    </xsl:template>
  
    <xsl:template match="img">
      <p>
        <div align="center">
          <xsl:value-of select="@alt"/><br/>
          <img src="{@src}" alt="{@alt}" vspace="0" hspace="0" border="0"/>
        </div>
      </p>
    </xsl:template>
  
    <xsl:template match="ul">
      <ul><xsl:apply-templates select="li"/></ul>
    </xsl:template>
  
    <xsl:template match="li">
      <li><xsl:apply-templates select="br|b|a|text()"/></li>
    </xsl:template>
  
    <!-- JFC added -->
    <xsl:template match="table">
      <table border="1"><xsl:apply-templates select="tr"/></table>
    </xsl:template>
  
    <xsl:template match="tr">
      <tr><xsl:apply-templates select="th|td|td15|td13|td6|td5|td3|td2"/></tr>
    </xsl:template>
  
    <xsl:template match="th">
      <td bgcolor="{$table-th-bg}" valign="top">
          <xsl:if test="@colspan">
              <xsl:attribute name="colspan">
              <xsl:value-of select="@colspan"/>
              </xsl:attribute>
          </xsl:if>
          <xsl:apply-templates select="b|a|text()"/>
      </td>
    </xsl:template>
  
    <xsl:template match="td">
      <td bgcolor="{$table-td-bg}" valign="top" align="left">
          <xsl:if test="@colspan">
              <xsl:attribute name="colspan">
              <xsl:value-of select="@colspan"/>
              </xsl:attribute>
          </xsl:if>
          <xsl:apply-templates select="b|a|text()"/>
      </td>
    </xsl:template>
  
    <xsl:template match="source">
      <pre><xsl:apply-templates select="text()"/></pre>
    </xsl:template>
  
    <xsl:template match="code">
      <b class="code"><xsl:apply-templates select="text()"/></b>
    </xsl:template>
    <!-- end JFC -->
  
    <xsl:template match="screen">
      <p class="screen">
        <div align="center">
          <table width="80%" border="1" cellspacing="0" cellpadding="2" bgcolor="#cccccc">
            <tr>
              <td bgcolor="#cccccc">
                <xsl:apply-templates select="note|wait|type|read"/>
              </td>
            </tr>
          </table>
        </div>
      </p>
    </xsl:template>
    
    <xsl:template match="note">
      <div class="screen">
        <xsl:value-of select="text()"/>
      </div>
    </xsl:template>
  
    <xsl:template match="wait">
      <div class="screen">[...]</div>
    </xsl:template>
  
    <xsl:template match="type">
      <code>
        <nobr>
          <em class="screen">
            <xsl:text>[user@host] ~</xsl:text>
            <xsl:if test="string-length(@dir) > 0">
              <xsl:text>/</xsl:text>
              <xsl:value-of select="@dir"/>
            </xsl:if>
            <xsl:text> $ </xsl:text>
          </em>
          <xsl:if test="string-length(text()) > 0">
            <b class="screen"><xsl:value-of select="text()"/></b>
          </xsl:if>
        </nobr>
      </code>
      <br/>
    </xsl:template>
  
    <xsl:template match="read">
      <code>
        <nobr>
          <xsl:apply-templates select="text()|enter"/>
        </nobr>
      </code>
      <br/>
    </xsl:template>
  
    <xsl:template match="enter">
      <b class="screen"><xsl:value-of select="text()"/></b>
    </xsl:template>
  
    <xsl:template match="a">
      <b>
        <a>
          <xsl:call-template name="converturi">
            <xsl:with-param name="href" select="@href"/>
            <xsl:with-param name="text" select="text()"/>
            <xsl:with-param name="attr" select="'href'"/>
          </xsl:call-template>
        </a>
      </b>
    </xsl:template>
  
    <!--
      Convert the name of the matching "href" attribute (if needed) from
      "file.xml#anchor" to "file.html#anchor", and insert the title of
      the target document as the only text child of the resulting html
      <a /> tag. (Of course, don't convert fully qualified URIs).
    -->
    <xsl:template name="converturi">
      <xsl:param name="attr" select="'href'"/>
      <xsl:param name="href" select="''"/>
      <xsl:param name="text" select="''"/>
  
      <xsl:choose>
      
        <!--
          If the "href" parameter contains ":" this is most definitely an URL,
          therefore we need to quote it "as is" without translating its value.
          The text is either supplied, or it's the value of the URL itself
          (without the trailing anchor, if any).
        -->
        <xsl:when test="contains($href,':')">
          <xsl:attribute name="{$attr}"><xsl:value-of select="$href"/></xsl:attribute>
          <xsl:if test="string-length($text) = 0">
            <xsl:choose>
              <xsl:when test="contains($href,'#')">
                <xsl:value-of select="substring-before($href,'#')"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$href"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
          <xsl:value-of select="$text"/>
        </xsl:when>
  
        <!--
          Nope, we don't have a full URL, therefore we interpret this as a
          relative hyperlink to another document. We need to translate its
          name from "*.xml" to "*.html" (because this is how we convert the
          names) and the text included in this will be the title of the
          target document.
        -->
        <xsl:otherwise>
          <!--
            The "file" variable contains the part of the "href" before
            the "#" character. Yes, the "file" name.
          -->
          <xsl:variable name="file">
            <xsl:choose>
              <xsl:when test="contains($href,'#')">
                <xsl:value-of select="substring-before($href,'#')" />
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$href" />
              </xsl:otherwise>
            </xsl:choose>
          </xsl:variable>
  
          <!--
            Like "file" the "anchor" variable contains the part of the "href"
            after the "#" character.
          -->
          <xsl:variable name="anchor">
            <xsl:if test="contains($href,'#')">
              <xsl:value-of select="'#'" />
              <xsl:value-of select="substring-after($href,'#')" />
            </xsl:if>
          </xsl:variable>
  
          <!--
            Good, now we check if "file" ends in ".xml", if so, we replace that
            with ".html", otherwise we keep its original value, then we add the
            anchor we gathered before. We call this "target".
          -->
          <xsl:variable name="target">
            <xsl:if test="string-length($file) > 0">
              <xsl:choose>
                <xsl:when test="substring($file,string-length($file)-3) = '.xml'">
                  <xsl:value-of select="substring($file,1,string-length($file)-3)"/>
                  <xsl:value-of select="'html'"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$file"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:if>
            <xsl:value-of select="$anchor"/>
          </xsl:variable>
  
          
          <!--
            Now, we want to set the attribute to contain the "target" variable.
          -->
          <xsl:attribute name="{$attr}">
            <xsl:value-of select="$target"/>
          </xsl:attribute>
  
          <!--
            To finish we want to set the body of this element: if we have "text"
            the body of the element will be just that, otherwise, it will be
            the "target" value (the translated href) if there was no text,
            or the "title" of the target document if we actually translated
            something
          -->
          <xsl:if test="string-length($text) = 0">
            <xsl:choose>
              <xsl:when test="$target = $href">
                <xsl:value-of select="$file"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="document($file)/document/@title"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
          <xsl:value-of select="$text"/>
  
        </xsl:otherwise>
      </xsl:choose>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message