home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / sitemaplist2index.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.6 KB  |  75 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:dir="http://apache.org/cocoon/directory/2.0">
  18.  
  19. <xsl:template match="/">
  20.     <html>
  21.         <head>
  22.             <xsl:if test="not(//dir)">
  23.                 <META HTTP-EQUIV="refresh" content="2;URL=index-list.html" /> 
  24.             </xsl:if>
  25.             <title>Cocoon Sitemap Viewer</title>
  26.             <style type="text/css">
  27.                 td, th { vertical-align: top }
  28.                 pre.example { color: blue }
  29.             </style>
  30.         </head>
  31.         <body>
  32.             <xsl:copy-of select="/introhtml|/*/introhtml"/>
  33.             <hr/>       
  34.             <xsl:variable name="filecnthalf" select="(count(.//file)+1)  div 2"/>
  35.             <table>
  36.                 <tbody>
  37.                     <tr>
  38.                         <td>
  39.                             <xsl:apply-templates select=".//file[position() <= $filecnthalf]"/>
  40.                         </td>
  41.                         <td>
  42.                             <xsl:apply-templates select=".//file[position() > $filecnthalf]"/>
  43.                         </td>
  44.                     </tr>
  45.                 </tbody>
  46.             </table>
  47.  
  48.             <xsl:if test="not(//dir)">
  49.                 <b>Loading list of sitemaps.. . </b>
  50.                 <a href="index-list.html">click here if list won't load automatically    </a>
  51.                 <script type="text/javascript">
  52.                     // open the list of sitemaps when this page is loaded...
  53.                     //      window.location.href = "index-list.html"; 
  54.                 </script>
  55.             </xsl:if>
  56.  
  57.         </body>
  58.     </html>
  59. </xsl:template>
  60.  
  61. <xsl:template match="file">
  62.     <li>
  63.         <a href="{concat(substring-before(@filename,'.xmap'),'._xmap','?location=',@path)}"><xsl:value-of select="."/></a>
  64.     </li>
  65. </xsl:template>
  66.  
  67. <xsl:template match="dir">
  68.     <!--li>
  69.         <a href="{.}"><xsl:value-of select="."/></a>
  70.     </li-->
  71. </xsl:template>
  72.  
  73.  
  74. </xsl:stylesheet>
  75.