home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 November / CMCD1104.ISO / Software / Complet / Apache / apache_2.0.52-win32-x86-no_ssl.msi / Data.Cab / F278615_synopsis.xsl < prev    next >
Extensible Markup Language  |  2004-05-02  |  20KB  |  508 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!--
  4.  Copyright 2002-2004 The Apache Software Foundation
  5.  
  6.  Licensed under the Apache License, Version 2.0 (the "License");
  7.  you may not use this file except in compliance with the License.
  8.  You may obtain a copy of the License at
  9.  
  10.      http://www.apache.org/licenses/LICENSE-2.0
  11.  
  12.  Unless required by applicable law or agreed to in writing, software
  13.  distributed under the License is distributed on an "AS IS" BASIS,
  14.  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15.  See the License for the specific language governing permissions and
  16.  limitations under the License.
  17. -->
  18.  
  19. <!DOCTYPE xsl:stylesheet [
  20.     <!ENTITY lf SYSTEM "util/lf.xml">
  21. ]>
  22. <xsl:stylesheet version="1.0"
  23.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  24.                   xmlns="http://www.w3.org/1999/xhtml">
  25.  
  26. <!-- ==================================================================== -->
  27. <!-- <modulesynopsis>                                                     -->
  28. <!-- Process an entire document into an HTML page                         -->
  29. <!-- ==================================================================== -->
  30. <xsl:template match="modulesynopsis">
  31. <html xml:lang="{$doclang}" lang="{$doclang}">
  32.     <xsl:call-template name="head" />&lf;
  33.  
  34.     <body>&lf;
  35.         <xsl:call-template name="top" />&lf;
  36.  
  37.         <div id="page-content">&lf;
  38.             <div id="preamble">
  39.                 <h1>
  40.                     <xsl:choose>
  41.                     <xsl:when test="status='Core'">
  42.                         <xsl:value-of select="$message
  43.                                               [@id='apachecore']" />
  44.                     </xsl:when>
  45.                     <xsl:when test="name='mpm_common'">
  46.                         <xsl:value-of select="$message
  47.                                               [@id='apachempmcommon']" />
  48.                     </xsl:when>
  49.                     <xsl:when test="status='MPM'">
  50.                         <xsl:value-of select="$message
  51.                                               [@id='apachempm']" />
  52.                         <xsl:text> </xsl:text>
  53.                         <xsl:call-template name="module-translatename">
  54.                             <xsl:with-param name="name" select="name" />
  55.                         </xsl:call-template>
  56.                     </xsl:when>
  57.                     <xsl:otherwise>
  58.                         <xsl:value-of select="$message
  59.                                               [@id='apachemodule']" />
  60.                         <xsl:text> </xsl:text>
  61.                         <xsl:value-of select="name" />
  62.                     </xsl:otherwise>
  63.                     </xsl:choose>
  64.                 </h1>&lf;
  65.  
  66.                 <xsl:call-template name="langavail" />&lf;
  67.  
  68.                 <!-- Description and module-headers -->
  69.                 <table class="module">
  70.                 <tr>
  71.                     <th>
  72.                         <a href="module-dict.html#Description">
  73.                             <xsl:value-of select="$message
  74.                                                   [@id='description']" />
  75.                             <xsl:text>:</xsl:text>
  76.                         </a>
  77.                     </th>
  78.                     <td>
  79.                         <xsl:apply-templates select="description" />
  80.                     </td>
  81.                 </tr>&lf;
  82.                 <tr>
  83.                     <th>
  84.                         <a href="module-dict.html#Status">
  85.                             <xsl:value-of select="$message
  86.                                                   [@id='status']" />
  87.                             <xsl:text>:</xsl:text>
  88.                         </a>
  89.                     </th>
  90.                     <td>
  91.                         <xsl:value-of select="status" />
  92.                     </td>
  93.                 </tr>
  94.  
  95.                 <xsl:if test="identifier">&lf;
  96.                 <tr>
  97.                     <th>
  98.                         <a href="module-dict.html#ModuleIdentifier">
  99.                             <xsl:value-of select="$message
  100.                                                   [@id='moduleidentifier']" />
  101.                             <xsl:text>:</xsl:text>
  102.                         </a>
  103.                     </th>
  104.                     <td>
  105.                         <xsl:value-of select="identifier" />
  106.                     </td>
  107.                 </tr>
  108.                 </xsl:if>
  109.  
  110.                 <xsl:if test="sourcefile">&lf;
  111.                 <tr>
  112.                     <th>
  113.                         <a href="module-dict.html#SourceFile">
  114.                             <xsl:value-of select="$message
  115.                                                   [@id='sourcefile']" />
  116.                             <xsl:text>:</xsl:text>
  117.                         </a>
  118.                     </th>
  119.                     <td>
  120.                         <xsl:value-of select="sourcefile" />
  121.                     </td>
  122.                 </tr>
  123.                 </xsl:if>
  124.  
  125.                 <xsl:if test="compatibility">&lf;
  126.                 <tr>
  127.                     <th>
  128.                         <a href="module-dict.html#Compatibility">
  129.                             <xsl:value-of select="$message
  130.                                                   [@id='compatibility']" />
  131.                             <xsl:text>:</xsl:text>
  132.                         </a>
  133.                     </th>
  134.                     <td>
  135.                         <xsl:apply-templates select="compatibility" />
  136.                     </td>
  137.                 </tr>
  138.                 </xsl:if>
  139.                 </table>&lf;
  140.  
  141.                 <!-- Summary of module features/usage (1 to 3 paragraphs, -->
  142.                 <!-- optional)                                            -->
  143.                 <xsl:if test="summary">
  144.                     <h3>
  145.                         <xsl:value-of select="$message
  146.                                               [@id='summary']" />
  147.                     </h3>&lf;
  148.  
  149.                     <xsl:apply-templates select="summary" />
  150.                 </xsl:if>
  151.             </div>&lf; <!-- /#preamble -->
  152.  
  153.             <xsl:if test="not($is-chm) or seealso">
  154.                 <div id="quickview">
  155.                     <xsl:if test="not($is-chm)">
  156.                         <h3 class="directives">
  157.                             <xsl:value-of select="$message
  158.                                                   [@id='directives']" />
  159.                         </h3>&lf;
  160.  
  161.                         <xsl:choose>
  162.                         <xsl:when test="directivesynopsis">
  163.                             <ul id="toc">&lf;
  164.                             <xsl:for-each select="directivesynopsis">
  165.                             <xsl:sort select="name" />
  166.                                 <xsl:variable name="lowername"
  167.                                     select="translate(name, $uppercase,
  168.                                                       $lowercase)" />
  169.  
  170.                                 <xsl:choose>
  171.                                 <xsl:when test="not(@location)">
  172.                                     <li>
  173.                                         <img src="{$path}/images/down.gif"
  174.                                             alt="" />
  175.                                         <xsl:text> </xsl:text>
  176.                                         <a href="#{$lowername}">
  177.                                             <xsl:if test="@type='section'"
  178.                                                 ><</xsl:if>
  179.                                             <xsl:value-of select="name" />
  180.                                             <xsl:if test="@type='section'"
  181.                                                 >></xsl:if>
  182.                                         </a>
  183.                                     </li>&lf;
  184.                                 </xsl:when>
  185.                                 <xsl:otherwise>
  186.                                     <xsl:variable name="lowerlocation"
  187.                                         select="translate(@location, $uppercase,
  188.                                                           $lowercase)" />
  189.                                     <li>
  190.                                         <img src="{$path}/images/right.gif"
  191.                                             alt="" />
  192.                                         <xsl:text> </xsl:text>
  193.                                         <a href="{$lowerlocation}.html#{
  194.                                                                    $lowername}">
  195.                                             <xsl:if test="@type='section'"
  196.                                                 ><</xsl:if>
  197.                                             <xsl:value-of select="name" />
  198.                                             <xsl:if test="@type='section'"
  199.                                                 >></xsl:if>
  200.                                         </a>
  201.                                     </li>&lf;
  202.                                 </xsl:otherwise>
  203.                                 </xsl:choose>
  204.                             </xsl:for-each>
  205.                             </ul>&lf; <!-- /toc -->
  206.                         </xsl:when> <!-- have directives -->
  207.  
  208.                         <xsl:otherwise>
  209.                             <p>
  210.                                 <xsl:value-of select="$message
  211.                                                       [@id='nodirectives']" />
  212.                             </p>&lf;
  213.                         </xsl:otherwise>
  214.                         </xsl:choose>
  215.  
  216.                         <xsl:if test="section">
  217.                             <h3>
  218.                                 <xsl:value-of select="$message
  219.                                                       [@id='topics']" />
  220.                             </h3>&lf;
  221.  
  222.                             <ul id="topics">&lf;
  223.                             <xsl:apply-templates
  224.                                 select="section" mode="index" />
  225.                             </ul>
  226.                         </xsl:if>
  227.                     </xsl:if> <!-- /!is-chm -->
  228.  
  229.                     <xsl:if test="seealso">
  230.                         <h3>
  231.                             <xsl:value-of select="$message
  232.                                                   [@id='seealso']" />
  233.                         </h3>&lf;
  234.  
  235.                         <ul class="seealso">&lf;
  236.                         <xsl:for-each select="seealso">
  237.                             <li>
  238.                                 <xsl:apply-templates />
  239.                             </li>&lf;
  240.                         </xsl:for-each>
  241.                         </ul>
  242.                     </xsl:if>
  243.                 </div> <!-- /#quickview -->
  244.             </xsl:if>&lf; <!-- have sidebar -->
  245.  
  246.             <!-- Sections of documentation about the module as a whole -->
  247.             <xsl:apply-templates select="section" />&lf;
  248.  
  249.             <!-- Directive documentation -->
  250.             <xsl:apply-templates select="directivesynopsis">
  251.                 <xsl:sort select="name" />
  252.             </xsl:apply-templates>
  253.         </div>&lf; <!-- /#page-content -->
  254.  
  255.         <xsl:call-template name="bottom" />&lf;
  256.     </body>
  257. </html>
  258. </xsl:template>
  259. <!-- /modulesynopsis -->
  260.  
  261.  
  262. <!-- ==================================================================== -->
  263. <!-- Directivesynopsis                                                    -->
  264. <!-- ==================================================================== -->
  265. <xsl:template match="directivesynopsis">
  266. <xsl:if test="not(@location)">
  267.     <xsl:call-template name="toplink" />&lf;
  268.  
  269.     <div class="directive-section">
  270.         <xsl:variable name="lowername"
  271.             select="translate(name, $uppercase, $lowercase)" />
  272.  
  273.         <!-- Directive heading gets both mixed case and lowercase      -->
  274.         <!-- anchors, and includes lt/gt only for "section" directives -->
  275.         <h2>
  276.             <a id="{name}" name="{name}">
  277.                 <xsl:if test="@type='section'"><</xsl:if>
  278.                 <xsl:value-of select="name" />
  279.                 <xsl:if test="@type='section'">></xsl:if>
  280.             </a>
  281.  
  282.             <xsl:choose>
  283.             <xsl:when test="$message
  284.                             [@id='directive']/@replace-space-with">
  285.                 <xsl:value-of select="$message
  286.                                       [@id='directive']/@replace-space-with"/>
  287.             </xsl:when>
  288.             <xsl:otherwise>
  289.                 <xsl:text> </xsl:text>
  290.             </xsl:otherwise>
  291.             </xsl:choose>
  292.  
  293.             <a id="{$lowername}" name="{$lowername}">
  294.                 <xsl:value-of select="$message[@id='directive']" />
  295.             </a>
  296.         </h2>&lf;
  297.  
  298.         <!-- Directive header -->
  299.         <table class="directive">&lf;
  300.         <tr>
  301.             <th>
  302.                 <a href="directive-dict.html#Description">
  303.                     <xsl:value-of select="$message
  304.                                           [@id='description']" />
  305.                     <xsl:text>:</xsl:text>
  306.                 </a>
  307.             </th>
  308.             <td>
  309.                 <xsl:value-of select="description" />
  310.             </td>
  311.         </tr>&lf;
  312.  
  313.         <tr>
  314.             <th>
  315.                 <a href="directive-dict.html#Syntax">
  316.                     <xsl:value-of select="$message[@id='syntax']" />
  317.                     <xsl:text>:</xsl:text>
  318.                 </a>
  319.             </th>
  320.             <td>
  321.                 <code>
  322.                     <xsl:apply-templates select="syntax" />
  323.                 </code>
  324.             </td>
  325.         </tr>
  326.  
  327.         <xsl:if test="default">&lf;
  328.         <tr>
  329.             <th>
  330.                 <a href="directive-dict.html#Default">
  331.                     <xsl:value-of select="$message[@id='default']" />
  332.                     <xsl:text>:</xsl:text>
  333.                 </a>
  334.             </th>
  335.             <td>
  336.                 <code>
  337.                     <xsl:apply-templates select="default" />
  338.                 </code>
  339.             </td>
  340.         </tr>
  341.         </xsl:if>&lf;
  342.  
  343.         <tr>
  344.             <th>
  345.                 <a href="directive-dict.html#Context">
  346.                     <xsl:value-of select="$message[@id='context']" />
  347.                     <xsl:text>:</xsl:text>
  348.                 </a>
  349.             </th>
  350.             <td>
  351.                 <xsl:apply-templates select="contextlist" />
  352.             </td>
  353.         </tr>
  354.  
  355.         <xsl:if test="override">&lf;
  356.         <tr>
  357.             <th>
  358.                 <a href="directive-dict.html#Override">
  359.                     <xsl:value-of select="$message[@id='override']"/>
  360.                     <xsl:text>:</xsl:text>
  361.                 </a>
  362.             </th>
  363.             <td>
  364.                 <xsl:value-of select="override" />
  365.             </td>
  366.         </tr>
  367.         </xsl:if>&lf;
  368.  
  369.         <tr>
  370.             <th>
  371.                 <a href="directive-dict.html#Status">
  372.                     <xsl:value-of select="$message[@id='status']" />
  373.                     <xsl:text>:</xsl:text>
  374.                 </a>
  375.             </th>
  376.             <td>
  377.                 <xsl:value-of select="../status" />
  378.             </td>
  379.         </tr>&lf;
  380.  
  381.         <tr>
  382.             <th>
  383.                 <a href="directive-dict.html#Module">
  384.                     <xsl:value-of select="$message[@id='module']" />
  385.                     <xsl:text>:</xsl:text>
  386.                 </a>
  387.             </th>
  388.             <td>
  389.                 <xsl:choose>
  390.                 <xsl:when test="modulelist">
  391.                     <xsl:apply-templates select="modulelist" />
  392.                 </xsl:when>
  393.                 <xsl:otherwise>
  394.                     <xsl:value-of select="../name" />
  395.                 </xsl:otherwise>
  396.                 </xsl:choose>
  397.             </td>
  398.         </tr>
  399.  
  400.         <xsl:if test="compatibility">&lf;
  401.         <tr>
  402.             <th>
  403.                 <a href="directive-dict.html#Compatibility">
  404.                     <xsl:value-of select="$message
  405.                                           [@id='compatibility']" />
  406.                     <xsl:text>:</xsl:text>
  407.                 </a>
  408.             </th>
  409.             <td>
  410.                 <xsl:apply-templates select="compatibility" />
  411.             </td>
  412.         </tr>
  413.         </xsl:if>&lf;
  414.         </table>
  415.  
  416.         <xsl:apply-templates select="usage" />&lf;
  417.  
  418.         <xsl:if test="seealso">
  419.             <h3>
  420.                 <xsl:value-of select="$message[@id='seealso']" />
  421.             </h3>&lf;
  422.  
  423.             <ul>&lf;
  424.             <xsl:for-each select="seealso">
  425.                 <li>
  426.                     <xsl:apply-templates />
  427.                 </li>&lf;
  428.             </xsl:for-each>
  429.             </ul>&lf;
  430.         </xsl:if>
  431.     </div>&lf; <!-- /.directive-section -->
  432. </xsl:if>
  433. </xsl:template>
  434. <!-- /directivesynopsis -->
  435.  
  436.  
  437. <!-- ==================================================================== -->
  438. <!-- <contextlist>                                                        -->
  439. <!-- ==================================================================== -->
  440. <xsl:template match="contextlist">
  441. <xsl:apply-templates select="context" />
  442. </xsl:template>
  443. <!-- /contextlist -->
  444.  
  445.  
  446. <!-- ==================================================================== -->
  447. <!-- <context>                                                            -->
  448. <!-- Each entry is separeted with a comma                                 -->
  449. <!-- ==================================================================== -->
  450. <xsl:template match="context">
  451. <xsl:choose>
  452. <xsl:when test="normalize-space(.) = 'server config'">
  453.     <xsl:value-of select="$message[@id='serverconfig']" />
  454. </xsl:when>
  455. <xsl:when test="normalize-space(.) = 'virtual host'">
  456.     <xsl:value-of select="$message[@id='virtualhost']" />
  457. </xsl:when>
  458. <xsl:when test="normalize-space(.) = 'directory'">
  459.     <xsl:value-of select="$message[@id='directory']" />
  460. </xsl:when>
  461. <xsl:when test="normalize-space(.) = '.htaccess'">
  462.     <xsl:value-of select="$message[@id='htaccess']" />
  463. </xsl:when>
  464. <xsl:otherwise> <!-- error -->
  465.     <xsl:message terminate="yes">
  466.         unknown context: <xsl:value-of select="." />
  467.     </xsl:message>
  468. </xsl:otherwise>
  469. </xsl:choose>
  470.  
  471. <xsl:if test="position() != last()">
  472.     <xsl:text>, </xsl:text>
  473. </xsl:if>
  474. </xsl:template>
  475. <!-- /context -->
  476.  
  477.  
  478. <!-- ==================================================================== -->
  479. <!-- <modulelist>                                                         -->
  480. <!-- ==================================================================== -->
  481. <xsl:template match="modulelist">
  482. <xsl:for-each select="module">
  483.     <xsl:call-template name="module" />
  484.     <xsl:if test="position() != last()">
  485.         <xsl:text>, </xsl:text>
  486.     </xsl:if>
  487. </xsl:for-each>
  488. </xsl:template>
  489. <!-- /modulelist -->
  490.  
  491.  
  492. <!-- ==================================================================== -->
  493. <!-- modulesynopsis/compatibility                                         -->
  494. <!-- ==================================================================== -->
  495. <xsl:template match="modulesynopsis/compatibility">
  496. <xsl:apply-templates />
  497. </xsl:template>
  498.  
  499.  
  500. <!-- ==================================================================== -->
  501. <!-- directivesynopsis/compatibility                                      -->
  502. <!-- ==================================================================== -->
  503. <xsl:template match="directivesynopsis/compatibility">
  504. <xsl:apply-templates />
  505. </xsl:template>
  506.  
  507. </xsl:stylesheet>
  508.