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 / dir-to-html.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.1 KB  |  66 lines

  1. <?xml version="1.0"?>
  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.  
  18. <!--
  19.     Simple listing of available yapt presentations
  20.     $Id: dir-to-html.xsl,v 1.2 2004/03/06 02:26:04 antonio Exp $
  21. -->
  22. <xsl:stylesheet
  23.     version="1.0"
  24.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  25.     xmlns:dir="http://apache.org/cocoon/directory/2.0"
  26. >
  27.  
  28.     <xsl:param name="pageTitle" select="'Available YAPT presentations'"/>
  29.     <xsl:param name="baseDir"/>
  30.  
  31.     <xsl:template match="/">
  32.         <html>
  33.             <head>
  34.                 <title><xsl:value-of select="$pageTitle"/></title>
  35.                 <link rel="stylesheet" type="text/css" href="css/yapt-style.css"/>
  36.             </head>
  37.             <body>
  38.                 <div id="content">
  39.                     <h1><xsl:value-of select="$pageTitle"/></h1>
  40.                     <ul>
  41.                         <xsl:apply-templates select="dir:directory/dir:file"/>
  42.                     </ul>
  43.                 </div>
  44.             </body>
  45.         </html>
  46.  
  47.     </xsl:template>
  48.  
  49.     <!-- link to presentation index and its source code -->
  50.     <xsl:template match="dir:file">
  51.         <xsl:variable name="presName" select="substring-before(@name,'.txt')"/>
  52.         <xsl:if test="$presName">
  53.             <li>
  54.                 <a href="{concat($baseDir,'/',$presName,'/html/index')}">
  55.                     <xsl:value-of select="$presName"/>
  56.                 </a>
  57.                 (
  58.                 <a href="{concat($baseDir,'/',$presName,'/txt/presentation')}">
  59.                     .txt source file
  60.                 </a>
  61.                 )
  62.             </li>
  63.         </xsl:if>
  64.     </xsl:template>
  65. </xsl:stylesheet>
  66.