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 / dir2page.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.4 KB  |  76 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 2002-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. <xsl:stylesheet version="1.0"
  19.  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  20.  xmlns:dir="http://apache.org/cocoon/directory/2.0">
  21.  
  22.   <xsl:template match="/">
  23.     <html><head><title>Image Directory Generator demonstration</title></head>
  24.     <body>
  25.       <h1>Image Directory Generator demonstration</h1>
  26.       <xsl:apply-templates/>
  27.       <p>
  28.         See other <a href=".">image reader</a> samples.
  29.       </p>
  30.       <p>
  31.         See documentation for
  32.         <a href="../../docs/userdocs/generators/imagedirectory-generator.html">Image
  33.         Directory Generator</a> and
  34.         <a href="../../docs/userdocs/readers/image-reader.html">Image Reader</a>
  35.       </p>
  36.     </body></html>
  37.   </xsl:template>
  38.  
  39.   <xsl:template match="dir:directory">
  40.     <table border="1" cellpadding="3" cellspacing="3">
  41.       <tr>
  42.         <th>Image</th>
  43.         <th>Name</th>
  44.         <th>Width</th>
  45.         <th>Height</th>
  46.         <th colspan="2">Scale Size</th>
  47.       </tr>
  48.       <xsl:apply-templates select="dir:file|dir:directory"/>
  49.     </table>
  50.   </xsl:template>
  51.  
  52.   <xsl:template match="dir:file">
  53.     <xsl:variable name="basename" select="substring-before(@name,'.jpg')"/>
  54.     <tr>
  55.       <td valign="top">
  56.         <img src="full-{$basename}" alt="{@name} (full size)"
  57.           title="{@name} (full size)"
  58.           width="{@width}" height="{@height}"
  59.         />
  60.       </td>
  61.       <td valign="top"><xsl:value-of select="$basename"/></td>
  62.       <td valign="top"><xsl:value-of select="@width"/></td>
  63.       <td valign="top"><xsl:value-of select="@height"/></td>
  64.       <td valign="top">
  65.         <a href="scale-{@width*2}-{@height*2}-{$basename}"
  66.            title="{@name} (double size)">2x</a>
  67.       </td>
  68.       <td valign="top">
  69.         <a href="scale-{@width*3}-{@height*3}-{$basename}"
  70.            title="{@name} (triple size)">3x</a>
  71.       </td>
  72.     </tr>
  73.   </xsl:template>
  74.  
  75. </xsl:stylesheet>
  76.