home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _5A3EFCAFEED975851DF6EF247664D781 < prev    next >
Extensible Markup Language  |  2006-07-11  |  9KB  |  211 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4.  Licensed to the Apache Software Foundation (ASF) under one or more
  5.  contributor license agreements.  See the NOTICE file distributed with
  6.  this work for additional information regarding copyright ownership.
  7.  The ASF licenses this file to You under the Apache License, Version 2.0
  8.  (the "License"); you may not use this file except in compliance with
  9.  the License.  You may obtain a copy of the License at
  10.  
  11.      http://www.apache.org/licenses/LICENSE-2.0
  12.  
  13.  Unless required by applicable law or agreed to in writing, software
  14.  distributed under the License is distributed on an "AS IS" BASIS,
  15.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16.  See the License for the specific language governing permissions and
  17.  limitations under the License.
  18. -->
  19.  
  20. <!DOCTYPE xsl:stylesheet [
  21.     <!ENTITY lf SYSTEM "util/lf.xml">
  22. ]>
  23. <xsl:stylesheet version="1.0"
  24.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  25.                   xmlns="http://www.w3.org/1999/xhtml">
  26.  
  27. <!-- ==================================================================== -->
  28. <!-- <quickreference>                                                     -->
  29. <!-- Builds the directive quickreference page                             -->
  30. <!-- ==================================================================== -->
  31. <xsl:template match="quickreference">
  32. <html xml:lang="{$doclang}" lang="{$doclang}">
  33.     <xsl:call-template name="head"/>&lf;
  34.  
  35.     <body id="directive-index">&lf;
  36.         <xsl:call-template name="top"/>&lf;
  37.  
  38.         <div id="preamble">
  39.             <h1>
  40.                 <xsl:value-of select="title" />
  41.             </h1>&lf;
  42.  
  43.             <xsl:call-template name="langavail" />&lf;
  44.  
  45.             <xsl:apply-templates select="summary" />
  46.         </div>&lf; <!-- /#preamble -->
  47.  
  48.         <div id="directive-ref">
  49.             <xsl:variable name="directives"
  50.                 select="document(document($allmodules)/modulefilelist/modulefile)
  51.                         /modulesynopsis/directivesynopsis[not(@location)]" />
  52.  
  53.             <xsl:variable name="start-letters">
  54.                 <xsl:call-template name="directive-startletters">
  55.                     <xsl:with-param name="directives" select="$directives" />
  56.                 </xsl:call-template>
  57.             </xsl:variable>
  58.  
  59.             <table id="legend">&lf;
  60.             <tr>
  61.                 <td class="letters">
  62.                     <span>
  63.                         <xsl:call-template name="letter-bar">
  64.                             <xsl:with-param name="letters"
  65.                                 select="$start-letters" />
  66.                             <xsl:with-param name="first" select="true()" />
  67.                         </xsl:call-template>
  68.                     </span>
  69.                 </td>&lf;
  70.                 <td>
  71.                     <xsl:apply-templates select="legend/table[position()=1]" />
  72.                 </td>&lf;
  73.                 <td>
  74.                     <xsl:apply-templates select="legend/table[position()=2]" />
  75.                 </td>
  76.             </tr>&lf;
  77.             </table>&lf;
  78.  
  79.             <table class="qref">&lf;
  80.             <xsl:call-template name="reference-of-letter">
  81.                 <xsl:with-param name="letters-todo" select="$start-letters" />
  82.                 <xsl:with-param name="offset" select="number(0)" />
  83.                 <xsl:with-param name="directives" select="$directives" />
  84.             </xsl:call-template>
  85.             </table>
  86.         </div>&lf; <!-- /#directive-ref -->
  87.  
  88.         <xsl:call-template name="bottom"/>&lf;
  89.     </body>
  90. </html>
  91. </xsl:template>
  92. <!-- /quickreference -->
  93.  
  94.  
  95. <!-- ==================================================================== -->
  96. <!-- the working horse. builds rows of all directives starting with one   -->
  97. <!-- letter when done, it calls itself to catch the next letter           -->
  98. <!-- ==================================================================== -->
  99. <xsl:template name="reference-of-letter">
  100. <xsl:param name="letters-todo" />
  101. <xsl:param name="offset" />
  102. <xsl:param name="directives" />
  103.  
  104. <xsl:variable name="letter" select="substring($letters-todo, 1, 1)" />
  105.  
  106. <xsl:for-each
  107.     select="$directives[$letter=translate(substring(normalize-space(name), 1,1),
  108.                                           $lowercase,$uppercase)]">
  109. <xsl:sort select="name" />
  110.  
  111.     <tr>
  112.         <xsl:if test="position() mod 2 = $offset">
  113.             <xsl:attribute name="class">odd</xsl:attribute>
  114.         </xsl:if>
  115.  
  116.         <td>
  117.             <a href="{../name}.html#{translate(name, $uppercase, $lowercase)}">
  118.                 <xsl:if test="position()=1">
  119.                     <xsl:attribute name="id">
  120.                         <xsl:value-of select="$letter" />
  121.                     </xsl:attribute>
  122.                     <xsl:attribute name="name">
  123.                         <xsl:value-of select="$letter" />
  124.                     </xsl:attribute>
  125.                 </xsl:if>
  126.  
  127.                 <xsl:apply-templates select="syntax" />
  128.             </a>
  129.         </td>
  130.         <td>
  131.             <!-- if the default value contains (at least) one <br />, -->
  132.             <!-- this probably means that a short explanation follows -->
  133.             <!-- the actual default value. We cut off the string      -->
  134.             <!-- after the <br /> so it will not be shown here.       -->
  135.             <!-- (add the + character instead)                        -->
  136.             <xsl:variable name="default">
  137.                 <xsl:choose>
  138.                 <xsl:when test="count(default[count(br) > 0]) > 0">
  139.                     <xsl:value-of
  140.                         select="default/child::node()
  141.                                 [count(preceding-sibling::*) = 0]" />
  142.                 </xsl:when>
  143.                 <xsl:otherwise>
  144.                     <xsl:value-of select="default"/>
  145.                 </xsl:otherwise>
  146.                 </xsl:choose>
  147.             </xsl:variable>
  148.  
  149.             <xsl:value-of select="substring(substring-after(concat($default,
  150.                                   ' '), name),1,20)" />
  151.             <xsl:if test="string-length(substring-after(concat($default, ' '),
  152.                               name)) > 20
  153.                           or count(default[count(br) > 0]) > 0">
  154.                 <xsl:text> +</xsl:text>
  155.             </xsl:if>
  156.         </td>
  157.         <td>
  158.             <xsl:if test="contextlist/context
  159.                           [normalize-space(.)='server config']">s</xsl:if>
  160.             <xsl:if test="contextlist/context
  161.                           [normalize-space(.)='virtual host']">v</xsl:if>
  162.             <xsl:if test="contextlist/context
  163.                           [normalize-space(.)='directory']">d</xsl:if>
  164.             <xsl:if test="contextlist/context
  165.                           [normalize-space(.)='.htaccess']">h</xsl:if>
  166.         </td>
  167.         <td>
  168.             <xsl:choose>
  169.             <xsl:when test="../status='Base'">B</xsl:when>
  170.             <xsl:when test="../status='MPM'">M</xsl:when>
  171.             <xsl:when test="../status='Core'">C</xsl:when>
  172.             <xsl:when test="../status='Extension'">E</xsl:when>
  173.             <xsl:when test="../status='Experimental'">X</xsl:when>
  174.             </xsl:choose>
  175.         </td>
  176.     </tr>
  177.     <tr>
  178.         <xsl:if test="position() mod 2 = $offset">
  179.             <xsl:attribute name="class">odd</xsl:attribute>
  180.         </xsl:if>
  181.  
  182.         <td colspan="4" class="descr">
  183.             <xsl:choose>
  184.             <xsl:when test="string-length(normalize-space(description)) > 0">
  185.                 <xsl:apply-templates select="description"/>
  186.             </xsl:when>
  187.             <xsl:otherwise>
  188.                 <xsl:text>-</xsl:text>
  189.             </xsl:otherwise>
  190.             </xsl:choose>
  191.         </td>
  192.     </tr>&lf;
  193. </xsl:for-each> <!-- /directives -->
  194.  
  195. <!-- call next letter, if there is -->
  196. <xsl:if test="string-length($letters-todo) > 1">
  197.     <xsl:call-template name="reference-of-letter">
  198.         <xsl:with-param name="letters-todo"
  199.             select="substring($letters-todo, 2)" />
  200.         <xsl:with-param name="offset"
  201.             select="(count($directives[$letter=translate(substring(
  202.                     normalize-space(name), 1, 1), $lowercase, $uppercase)])
  203.                     + $offset) mod 2" />
  204.         <xsl:with-param name="directives" select="$directives" />
  205.     </xsl:call-template>
  206. </xsl:if>
  207. </xsl:template>
  208. <!-- /reference-of-letter -->
  209.  
  210. </xsl:stylesheet>
  211.