home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 May / PCWorld_2004-05_cd.bin / komunikace / apache / apache_2.0.48-win32-x86-no_ssl.msi / Data.Cab / F252985_sitemap.xsl < prev    next >
Extensible Markup Language  |  2003-05-29  |  11KB  |  283 lines

  1. <?xml version="1.0"?><!--
  2. /* ====================================================================
  3.  * The Apache Software License, Version 1.1
  4.  *
  5.  * Copyright (c) 2002-2003 The Apache Software Foundation.  All rights
  6.  * reserved.
  7.  *
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  *
  12.  * 1. Redistributions of source code must retain the above copyright
  13.  *    notice, this list of conditions and the following disclaimer.
  14.  *
  15.  * 2. Redistributions in binary form must reproduce the above copyright
  16.  *    notice, this list of conditions and the following disclaimer in
  17.  *    the documentation and/or other materials provided with the
  18.  *    distribution.
  19.  *
  20.  * 3. The end-user documentation included with the redistribution,
  21.  *    if any, must include the following acknowledgment:
  22.  *       "This product includes software developed by the
  23.  *        Apache Software Foundation (http://www.apache.org/)."
  24.  *    Alternately, this acknowledgment may appear in the software itself,
  25.  *    if and wherever such third-party acknowledgments normally appear.
  26.  *
  27.  * 4. The names "Apache" and "Apache Software Foundation" must
  28.  *    not be used to endorse or promote products derived from this
  29.  *    software without prior written permission. For written
  30.  *    permission, please contact apache@apache.org.
  31.  *
  32.  * 5. Products derived from this software may not be called "Apache",
  33.  *    nor may "Apache" appear in their name, without prior written
  34.  *    permission of the Apache Software Foundation.
  35.  *
  36.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  37.  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  38.  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  39.  * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
  40.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  41.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  42.  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  43.  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  44.  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  45.  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  46.  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  47.  * SUCH DAMAGE.
  48.  * ====================================================================
  49.  *
  50.  * This software consists of voluntary contributions made by many
  51.  * individuals on behalf of the Apache Software Foundation.  For more
  52.  * information on the Apache Software Foundation, please see
  53.  * <http://www.apache.org/>.
  54.  */ -->
  55. <!DOCTYPE xsl:stylesheet [
  56.     <!ENTITY lf SYSTEM "util/lf.xml">
  57. ]>
  58. <xsl:stylesheet version="1.0"
  59.               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  60.                   xmlns="http://www.w3.org/1999/xhtml">
  61.  
  62. <!-- If we use document() in the context of this xsl file, the contextual -->
  63. <!-- CWD is the xsl file containing directory. $basedir reflects the      -->
  64. <!-- manual root for that case.                                           -->
  65. <xsl:variable name="basedir" select="'../../'" />
  66.  
  67. <!-- ==================================================================== -->
  68. <!-- <sitemap>                                                            -->
  69. <!-- Process an entire document into an HTML page                         -->
  70. <!-- ==================================================================== -->
  71. <xsl:template match="/sitemap">
  72. <html xml:lang="{$messages/@lang}" lang="{$messages/@lang}">
  73.     <xsl:call-template name="head" />&lf;
  74.  
  75.     <body id="manual-page">&lf;
  76.         <xsl:call-template name="top" />&lf;
  77.  
  78.         <div id="page-content">
  79.             <div id="preamble">        
  80.                 <h1>
  81.                     <xsl:value-of select="title" />
  82.                 </h1>&lf;
  83.  
  84.                 <xsl:call-template name="langavail" />&lf;
  85.  
  86.                 <xsl:apply-templates select="summary" />
  87.             </div>&lf; <!-- /#preamble -->
  88.           
  89.             <xsl:if test="(not($is-chm) and count(category) > 1) or seealso">
  90.                 <div id="quickview">
  91.                     <xsl:if test="not($is-chm) and count(category) > 1">
  92.                         <ul id="toc">&lf;
  93.                         <xsl:for-each select="category">
  94.                             <xsl:choose>
  95.                             <xsl:when test="@id">
  96.                                 <li>
  97.                                     <img src="{$path}/images/down.gif" alt="" />
  98.                                     <xsl:text> </xsl:text>
  99.                                     <a href="#{@id}">
  100.                                         <xsl:apply-templates
  101.                                             select="title" mode="print" />
  102.                                     </a>
  103.                                 </li>&lf;
  104.                             </xsl:when>
  105.                             <xsl:otherwise>
  106.                                 <li>
  107.                                     <img src="{$path}/images/down.gif" alt="" />
  108.                                     <xsl:text> </xsl:text>
  109.                                     <xsl:apply-templates
  110.                                         select="title" mode="print" />
  111.                                 </li>&lf;
  112.                             </xsl:otherwise>
  113.                             </xsl:choose>
  114.                         </xsl:for-each>
  115.                         </ul>&lf;
  116.                     </xsl:if>
  117.  
  118.                     <xsl:if test="seealso">
  119.                         <h3>
  120.                             <xsl:value-of select="$messages/message
  121.                                                   [@name='seealso']" />
  122.                         </h3>&lf;
  123.  
  124.                         <ul class="seealso">&lf;
  125.                         <xsl:for-each select="seealso">
  126.                             <li>
  127.                                 <xsl:apply-templates />
  128.                             </li>&lf;
  129.                         </xsl:for-each>
  130.                         </ul>&lf;
  131.                     </xsl:if>
  132.                 </div>&lf; <!-- /#quickview -->
  133.             </xsl:if> <!-- have sidebar -->
  134.  
  135.             <xsl:apply-templates select="category" />
  136.         </div>&lf; <!-- /#page-content -->
  137.  
  138.         <xsl:call-template name="bottom" />&lf;
  139.     </body>
  140. </html>
  141. </xsl:template>
  142. <!-- /sitemap -->
  143.   
  144.  
  145. <!-- ==================================================================== -->
  146. <!-- category/page                                                        -->
  147. <!-- ==================================================================== -->
  148. <xsl:template match="sitemap/category/page">
  149. <li>
  150.     <xsl:if test="@separate='yes'">
  151.         <xsl:attribute name="class">separate</xsl:attribute>
  152.     </xsl:if>
  153.  
  154.     <xsl:choose>
  155.     <xsl:when test="@href">
  156.         <a href="{@href}">
  157.             <xsl:call-template name="helper.uri.fix">
  158.                 <xsl:with-param name="uri" select="@href" />
  159.             </xsl:call-template>
  160.             <xsl:value-of select="." />
  161.         </a>
  162.     </xsl:when>
  163.     <xsl:otherwise>
  164.         <xsl:value-of select="." />
  165.     </xsl:otherwise>
  166.     </xsl:choose>
  167. </li>&lf;
  168. </xsl:template>
  169. <!-- /category/page -->
  170.  
  171.  
  172. <!-- ==================================================================== -->
  173. <!-- Process a sitemap category                                           -->
  174. <!-- ==================================================================== -->
  175. <xsl:template match="sitemap/category">
  176. <xsl:call-template name="toplink" />&lf;
  177.  
  178. <div class="section">
  179.     <!-- Category title -->
  180.     <h2>
  181.         <xsl:choose>
  182.         <xsl:when test="@id">
  183.             <a id="{@id}" name="{@id}">
  184.                 <xsl:apply-templates select="title" mode="print" />
  185.             </a>
  186.         </xsl:when>
  187.         <xsl:otherwise>
  188.             <xsl:apply-templates select="title" mode="print" />
  189.         </xsl:otherwise>
  190.         </xsl:choose>
  191.     </h2>&lf;
  192.  
  193.     <!-- category body -->
  194.     <ul>
  195.         <xsl:apply-templates select="page" />
  196.     </ul>
  197.       
  198.     <!-- optional ... -->
  199.     <xsl:apply-templates select="modulefilelist" />&lf;
  200. </div> <!-- /.section -->
  201. </xsl:template>
  202. <!-- /category -->
  203.  
  204.  
  205. <!-- ==================================================================== -->
  206. <!-- category/modulefilelist                                              -->
  207. <!-- insert module list into sitemap                                      -->
  208. <!-- ==================================================================== -->
  209. <xsl:template match="sitemap/category/modulefilelist">
  210. <xsl:variable name="translist">
  211.     <xsl:text>-</xsl:text>
  212.     <xsl:for-each select="modulefile">
  213.         <xsl:variable name="current"
  214.             select="document(concat($basedir,'mod/',.))/modulesynopsis" />
  215.    
  216.         <xsl:text> </xsl:text>
  217.         <xsl:value-of select="$current/name" />
  218.         <xsl:text> </xsl:text>
  219.         <xsl:call-template name="module-translatename">
  220.             <xsl:with-param name="name" select="$current/name" />
  221.         </xsl:call-template>
  222.         <xsl:text> -</xsl:text>
  223.     </xsl:for-each>
  224. </xsl:variable>
  225.  
  226. <ul>
  227. <li>
  228.     <a href="mod/core.html">
  229.         <xsl:value-of select="$messages/message[@name='apachecore']" />
  230.     </a>
  231. </li>&lf;
  232. <li>
  233.     <a href="mod/mpm_common.html">
  234.         <xsl:value-of select="$messages/message[@name='apachempmcommon']" />
  235.     </a>
  236. </li>&lf;
  237.  
  238. <xsl:for-each select="modulefile">
  239. <xsl:sort select="substring-before(substring-after($translist, concat('- ',
  240.     document(concat($basedir,'mod/',.))/modulesynopsis/name, ' ')), ' -')" />
  241.  
  242.     <xsl:variable name="current" select="document(concat($basedir, 'mod/', .))
  243.                                          /modulesynopsis" />
  244.  
  245.     <xsl:if test="$current/status='MPM' and $current/name!='mpm_common'">
  246.         <xsl:variable name="name" select="substring-before(substring-after(
  247.                         $translist, concat('- ', $current/name, ' ')), ' -')" />
  248.  
  249.         <li>
  250.             <a href="mod/{$current/name}.html">
  251.                 <xsl:value-of select="$messages/message[@name='apachempm']" />
  252.                 <xsl:text> </xsl:text>
  253.                 <xsl:value-of select="$name" />
  254.             </a>
  255.         </li>&lf;
  256.     </xsl:if>
  257. </xsl:for-each>
  258. </ul>
  259.  
  260. <ul>
  261. <xsl:for-each select="modulefile">
  262. <xsl:sort select="substring-before(substring-after($translist, concat('- ',
  263.     document(concat($basedir,'mod/',.))/modulesynopsis/name, ' ')), ' -')"/>
  264.  
  265.     <xsl:variable name="current" select="document(concat($basedir,'mod/',.))
  266.                                          /modulesynopsis" />
  267.  
  268.     <xsl:if test="$current/status!='MPM' and $current/status!='Core'">
  269.         <li>
  270.             <a href="mod/{$current/name}.html">
  271.                 <xsl:value-of select="$messages/message[@name='apachemodule']"/>
  272.                 <xsl:text> </xsl:text>
  273.                 <xsl:value-of select="$current/name"/>
  274.             </a>
  275.         </li>&lf;
  276.     </xsl:if>
  277. </xsl:for-each>
  278. </ul>
  279. </xsl:template>
  280. <!-- /category/modulefilelist -->
  281.  
  282. </xsl:stylesheet>
  283.