home *** CD-ROM | disk | FTP | other *** search
/ PC World 2003 May / PCWorld_2003-05_cd.bin / Komunik / apache / apache_2.0.45-win32-x86-no_ssl.msi / Data.Cab / F233080_synopsis.xsl < prev    next >
Extensible Markup Language  |  2003-01-08  |  19KB  |  629 lines

  1. <?xml version="1.0"?>
  2. <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
  3. <xsl:stylesheet version="1.0"
  4.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  5.                   xmlns="http://www.w3.org/1999/xhtml">
  6.  
  7.   <!--                                                    -->
  8.   <!-- <modulesynopsis>                                   -->
  9.   <!-- Process an entire document into an HTML page       -->
  10.   <!--                                                    -->
  11.   <xsl:template match="modulesynopsis">
  12.     <html xml:lang="{$messages/@lang}" lang="{$messages/@lang}">
  13.       <xsl:call-template name="head"/>
  14.  
  15. <xsl:text>
  16. </xsl:text> <!-- insert line break -->
  17.  
  18.       <body>
  19.  
  20. <xsl:text>
  21. </xsl:text> <!-- insert line break -->
  22.  
  23.         <xsl:call-template name="top"/>
  24.  
  25. <xsl:text>
  26. </xsl:text> <!-- insert line break -->
  27.  
  28.         <div id="page-content">
  29.  
  30. <xsl:text>
  31. </xsl:text> <!-- insert line break -->
  32.  
  33.           <div id="preamble">
  34.             <h1>
  35.               <xsl:choose>
  36.                 <xsl:when test="status='Core'">
  37.                   <xsl:value-of select="$messages/message[@name='apachecore']"/>
  38.                 </xsl:when>
  39.  
  40.                 <xsl:when test="name='mpm_common'">
  41.                   <xsl:value-of select="$messages/message[@name='apachempmcommon']"/>
  42.                 </xsl:when>
  43.  
  44.                 <xsl:when test="status='MPM'">
  45.                   <xsl:value-of select="$messages/message[@name='apachempm']"/>
  46.                   <xsl:text> </xsl:text>
  47.                   <xsl:call-template name="module-translatename">
  48.                     <xsl:with-param name="name" select="name" />
  49.                   </xsl:call-template>
  50.                 </xsl:when>
  51.  
  52.                 <xsl:otherwise>
  53.                   <xsl:if test="status='Obsolete'">
  54.                     <xsl:value-of select="$messages/message[@name='obsoleteapachemodule']"/>
  55.                   </xsl:if>
  56.                   <xsl:if test="status!='Obsolete'">
  57.                     <xsl:value-of select="$messages/message[@name='apachemodule']"/>
  58.                   </xsl:if>
  59.                   <xsl:text> </xsl:text>
  60.                   <xsl:value-of select="name"/>
  61.                 </xsl:otherwise>
  62.               </xsl:choose>
  63.             </h1>
  64.  
  65. <xsl:text>
  66. </xsl:text> <!-- insert line break -->
  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="$messages/message[@name='description']"/>
  74.                     <xsl:text>:</xsl:text>
  75.                   </a>
  76.                 </th>
  77.                 <td>
  78.                   <xsl:apply-templates select="description"/>
  79.                 </td>
  80.               </tr>
  81.  
  82. <xsl:text>
  83. </xsl:text> <!-- insert line break -->
  84.  
  85.               <tr>
  86.                 <th>
  87.                   <a href="module-dict.html#Status">
  88.                     <xsl:value-of select="$messages/message[@name='status']"/>
  89.                     <xsl:text>:</xsl:text>
  90.                   </a>
  91.                 </th>
  92.                 <td>
  93.                   <xsl:value-of select="status"/>
  94.  
  95.                   <xsl:if test="hint">
  96.                     <em>
  97.                       <xsl:text> (</xsl:text>
  98.                       <xsl:apply-templates select="hint"/>
  99.                       <xsl:text>)</xsl:text>
  100.                     </em>
  101.                     <br />
  102.                   </xsl:if>
  103.                 </td>
  104.               </tr>
  105.  
  106.               <xsl:if test="identifier">
  107.  
  108. <xsl:text>
  109. </xsl:text> <!-- insert line break -->
  110.  
  111.               <tr>
  112.                 <th>
  113.                   <a href="module-dict.html#ModuleIdentifier">
  114.                     <xsl:value-of select="$messages/message[@name='moduleidentifier']"/>
  115.                     <xsl:text>:</xsl:text>
  116.                   </a>
  117.                 </th>
  118.                 <td>
  119.                   <xsl:value-of select="identifier"/>
  120.                 </td>
  121.               </tr>
  122.               </xsl:if>
  123.  
  124.               <xsl:if test="sourcefile">
  125.  
  126. <xsl:text>
  127. </xsl:text> <!-- insert line break -->
  128.  
  129.               <tr>
  130.                 <th>
  131.                   <a href="module-dict.html#SourceFile">
  132.                     <xsl:value-of select="$messages/message[@name='sourcefile']"/>
  133.                     <xsl:text>:</xsl:text>
  134.                   </a>
  135.                 </th>
  136.                 <td>
  137.                   <xsl:value-of select="sourcefile"/>
  138.                 </td>
  139.               </tr>
  140.               </xsl:if>
  141.  
  142.               <xsl:if test="compatibility">
  143.  
  144. <xsl:text>
  145. </xsl:text> <!-- insert line break -->
  146.  
  147.               <tr>
  148.                 <th>
  149.                   <a href="module-dict.html#Compatibility">
  150.                     <xsl:value-of select="$messages/message[@name='compatibility']"/>
  151.                     <xsl:text>:</xsl:text>
  152.                   </a>
  153.                 </th>
  154.                 <td>
  155.                   <xsl:apply-templates select="compatibility"/>
  156.                 </td>
  157.               </tr>
  158.               </xsl:if>
  159.             </table>
  160.  
  161. <xsl:text>
  162. </xsl:text> <!-- insert line break -->
  163.  
  164.             <!-- Summary of module features/usage (1 to 3 paragraphs, optional) -->
  165.             <xsl:if test="summary">
  166.               <h3>
  167.                 <xsl:value-of select="$messages/message[@name='summary']"/>
  168.               </h3>
  169.  
  170. <xsl:text>
  171. </xsl:text> <!-- insert line break -->
  172.  
  173.               <xsl:apply-templates select="summary"/>
  174.             </xsl:if>
  175.           </div> <!-- /preamble -->
  176.  
  177. <xsl:text>
  178. </xsl:text> <!-- insert line break -->
  179.  
  180.           <div id="quickview">
  181.  
  182.             <!-- Index of directives, automatically generated from
  183.                  directivesynopsis/name -->
  184.             <h3 class="directives">
  185.               <xsl:value-of select="$messages/message[@name='directives']"/>
  186.             </h3>
  187.  
  188. <xsl:text>
  189. </xsl:text> <!-- insert line break -->
  190.  
  191.             <xsl:if test="directivesynopsis">
  192.               <ul id="toc">
  193.  
  194. <xsl:text>
  195. </xsl:text> <!-- insert line break -->
  196.  
  197.                 <xsl:for-each select="directivesynopsis">
  198.                   <xsl:sort select="name"/>
  199.                   <xsl:variable name="lowername" select="translate(name, $uppercase, $lowercase)"/>
  200.  
  201.                   <xsl:if test="not(@location)">
  202.                     <li>
  203.                       <img src="{$path}/images/down.gif" alt="" />
  204.                       <xsl:text> </xsl:text>
  205.                       <a href="#{$lowername}">
  206.                         <xsl:if test="@type='section'"><</xsl:if>
  207.                         <xsl:value-of select="name"/>
  208.                         <xsl:if test="@type='section'">></xsl:if>
  209.                       </a>
  210.                     </li>
  211.  
  212. <xsl:text>
  213. </xsl:text> <!-- insert linebreak -->
  214.  
  215.                   </xsl:if>
  216.  
  217.                   <xsl:if test="@location">
  218.                     <xsl:variable name="lowerlocation" select="translate(@location, $uppercase, $lowercase)"/>
  219.  
  220.                     <li>
  221.                       <img src="{$path}/images/right.gif" alt="" />
  222.                       <xsl:text> </xsl:text>
  223.                       <a href="{$lowerlocation}.html#{$lowername}">
  224.                         <xsl:if test="@type='section'"><</xsl:if>
  225.                         <xsl:value-of select="name"/>
  226.                         <xsl:if test="@type='section'">></xsl:if>
  227.                       </a>
  228.                     </li>
  229.  
  230. <xsl:text>
  231. </xsl:text> <!-- insert linebreak -->
  232.  
  233.                   </xsl:if>
  234.                 </xsl:for-each>
  235.               </ul> <!-- /toc -->
  236.  
  237. <xsl:text>
  238. </xsl:text> <!-- insert line break -->
  239.  
  240.             </xsl:if>
  241.  
  242.             <xsl:if test="not(directivesynopsis)">
  243.               <p>
  244.                 <xsl:value-of select="$messages/message[@name='nodirectives']"/>
  245.               </p>
  246.  
  247. <xsl:text>
  248. </xsl:text> <!-- insert line break -->
  249.  
  250.             </xsl:if>
  251.  
  252.             <xsl:if test="section">
  253.               <h3>
  254.                 <xsl:value-of select="$messages/message[@name='topics']"/>
  255.               </h3>
  256.  
  257. <xsl:text>
  258. </xsl:text> <!-- insert line break -->
  259.  
  260.               <ul id="topics">
  261.  
  262. <xsl:text>
  263. </xsl:text> <!-- insert line break -->
  264.  
  265.                 <xsl:apply-templates select="section" mode="index"/>
  266.               </ul>
  267.             </xsl:if>
  268.  
  269.             <xsl:if test="seealso">
  270.           <h3>
  271.                   <xsl:value-of select="$messages/message[@name='seealso']"/>
  272.               </h3>
  273.  
  274. <xsl:text>
  275. </xsl:text> <!-- insert line break -->
  276.  
  277.               <ul class="seealso">
  278.  
  279. <xsl:text>
  280. </xsl:text> <!-- insert line break -->
  281.  
  282.                 <xsl:for-each select="seealso">
  283.                   <li>
  284.                     <xsl:apply-templates/>
  285.                   </li>
  286.  
  287. <xsl:text>
  288. </xsl:text> <!-- insert line break -->
  289.  
  290.                 </xsl:for-each>
  291.               </ul>
  292.             </xsl:if>
  293.  
  294.           </div> <!-- /quickview -->
  295.  
  296. <xsl:text>
  297. </xsl:text> <!-- insert line break -->
  298.  
  299.           <!-- Sections of documentation about the module as a whole -->
  300.           <xsl:apply-templates select="section"/>
  301.  
  302. <xsl:text>
  303. </xsl:text> <!-- insert line break -->
  304.  
  305.           <!-- Directive documentation -->
  306.           <xsl:apply-templates select="directivesynopsis">
  307.             <xsl:sort select="name"/>
  308.           </xsl:apply-templates>
  309.  
  310.         </div> <!-- /page-content -->
  311.  
  312. <xsl:text>
  313. </xsl:text> <!-- insert line break -->
  314.  
  315.         <xsl:call-template name="bottom"/>
  316.  
  317. <xsl:text>
  318. </xsl:text> <!-- insert line break -->
  319.  
  320.       </body>
  321.     </html>
  322.   </xsl:template>
  323.   <!-- /modulesynopsis -->
  324.  
  325.  
  326.   <!--                                                            -->
  327.   <!--    modulesynopsis/compatibility                            -->
  328.   <!--                                                            -->
  329.   <xsl:template match="modulesynopsis/compatibility">
  330.     <xsl:apply-templates />
  331.   </xsl:template>
  332.  
  333.  
  334.   <!--                                                            -->
  335.   <!--    directivesynopsis/compatibility                         -->
  336.   <!--                                                            -->
  337.   <xsl:template match="directivesynopsis/compatibility">
  338.     <xsl:apply-templates />
  339.   </xsl:template>
  340.  
  341.  
  342.   <!--                                                            -->
  343.   <!--    Directivesynopsis                                       -->
  344.   <!--                                                            -->
  345.   <xsl:template match="directivesynopsis">
  346.     <xsl:if test="not(@location)">
  347.  
  348.       <xsl:call-template name="toplink"/>
  349.  
  350. <xsl:text>
  351. </xsl:text> <!-- insert line break -->
  352.  
  353.       <div class="directive-section">
  354.         <xsl:variable name="lowername" select="translate(name, $uppercase, $lowercase)"/>
  355.  
  356.         <!-- Directive heading gets both mixed case and lowercase anchors,
  357.              and includes lt/gt only for "section" directives -->
  358.         <h2>
  359.           <a id="{name}" name="{name}">
  360.             <xsl:if test="@type='section'"><</xsl:if>
  361.             <xsl:value-of select="name"/>
  362.             <xsl:if test="@type='section'">></xsl:if>
  363.           </a>
  364.           <xsl:choose>
  365.             <xsl:when test="$messages/message[@name='directive']/@replace-space-with">
  366.               <xsl:value-of select="$messages/message[@name='directive']/@replace-space-with"/>
  367.             </xsl:when>
  368.             <xsl:otherwise>
  369.               <xsl:text> </xsl:text>
  370.             </xsl:otherwise>
  371.           </xsl:choose>
  372.           <a id="{$lowername}" name="{$lowername}">
  373.             <xsl:value-of select="$messages/message[@name='directive']"/>
  374.           </a>
  375.         </h2>
  376.  
  377. <xsl:text>
  378. </xsl:text> <!-- insert line break -->
  379.  
  380.         <!-- Directive header -->
  381.         <table class="directive">
  382.  
  383. <xsl:text>
  384. </xsl:text> <!-- insert line break -->
  385.  
  386.           <tr>
  387.             <th>
  388.               <a href="directive-dict.html#Description">
  389.                 <xsl:value-of select="$messages/message[@name='description']"/>
  390.                 <xsl:text>:</xsl:text>
  391.               </a>
  392.             </th>
  393.             <td>
  394.               <xsl:value-of select="description"/>
  395.             </td>
  396.           </tr>
  397.  
  398. <xsl:text>
  399. </xsl:text> <!-- insert line break -->
  400.  
  401.           <tr>
  402.             <th>
  403.               <a href="directive-dict.html#Syntax">
  404.                 <xsl:value-of select="$messages/message[@name='syntax']"/>
  405.                 <xsl:text>:</xsl:text>
  406.               </a>
  407.             </th>
  408.             <td>
  409.               <code>
  410.                 <xsl:apply-templates select="syntax"/>
  411.               </code>
  412.             </td>
  413.           </tr>
  414.  
  415.           <xsl:if test="default">
  416.  
  417. <xsl:text>
  418. </xsl:text> <!-- insert line break -->
  419.  
  420.           <tr>
  421.             <th>
  422.               <a href="directive-dict.html#Default">
  423.                 <xsl:value-of select="$messages/message[@name='default']"/>
  424.                 <xsl:text>:</xsl:text>
  425.               </a>
  426.             </th>
  427.             <td>
  428.               <code>
  429.                 <xsl:apply-templates select="default"/>
  430.               </code>
  431.             </td>
  432.           </tr>
  433.           </xsl:if>
  434.  
  435. <xsl:text>
  436. </xsl:text> <!-- insert line break -->
  437.  
  438.           <tr>
  439.             <th>
  440.               <a href="directive-dict.html#Context">
  441.                 <xsl:value-of select="$messages/message[@name='context']"/>
  442.                 <xsl:text>:</xsl:text>
  443.               </a>
  444.             </th>
  445.             <td>
  446.               <xsl:apply-templates select="contextlist"/>
  447.             </td>
  448.           </tr>
  449.  
  450.           <xsl:if test="override">
  451.  
  452. <xsl:text>
  453. </xsl:text> <!-- insert line break -->
  454.  
  455.           <tr>
  456.             <th>
  457.               <a href="directive-dict.html#Override">
  458.                 <xsl:value-of select="$messages/message[@name='override']"/>
  459.                 <xsl:text>:</xsl:text>
  460.               </a>
  461.             </th>
  462.             <td>
  463.               <xsl:value-of select="override"/>
  464.             </td>
  465.           </tr>
  466.           </xsl:if>
  467.  
  468. <xsl:text>
  469. </xsl:text> <!-- insert line break -->
  470.  
  471.           <tr>
  472.             <th>
  473.               <a href="directive-dict.html#Status">
  474.                 <xsl:value-of select="$messages/message[@name='status']"/>
  475.                 <xsl:text>:</xsl:text>
  476.               </a>
  477.             </th>
  478.             <td>
  479.               <xsl:value-of select="../status"/>
  480.             </td>
  481.           </tr>
  482.  
  483. <xsl:text>
  484. </xsl:text> <!-- insert line break -->
  485.  
  486.           <tr>
  487.             <th>
  488.               <a href="directive-dict.html#Module">
  489.                 <xsl:value-of select="$messages/message[@name='module']"/>
  490.                 <xsl:text>:</xsl:text>
  491.               </a>
  492.             </th>
  493.             <td>
  494.               <xsl:if test="modulelist">
  495.                 <xsl:apply-templates select="modulelist"/>
  496.               </xsl:if>
  497.  
  498.               <xsl:if test="not(modulelist)">
  499.                 <xsl:value-of select="../name"/>
  500.               </xsl:if>
  501.             </td>
  502.           </tr>
  503.  
  504.           <xsl:if test="compatibility">
  505.  
  506. <xsl:text>
  507. </xsl:text> <!-- insert line break -->
  508.  
  509.           <tr>
  510.             <th>
  511.               <a href="directive-dict.html#Compatibility">
  512.                 <xsl:value-of select="$messages/message[@name='compatibility']"/>
  513.                 <xsl:text>:</xsl:text>
  514.               </a>
  515.             </th>
  516.             <td>
  517.               <xsl:apply-templates select="compatibility"/>
  518.             </td>
  519.           </tr>
  520.           </xsl:if>
  521.  
  522. <xsl:text>
  523. </xsl:text> <!-- insert line break -->
  524.  
  525.         </table>
  526.  
  527.         <xsl:apply-templates select="usage"/>
  528.  
  529. <xsl:text>
  530. </xsl:text> <!-- insert line break -->
  531.  
  532.         <xsl:if test="seealso">
  533.           <h3>
  534.             <xsl:value-of select="$messages/message[@name='seealso']"/>
  535.           </h3>
  536.  
  537. <xsl:text>
  538. </xsl:text> <!-- insert line break -->
  539.  
  540.           <ul>
  541.  
  542. <xsl:text>
  543. </xsl:text> <!-- insert line break -->
  544.  
  545.             <xsl:for-each select="seealso">
  546.               <li>
  547.                 <xsl:apply-templates/>
  548.               </li>
  549.  
  550. <xsl:text>
  551. </xsl:text> <!-- insert line break -->
  552.  
  553.             </xsl:for-each>
  554.           </ul>
  555.  
  556. <xsl:text>
  557. </xsl:text> <!-- insert line break -->
  558.  
  559.         </xsl:if>
  560.  
  561.       </div> <!-- /directive-section -->
  562.  
  563. <xsl:text>
  564. </xsl:text> <!-- insert line break -->
  565.  
  566.     </xsl:if>
  567.   </xsl:template>
  568.   <!-- /directivesynopsis -->
  569.  
  570.  
  571.   <!--                                                    -->
  572.   <!-- <contextlist>                                      -->
  573.   <!-- Passes through content                             -->
  574.   <!--                                                    -->
  575.   <xsl:template match="contextlist">
  576.     <xsl:apply-templates select="context"/>
  577.   </xsl:template>
  578.   <!-- /contextlist -->
  579.  
  580.  
  581.   <!--                                                    -->
  582.   <!-- <context>                                          -->
  583.   <!-- Each entry is separeted with a comma               -->
  584.   <!--                                                    -->
  585.   <xsl:template match="context">
  586.     <xsl:choose>
  587.       <xsl:when test="normalize-space(.) = 'server config'">
  588.         <xsl:value-of select="$messages/message[@name='serverconfig']"/>
  589.       </xsl:when>
  590.       <xsl:when test="normalize-space(.) = 'virtual host'">
  591.         <xsl:value-of select="$messages/message[@name='virtualhost']"/>
  592.       </xsl:when>
  593.       <xsl:when test="normalize-space(.) = 'directory'">
  594.         <xsl:value-of select="$messages/message[@name='directory']"/>
  595.       </xsl:when>
  596.       <xsl:when test="normalize-space(.) = '.htaccess'">
  597.         <xsl:value-of select="$messages/message[@name='htaccess']"/>
  598.       </xsl:when>
  599.  
  600.       <xsl:otherwise> <!-- error -->
  601.         <xsl:message terminate="yes">
  602.           unknown context: <xsl:value-of select="." />
  603.         </xsl:message>
  604.       </xsl:otherwise>
  605.     </xsl:choose>
  606.  
  607.     <xsl:if test="position() != last()">
  608.       <xsl:text>, </xsl:text>
  609.     </xsl:if>
  610.   </xsl:template>
  611.   <!-- /context -->
  612.  
  613.  
  614.   <!--                                                    -->
  615.   <!-- <modulelist>                                       -->
  616.   <!-- Passes through content                             -->
  617.   <!--                                                    -->
  618.   <xsl:template match="modulelist">
  619.     <xsl:for-each select="module">
  620.       <xsl:call-template name="module"/>
  621.       <xsl:if test="position() != last()">
  622.         <xsl:text>, </xsl:text>
  623.       </xsl:if>
  624.     </xsl:for-each>
  625.   </xsl:template>
  626.   <!-- /modulelist -->
  627.  
  628. </xsl:stylesheet>
  629.