You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by gl...@apache.org on 2001/05/23 04:14:28 UTC

cvs commit: jakarta-taglibs/src/taglib footer.xsl taglib-doc.xsl taglib.css tld11.xsl

glenn       01/05/22 19:14:28

  Added:       src/taglib footer.xsl taglib-doc.xsl taglib.css tld11.xsl
  Log:
  Support for new build
  
  Revision  Changes    Path
  1.1                  jakarta-taglibs/src/taglib/footer.xsl
  
  Index: footer.xsl
  ===================================================================
  <?xml version="1.0" encoding="iso-8859-1"?>
  <xsl:stylesheet 
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
          version="1.0"
  >
  <xsl:template name="footer">
  <a name="examples"><h3>Examples</h3></a>
         <p>See the example application <xsl:value-of select="shortname"/>-examples.war for examples of the usage
          of the tags from this custom tag library.</p>
  
       <a name="javadocs"><h3>Java Docs</h3></a>
         <p>Java programmers can view the java class documentation for this tag library
          as <a href="javadoc/index.html">javadocs</a>.</p>
  
       <a name="history"><h3>Revision History</h3></a>
         <p>Review the complete <a href="changes.html">revision history</a> of this tag
         library.</p>
   </xsl:template>
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-taglibs/src/taglib/taglib-doc.xsl
  
  Index: taglib-doc.xsl
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:output method="html" 
                indent="yes" 
                omit-xml-declaration="yes"/>
    <!--
      This XSL is used to transform Tag library Documentation XML files into HTML
      documents formatted for the Jakarta Taglibs Web site.
      
      The Tag Library Documentation file(s) are standalone XML documents based on
      the Tag Library Descriptor format (i.e., they have no DTD or DOCTYPE 
      declaration).
      
      The TLD forms the basis for the Documentation, much of it used here as the
      a natural base for the HTML documentation.  Added to it are arbitrary, but 
      conventional (the conventions determined by the Jakarta Taglibs project 
      for the time being), XML elements used to provide information extraneous to 
      the TLD proper.  For example, info elements are added for tag attributes 
      (a request has been made to the JSP expert group to add such an element to 
      the TLD proper), and example elements are added for usage examples.
    
      Scott Stirling
      sstirling@mediaone.net
      1/1/2001  
    -->
  
  <!-- A footer linked in, which we call below (near the bottom) -->
  <xsl:include href="footer.xsl"/>
  
  <!--
      How some of the non-obvious TLD==>HTML mappings are used here:
  
      HTML <title> : TLD <taglib><info></info></taglib>
      HTML page title <h1>: TLD <taglib><info></info></taglib>
      
      - Sometimes the <shortname> value of the TLD is used as the taglib name or 
        the prefix for various minutiae, other times the <info> line is used.  
        Depends on the context, as you can see below.
   -->
  
  <xsl:template match="/">
    <xsl:apply-templates />
  </xsl:template>
  
  <xsl:template match="/document">
  <html>
    <xsl:apply-templates />
  </html>
  </xsl:template>
  
  <xsl:template match="/document/properties">
    <head>
      <meta content="{author}" name="author"/>
      <title><xsl:value-of select="title"/></title>
      <!-- link to the CSS used for HTML formatting -->
      <link rel="stylesheet" href="taglib.css" type="text/css" /> 
    </head>
  </xsl:template>
    
  <xsl:template match="/document/taglib">
    <body>
    <h1>Jakarta Project: <xsl:value-of select="//taglib/info"/></h1>
    <h3 class="middle">Version: <xsl:value-of select="//taglib/tlibversion"/></h3>
      <!-- Table of Contents -->
     <h3>Table of Contents</h3>
       <a href="#overview">Overview</a><br />
       <a href="#requirements">Requirements</a><br />
       <a href="#config">Configuration</a><br />
       <a href="#summary">Tag Summary</a><br />
       <a href="#reference">Tag Reference</a><br />
       <a href="#examples">Examples</a><br />
       <a href="#javadocs">Javadocs</a><br />
       <a href="#history">Revision History</a><br />    
  
      <!-- Overview -->
      <a><xsl:attribute name="name">overview</xsl:attribute></a>
      <h3>Overview</h3>
      <xsl:for-each select="overview/*">
        <xsl:copy-of select="."/>
      </xsl:for-each>
      
      <!-- Requirements -->
      <a><xsl:attribute name="name">requirements</xsl:attribute></a>
      <h3>Requirements</h3>
      <xsl:apply-templates select="requirements-info"/>
  
      <!-- Configuration -->
      <a><xsl:attribute name="name">config</xsl:attribute></a>
      <h3>Configuration</h3>
          <p>Follow these steps to configure your web application with this tag library:</p>
          <ul>
              <li>Copy the tag library descriptor file to the /WEB-INF subdirectory
                   of your web application.</li>
              <li>Copy the tag library JAR file to the /WEB-INF/lib subdirectory 
                  of your web application.</li>
              <li>Add a &lt;taglib&gt; element to your web application deployment
                  descriptor in /WEB-INF/web.xml like this:
  <pre>
  &lt;taglib&gt;
    &lt;taglib-uri&gt;http://jakarta.apache.org/taglibs/<xsl:value-of select="shortname"/>-<xsl:value-of select="tlibversion"/>&lt;/taglib-uri&gt;
    &lt;taglib-location&gt;<xsl:value-of select="taglib-location"/>&lt;/taglib-location&gt;
  &lt;/taglib&gt;
  </pre>
              </li>
          </ul>
          <p>To use the tags from this library in your JSP pages, add the following
          directive at the top of each page: </p>
  <pre>
  &lt;%@ taglib uri=&quot;http://jakarta.apache.org/taglibs/<xsl:value-of select="shortname"/>-<xsl:value-of select="tlibversion"/>&quot; prefix=&quot;<xsl:value-of select="prefix"/>&quot; %&gt;
  </pre>
          <p>where &quot;<i><xsl:value-of select="prefix"/></i>&quot; is the tag name prefix you wish to use for tags 
          from this library. You can change this value to any prefix you like.</p>
  
      <!--  Tag Summary Section  -->
      <a><xsl:attribute name="name">summary</xsl:attribute></a>
      <h3>Tag Summary</h3>
      <table summary="summary list of tags with short description of each.">
          <xsl:for-each select="tag">
          <tr>
            <td>
              <a>
                <xsl:attribute name="href">#<xsl:value-of select="name"/></xsl:attribute><xsl:value-of select="name"/>
              </a>
             </td>
            <td><xsl:value-of select="info"/></td>
          </tr> 
          </xsl:for-each>
          <!-- The next empty row is for formatting purposes only. -->
          <tr>
            <td colspan="2"><xsl:text>&#160;</xsl:text></td>
          </tr>
      </table>
  
      <!-- Tag Reference Section -->
      <a><xsl:attribute name="name">reference</xsl:attribute></a>
      <h3>Tag Reference</h3>
      <!-- Start for-each to process <tag> elements here -->
      <xsl:for-each select="tag">
      <table border="0" width="90%" cellpadding="3" cellspacing="0" summary="This table is for visual formatting of tag reference information.">
        <tr>
          <td colspan="2">
            <table border="0" bgcolor="#cccccc" width="100%" cellspacing="0" summary="name and tag library version availability of tag.">
              <tr>
                <td><b><font size="+1"><a><xsl:attribute name="name"><xsl:value-of select="name"/></xsl:attribute><xsl:value-of select="name"/></a></font></b></td>
                <td align="right">Availability: version <xsl:value-of select="//taglib/tlibversion"/></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td colspan="2"><xsl:value-of select="info"/></td>
        </tr>
        <tr>
          <td width="2%"><xsl:text>&#160;</xsl:text></td>
          <td width="98%">
            <table border="0" width="100%" summary="Tag class, tag name, script variable (if any), and restrictions (if any).">
              <tr>
                <td width="20%"><span class="tclass">Tag Class</span></td>
                <td width="80%"><xsl:value-of select="tagclass"/></td>
              </tr>
              <tr>
                <td width="20%"><span class="tbody">Tag Body</span></td>
                <td width="80%"><xsl:value-of select="bodycontent"/></td>
              </tr>
              <tr>
                <td width="20%"><span class="scriptvar">Script Variable</span></td>
                <td width="80%"><xsl:value-of select="script-variable"/></td>  
              </tr>
              <tr>
                <td width="20%"><span class="restrictions">Restrictions</span></td>
                <td width="80%"><xsl:value-of select="restrictions"/></td>
              </tr>
              <!-- BEGIN xsl:choose
                   If tag has attributes, then create headers and iterate over the
                   attributes, otherwise, skip headers and print "None" -->
              <xsl:choose>
              <xsl:when test="attribute">
              <tr> 
                <td width="20%"><span class="attributes">Attributes</span></td>
                <td width="80%"><xsl:text>&#160;</xsl:text></td>
              </tr>
              <tr>
                <td width="20%"><xsl:text>&#160;</xsl:text></td>
                <td width="80%">
                  <table border="0" width="100%" summary="Tag attribute name, whether required, and whether rtexprvalue allowed.">
                    <tr>
                      <td width="40%">Name</td>
                      <td width="20%">Required</td>
                      <td width="40%">Runtime Expression Evaluation</td>
                    </tr>
  
                    <!-- Start <attribute> for-each here -->
                    <xsl:for-each select="attribute">
                    <tr bgcolor="#cccccc">
                      <td width="40%"><b><xsl:value-of select="name"/></b></td>
                      <td width="20%"><xsl:value-of select="required"/></td>
                      <td width="40%"><xsl:value-of select="rtexprvalue"/></td>
                    </tr>
                    <tr>
                      <td colspan="3"><xsl:value-of select="info"/></td>
                    </tr>
                    </xsl:for-each>
                    <!-- End <attribute> for-each here -->
                  </table>
                </td>
              </tr>
              </xsl:when>
              <xsl:otherwise>
              <tr> 
                <td width="20%"><span class="attributes">Attributes</span></td>
                <td width="80%">None</td>
              </tr>
              </xsl:otherwise>
              </xsl:choose>
              <!-- END xsl:choose -->
        <tr>
          <td width="20%" valign="top"><span class="example">Example</span></td> 
          <td width="80%">
          <!-- Examples Section -->
          <ol><xsl:for-each select="usage">
            <li><xsl:if test="comment">
              <span class="comment">&lt;%--<xsl:value-of select="comment"/>--%&gt;</span><br /></xsl:if> 
              <xsl:for-each select="scriptlet"><span class="jsp-squig">&lt;%</span><span class="scriptlet"> <xsl:value-of select="."/> </span><span class="jsp-squig">%&gt;</span><br /> 
              </xsl:for-each>
              <!-- A little trick here: the XML element <code> in our TLDoc matches 
                  the HTML element <code> on purpose so that we can just copy the 
                  whole node, including the opening and closing <code> tags.
                  -->
              <p><pre>
  <xsl:copy-of select="code"/></pre></p></li>
            </xsl:for-each>
          </ol>
          <!-- End Examples Section -->
          </td>
        </tr>
      </table>
      </td>
      </tr>
      </table>
      <!-- End for-each <tag> element here -->
      </xsl:for-each>
      
          <!-- Footer Section (Examples, Javadoc, History) called. -->
          <xsl:call-template name="footer"/>
    </body>
  </xsl:template>
  
  <xsl:template match="requirements-info">
    <p>
    <xsl:copy-of select="*|text()"/>  
    </p>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  
  1.1                  jakarta-taglibs/src/taglib/taglib.css
  
  Index: taglib.css
  ===================================================================
  body { background-color: #ffffff; }
  h1   { text-align: center; }
  code  { font: medium sans-serif; color: #990099; }
  .middle  { text-align: center; }
  .comment { color: #3300cc; }
  .jsp-squig { color: #009999; }
  .scriptlet { color: #666666; }
  .tclass { font-weight: bold; }
  .tbody  { font-weight: bold; }
  .scriptvar  { font-weight: bold; }
  .restrictions  { font-weight: bold; }
  .attributes  { font-weight: bold; }
  .example  { font-weight: bold; }
  
  
  
  1.1                  jakarta-taglibs/src/taglib/tld11.xsl
  
  Index: tld11.xsl
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- 
      This XSL sheet converts Tag Library Documentation into a Tag Library 
      Descriptor. Originally authored by Craig McClanahan for the Jakarta Struts
      project, and used here without modification. 
  
      See the other XML documents in this distribution for more information on 
      how to format the Tag Library Documentation XML files.  Basically, you
      just write a TLD, leave out the DTD, and add whatever other XML elements
      you need for other purposes.  This XSL will ignore any elements that are not 
      part of the TLD proper.
  
      Scott Stirling
      sstirling@mediaone.net
      1/1/2001
    -->
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <!-- Output method and formatting -->
    <xsl:output
               method="xml"
               indent="yes"
       doctype-public="-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
       doctype-system="http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd"/>
     <xsl:strip-space elements="taglib tag attribute"/>
    <!-- Process an entire tag library -->
    <xsl:template match="taglib">
      <taglib>
        <xsl:if test="tlibversion">
          <tlibversion><xsl:value-of select="tlibversion"/></tlibversion>
        </xsl:if>
        <xsl:if test="jspversion">
          <jspversion><xsl:value-of select="jspversion"/></jspversion>
        </xsl:if>
        <xsl:if test="shortname">
          <shortname><xsl:value-of select="shortname"/></shortname>
        </xsl:if>
        <xsl:if test="uri">
          <uri><xsl:value-of select="uri"/></uri>
        </xsl:if>
        <xsl:apply-templates select="tag"/>
      </taglib>
    </xsl:template>
  
    <!-- Process an individual tag -->
    <xsl:template match="tag">
      <tag>
        <xsl:if test="name">
          <name><xsl:value-of select="name"/></name>
        </xsl:if>
        <xsl:if test="tagclass">
          <tagclass><xsl:value-of select="tagclass"/></tagclass>
        </xsl:if>
        <xsl:if test="teiclass">
          <teiclass><xsl:value-of select="teiclass"/></teiclass>
        </xsl:if>
        <xsl:if test="bodycontent">
          <bodycontent><xsl:value-of select="bodycontent"/></bodycontent>
        </xsl:if>
        <xsl:apply-templates select="attribute"/>
      </tag>
    </xsl:template>
  
    <!-- Process an individual tag attribute -->
    <xsl:template match="attribute">
      <attribute>
        <xsl:if test="name">
          <name><xsl:value-of select="name"/></name>
        </xsl:if>
        <xsl:if test="required">
          <required><xsl:value-of select="required"/></required>
        </xsl:if>
        <xsl:if test="rtexprvalue">
          <rtexprvalue><xsl:value-of select="rtexprvalue"/></rtexprvalue>
        </xsl:if>
      </attribute>
    </xsl:template>
    <!-- Skip irrelevant details -->
    <xsl:template match="properties"/>
  </xsl:stylesheet>