Warning, /graphics/digikam/core/dplugins/generic/tools/htmlgallery/themes/elegant/template.xsl is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8" ?>
0002 
0003 <!--
0004  * ============================================================
0005  *
0006  * This file is a part of digiKam project
0007  * https://www.digikam.org
0008  *
0009  * Date        : 2007-03-11
0010  * Description : A LyteBox based theme for the digiKam html gallery tool.
0011  *
0012  * SPDX-FileCopyrightText: 2007 by Wojciech Jarosz <jiri at boha dot cz>
0013  *
0014  * SPDX-License-Identifier: GPL-2.0-or-later
0015  *
0016  * ============================================================
0017  -->
0018 
0019 <xsl:transform version="1.0"
0020   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
0021   xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
0022 <xsl:output
0023   method="xml"
0024   indent="yes" 
0025   encoding="iso-8859-1" 
0026   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
0027   doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" />
0028 
0029 <!-- ##################### VARIABLE INITIALIZATION ######################## -->
0030 <!-- Initialize some useful variables -->
0031 <xsl:variable name="theme" select="'grey'" />
0032 <xsl:variable name="outerBorder" select="boolean(0)" />
0033 <xsl:variable name="resizeSpeed" select="10" />
0034 <xsl:variable name="maxOpacity" select="80" />
0035 <xsl:variable name="navType" select="1" />
0036 <xsl:variable name="autoResize" select="boolean(1)" />
0037 <xsl:variable name="doAnimations" select="boolean(1)" />
0038 <xsl:variable name="showNavigation" select="boolean(1)" />
0039 <xsl:variable name="numCollections" select="count(collections/collection)"/>
0040         
0041         
0042 <!-- ##################### COLLECTION PAGES GENERATION #################### -->
0043 <xsl:template name="collectionPages">
0044   <xsl:call-template name="collectionPages.for.loop">
0045     <xsl:with-param name="i" select="1"/>
0046     <xsl:with-param name="count" select="ceiling(count(image) div $pageSize)"/>
0047   </xsl:call-template>
0048 </xsl:template>
0049 
0050 <!-- For loop used to generate collection pages -->
0051 <xsl:template name="collectionPages.for.loop">
0052   <xsl:param name="i"/>
0053   <xsl:param name="count"/>
0054   
0055   <xsl:if test="$i &lt; $count">
0056     <xsl:variable name="pageFilename" select="concat(fileName, '_', $i, '.html')"/>
0057     <exsl:document href="{$pageFilename}"
0058       method="xml"
0059       indent="yes" 
0060       encoding="iso-8859-1" 
0061       doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
0062       doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN">
0063       <xsl:call-template name="collectionPage">
0064         <xsl:with-param name="pageNum" select="$i"/>
0065         <xsl:with-param name="pageFilename" select="$pageFilename"/>
0066       </xsl:call-template>
0067     </exsl:document>
0068 
0069     <xsl:call-template name="collectionPages.for.loop">
0070       <xsl:with-param name="i" select="$i + 1"/>
0071       <xsl:with-param name="count" select="$count"/>
0072     </xsl:call-template>
0073   </xsl:if>
0074 </xsl:template>
0075 <!-- ##################### END COLLECTION PAGE GENERATION ################# -->
0076 
0077 
0078 <!-- ##################### IMAGE PAGINATION LINK GENERATATION ############# -->
0079 <xsl:template name="image.pagination">
0080 <xsl:param name="indexPage"/>
0081   <div class="pagination">
0082     <ul>
0083       <xsl:choose>
0084         <xsl:when test="position() &gt; 1">
0085           <li>
0086             <a href="{preceding-sibling::image[position()=1]/full/@fileName}.html">
0087               « <xsl:value-of select="$i18nPrevious"/>
0088             </a>
0089           </li>
0090         </xsl:when>
0091         <xsl:otherwise>
0092           <li class="disabled">
0093             « <xsl:value-of select="$i18nPrevious"/>
0094           </li>
0095         </xsl:otherwise>
0096       </xsl:choose>
0097 
0098       <li>
0099         <a href="../{$indexPage}"><xsl:value-of select="../name"/></a>
0100       </li>
0101 
0102       <xsl:choose>
0103         <xsl:when test="position() &lt; last()">
0104           <li>
0105             <a href="{following-sibling::image[position()=1]/full/@fileName}.html">
0106               <xsl:value-of select="$i18nNext"/> »
0107             </a>
0108           </li>
0109         </xsl:when>
0110         <xsl:otherwise>
0111           <li class="disabled">
0112             <xsl:value-of select="$i18nNext"/> »
0113           </li>
0114         </xsl:otherwise>
0115       </xsl:choose>
0116     </ul>
0117   </div>
0118 </xsl:template>
0119 
0120 
0121 <!-- ##################### PAGINATION LINK GENERATATION ################### -->
0122 <xsl:template name="pagination">
0123   <xsl:param name="numPages"/>
0124   <xsl:param name="pageNum"/>
0125   <xsl:if test="$numPages &gt; 1">
0126     <div class="pagination">
0127       <ul>
0128 
0129         <xsl:choose>
0130           <xsl:when test="number($pageNum) = 0">
0131             <li class="disabled">« <xsl:value-of select="$i18nPrevious"/></li>
0132           </xsl:when>
0133           <xsl:otherwise>
0134             <li>
0135               <a>
0136                 <xsl:attribute name="href">
0137                   <xsl:call-template name="pageLink">
0138                     <xsl:with-param name="collectionFilename" select="fileName"/>
0139                     <xsl:with-param name="pageNum" select="number($pageNum)-1"/>
0140                   </xsl:call-template>
0141                 </xsl:attribute>
0142                 « <xsl:value-of select="$i18nPrevious"/>
0143               </a>
0144             </li>
0145           </xsl:otherwise>
0146         </xsl:choose>
0147 
0148         <xsl:call-template name="pagination.for.loop">
0149           <xsl:with-param name="i" select="0"/>
0150           <xsl:with-param name="count" select="$numPages"/>
0151           <xsl:with-param name="currentPage" select="$pageNum"/>
0152         </xsl:call-template>
0153 
0154         <xsl:choose>
0155           <xsl:when test="number($pageNum) = number($numPages)-1">
0156             <li class="disabled"><xsl:value-of select="$i18nNext"/> »</li>
0157           </xsl:when>
0158           <xsl:otherwise>
0159             <li>
0160               <a>
0161                 <xsl:attribute name="href">
0162                   <xsl:call-template name="pageLink">
0163                     <xsl:with-param name="collectionFilename" select="fileName"/>
0164                     <xsl:with-param name="pageNum" select="number($pageNum)+1"/>
0165                   </xsl:call-template>
0166                 </xsl:attribute>
0167                 <xsl:value-of select="$i18nNext"/> »
0168               </a>
0169             </li>
0170           </xsl:otherwise>
0171         </xsl:choose>
0172 
0173       </ul>
0174     </div>
0175   </xsl:if>
0176 </xsl:template>
0177 
0178 <!-- For loop used to generate pagination links -->
0179 <xsl:template name="pagination.for.loop">
0180   <xsl:param name="i"/>
0181   <xsl:param name="count"/>
0182   <xsl:param name="currentPage"/>
0183 
0184   <xsl:if test="$i &lt; $count">
0185     <xsl:choose>
0186       <xsl:when test="number($currentPage) = $i">
0187         <li class="current"><xsl:value-of select="number($i)+1"/></li>
0188       </xsl:when>
0189       <xsl:otherwise>
0190         <li>
0191           <a>
0192             <xsl:attribute name="href">
0193               <xsl:call-template name="pageLink">
0194                 <xsl:with-param name="collectionFilename" select="fileName"/>
0195                 <xsl:with-param name="pageNum" select="$i"/>
0196               </xsl:call-template>
0197             </xsl:attribute>
0198             <xsl:value-of select="number($i)+1"/>
0199           </a>
0200         </li>
0201       </xsl:otherwise>
0202     </xsl:choose>
0203 
0204     <xsl:call-template name="pagination.for.loop">
0205       <xsl:with-param name="i" select="$i + 1"/>
0206       <xsl:with-param name="count" select="$count"/>
0207       <xsl:with-param name="currentPage" select="$currentPage"/>
0208     </xsl:call-template>
0209   </xsl:if>
0210 </xsl:template>
0211 
0212 <!-- Template which prints out the html url for a particular page -->
0213 <xsl:template name="pageLink">
0214   <xsl:param name="collectionFilename"/>
0215   <xsl:param name="pageNum"/>
0216   <xsl:choose>
0217     <xsl:when test="($numCollections &gt; 1) and ($pageNum = 0)">
0218       <xsl:value-of select="$collectionFilename"/>.html
0219     </xsl:when>
0220     <xsl:when test="($numCollections &lt;= 1) and ($pageNum = 0)">
0221       index.html
0222     </xsl:when>
0223     <xsl:otherwise>
0224       <xsl:value-of select="$collectionFilename"/>_<xsl:value-of select="number($pageNum)" />.html
0225     </xsl:otherwise>
0226   </xsl:choose>
0227 </xsl:template>
0228 <!-- ##################### END PAGINATION LINK GENERATATION ############### -->
0229 
0230 
0231 
0232 <!-- ##################### CUSTOM CSS STYLESHEET GENERATATION ############# -->
0233 <xsl:template name="customStyle">
0234   <style type='text/css'>
0235     body {
0236       color: <xsl:value-of select="$fgColor"/>;
0237       background-color: <xsl:value-of select="$bgColor"/>;
0238     }
0239     
0240     a {
0241         color: <xsl:value-of select="$linkColor"/>;
0242     }
0243     
0244     a:hover {
0245         color: <xsl:value-of select="$hoverLinkColor"/>;
0246     }
0247     
0248     a:visited {
0249         color: <xsl:value-of select="$visitedLinkColor"/>;
0250     }
0251     
0252     h1 {
0253         color: <xsl:value-of select="$fgColor"/>;
0254         background-color: <xsl:value-of select="$frameColor"/>;
0255         border-bottom: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0256     }
0257     
0258     .footer {
0259         color: <xsl:value-of select="$fgColor"/>;
0260         background-color: <xsl:value-of select="$frameColor"/>;
0261         border-bottom: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0262         border-top: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0263     }
0264     
0265     #content li img {
0266         border: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0267     }
0268     
0269     #content li a {
0270         background-color: <xsl:value-of select="$frameColor"/>;
0271         border: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0272     }
0273     
0274     #content li a:hover {
0275         border: 1px solid <xsl:value-of select="$selectedFrameBorderColor"/>;
0276         background-color: <xsl:value-of select="$selectedFrameColor"/>;
0277     }
0278     
0279     /* PAGINATION */
0280     .pagination li a,
0281     .pagination .disabled {
0282         background-color: <xsl:value-of select="$frameColor"/>;
0283         border: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0284     }
0285     
0286     .pagination .current,
0287     .pagination li a:hover {
0288         border: 1px solid <xsl:value-of select="$selectedFrameBorderColor"/> !important;
0289         background-color: <xsl:value-of select="$selectedFrameColor"/> !important;
0290     }
0291     
0292     /* Image page */
0293     #image {
0294         border: 1px solid <xsl:value-of select="$frameColor"/>;
0295         background-color: <xsl:value-of select="$frameBorderColor"/>;
0296     }
0297     
0298     #image img {
0299         border: 1px solid <xsl:value-of select="$frameBorderColor"/>;
0300     }
0301   </style>
0302 </xsl:template>
0303 <!-- ##################### END CUSTOM CSS STYLESHEET GENERATATION ######### -->
0304     
0305 
0306 <!-- ##################### LYTEBOX CONFIG GENERATION ###################### -->
0307 <!--
0308   Adds some javascript that sets the lytebox parameters and initializes 
0309   lytebox when the page loads.
0310 -->
0311 <xsl:template name="lyteboxConfig">
0312 <script type="text/javascript">
0313   function initLytebox() { myLytebox = new LyteBox('<xsl:value-of select="$theme"/>',
0314                                                    <xsl:value-of select="$outerBorder"/>,
0315                                                    <xsl:value-of select="$resizeSpeed"/>,
0316                                                    <xsl:value-of select="$maxOpacity"/>,
0317                                                    <xsl:value-of select="$navType"/>,
0318                                                    <xsl:value-of select="$autoResize"/>,
0319                                                    <xsl:value-of select="$doAnimations"/>,
0320                                                    <xsl:value-of select="$slideInterval"/>,
0321                                                    <xsl:value-of select="$showNavigation"/>); }
0322   if (window.addEventListener) {
0323       window.addEventListener("load",initLytebox,false);
0324   } else if (window.attachEvent) {
0325       window.attachEvent("onload",initLytebox);
0326   } else {
0327       window.onload = function() {initLytebox();}
0328   }
0329 </script>
0330 </xsl:template>
0331 <!-- ##################### END LYTEBOX CONFIG GENERATION ################## -->
0332         
0333 
0334 <!-- ##################### COLLECTION PAGE GENERATION ##################### -->
0335 <!--
0336   The collectionPage is a page of thumbnails for a collection.
0337   If there are too many thumbnails to fit on one page then the content is split
0338   up into multiple pages.
0339 -->
0340 <xsl:template name="collectionPage">
0341 <xsl:param name="pageNum"/>
0342 <xsl:param name="pageFilename"/>
0343 <!-- <xsl:variable name="pageFilename" select="concat(fileName, '_', $pageNum, '.html')"/> -->
0344 <html>
0345   <head>
0346     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
0347     <meta name="KEYWORDS" content="photography,software,photos,digital darkroom,gallery,image,photographer"/>
0348     <meta name="generator" content="DigiKam"/>
0349     <title><xsl:value-of select="name"/></title>
0350     <xsl:if test="$useLyteBox = 'true'">
0351       <script type="text/javascript" src="elegant/resources/js/lytebox.js"/>
0352       <xsl:call-template name="lyteboxConfig"/>
0353       <link rel="stylesheet" href="elegant/resources/css/lytebox.css" type="text/css" media="screen"/>
0354     </xsl:if>
0355     <link rel="stylesheet" href="elegant/resources/css/master.css" type="text/css" media="screen"/>
0356     <xsl:choose>
0357       <xsl:when test="$style = 'custom'">
0358         <xsl:call-template name="customStyle"/>
0359       </xsl:when>
0360       <xsl:otherwise>
0361         <link rel="stylesheet" type="text/css" media="screen">
0362           <xsl:attribute name="href">elegant/resources/css/<xsl:value-of select="$style"/></xsl:attribute>
0363         </link>
0364       </xsl:otherwise>
0365     </xsl:choose>
0366   </head>
0367   <body>
0368     <h1>
0369       <xsl:if test="$numCollections &gt; 1">
0370         <a href="index.html"><xsl:value-of select="$i18nCollectionList"/></a> »
0371       </xsl:if>
0372       <xsl:value-of select="name"/>
0373     </h1>
0374     
0375     <xsl:variable name="numPages" select="ceiling(count(image) div $pageSize)"/>
0376     <xsl:variable name="folder" select='fileName'/>
0377     <xsl:variable name="pageName" select="name"/>
0378     
0379     <xsl:if test="($paginationLocation = 'top') or ($paginationLocation = 'both')">
0380       <xsl:call-template name="pagination">
0381         <xsl:with-param name="numPages" select="$numPages"/>
0382         <xsl:with-param name="pageNum" select="$pageNum"/>
0383       </xsl:call-template>
0384     </xsl:if>
0385     
0386     <div id="content">
0387     
0388       <!-- Add links to all images before the current page. -->
0389       <xsl:if test="$useLyteBox = 'true'">
0390         <xsl:for-each select="image[(position() &lt; ($pageNum * $pageSize) + 1)]">
0391           <xsl:variable name="imageCaption">
0392             <xsl:value-of select="description" />
0393             <xsl:if test="original/@fileName != ''">&lt;p class=&quot;caption&quot;&gt;&lt;a href=&quot;<xsl:value-of select='$folder'/>/<xsl:value-of select="original/@fileName"/>&quot;&gt;<xsl:value-of select="$i18nOriginalImage"/>&lt;/a&gt; (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)&lt;/p&gt;</xsl:if>
0394           </xsl:variable>
0395           <a href="{$folder}/{full/@fileName}" rel="lyteshow[{$pageName}]" title="{$imageCaption}"></a>
0396         </xsl:for-each>
0397       </xsl:if>
0398     
0399       <ul>
0400         
0401         <!-- Add thumbnails and links to all images for the current page. -->
0402         <xsl:for-each select="image[(position() &gt;= ($pageNum * $pageSize) + 1) and (position() &lt;= $pageSize + ($pageSize * $pageNum))]">
0403           
0404           <xsl:choose>
0405             <xsl:when test="$useLyteBox = 'true'">
0406             
0407               <xsl:variable name="imageCaption">
0408                 <xsl:value-of select="description"/>
0409                 <xsl:if test="original/@fileName != ''">&lt;p class=&quot;caption&quot;&gt;&lt;a href=&quot;<xsl:value-of select='$folder'/>/<xsl:value-of select="original/@fileName"/>&quot;&gt;<xsl:value-of select="$i18nOriginalImage"/>&lt;/a&gt; (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)&lt;/p&gt;</xsl:if>
0410               </xsl:variable>
0411               <li>
0412                 <a href="{$folder}/{full/@fileName}" rel="lyteshow[{$pageName}]" title="{$imageCaption}">
0413                   <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}" alt="{title}"/>
0414                 </a>
0415               </li>
0416   
0417             </xsl:when>
0418             <xsl:otherwise>
0419               <li>
0420                 <a href="{$folder}/{full/@fileName}.html">
0421                   <img src="{$folder}/{thumbnail/@fileName}" width="{thumbnail/@width}" height="{thumbnail/@height}" />
0422                 </a>
0423               </li>
0424               <exsl:document href='{$folder}/{full/@fileName}.html'>
0425                 <xsl:call-template name="imagePage">
0426                   <xsl:with-param name="indexPage"><xsl:value-of select="$pageFilename"/></xsl:with-param>
0427                 </xsl:call-template>
0428               </exsl:document>
0429             </xsl:otherwise>
0430           </xsl:choose>
0431             
0432         </xsl:for-each>
0433       </ul>
0434       
0435       <!-- Add links to all images after the current page. -->
0436       <xsl:if test="$useLyteBox = 'true'">
0437         <xsl:for-each select="image[(position() &gt; $pageSize + ($pageSize * $pageNum))]">
0438           <xsl:variable name="imageCaption">
0439             <xsl:value-of select="description" />
0440             <xsl:if test="original/@fileName != ''">&lt;p class=&quot;caption&quot;&gt;&lt;a href=&quot;<xsl:value-of select='$folder'/>/<xsl:value-of select="original/@fileName"/>&quot;&gt;<xsl:value-of select="$i18nOriginalImage"/>&lt;/a&gt; (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)&lt;/p&gt;</xsl:if>
0441           </xsl:variable>
0442           <a href="{$folder}/{full/@fileName}" rel="lyteshow[{$pageName}]" title="{$imageCaption}"></a>
0443         </xsl:for-each>
0444       </xsl:if>
0445       
0446     </div> <!-- /content -->
0447     
0448     <xsl:if test="($paginationLocation = 'bottom') or ($paginationLocation = 'both')">
0449       <xsl:call-template name="pagination">
0450         <xsl:with-param name="numPages" select="$numPages"/>
0451         <xsl:with-param name="pageNum" select="$pageNum"/>
0452       </xsl:call-template>
0453     </xsl:if>
0454     
0455     <xsl:if test="$author != ''">
0456       <div class="footer">
0457         All Images Copyright &#169; <xsl:value-of select="$author"/>
0458       </div>
0459     </xsl:if>
0460   </body>
0461 </html>
0462 <xsl:if test="$pageNum = 0">
0463   <!-- Generate all subsequent collection pages. -->
0464   <xsl:call-template name="collectionPages"/>
0465 </xsl:if>
0466 </xsl:template>
0467 <!-- ##################### END COLLECTION PAGE GENERATION ################# -->
0468 
0469 
0470 <!-- ##################### IMAGE PAGE GENERATION ########################## -->
0471 <!--
0472   If lytebox is disabled then a webpage is generated to display the large
0473   version of each image.
0474 -->
0475 <xsl:template name="imagePage">
0476 <xsl:param name="indexPage"/>
0477   <html>
0478   <head>
0479     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
0480     <meta name="KEYWORDS" content="photography,software,photos,digital darkroom,gallery,image,photographer"/>
0481     <meta name="generator" content="DigiKam"/>
0482     <title><xsl:value-of select="title"/></title>
0483     <link rel="stylesheet" href="../elegant/resources/css/master.css" type="text/css" media="screen"/>
0484     <xsl:choose>
0485       <xsl:when test="$style = 'custom'">
0486         <xsl:call-template name="customStyle"/>
0487       </xsl:when>
0488       <xsl:otherwise>
0489         <link rel="stylesheet" type="text/css" media="screen">
0490           <xsl:attribute name="href">../elegant/resources/css/<xsl:value-of select="$style"/></xsl:attribute>
0491         </link>
0492       </xsl:otherwise>
0493     </xsl:choose>
0494   </head>
0495   <body>
0496     <h1>
0497       <xsl:value-of select="title"/> (<xsl:value-of select="position()"/>/<xsl:value-of select="last()"/>)
0498     </h1>
0499   
0500     <xsl:if test="($paginationLocation = 'top') or ($paginationLocation = 'both')">
0501       <xsl:call-template name="image.pagination">
0502         <xsl:with-param name="indexPage" select="$indexPage"/>
0503       </xsl:call-template>
0504     </xsl:if>
0505 
0506     <div id="content">
0507       <div id="image">
0508         <a href="../{$indexPage}">
0509           <img src="{full/@fileName}" width="{full/@width}" height="{full/@height}" />
0510         </a>
0511         <p style="width: {full/@width};">
0512         <xsl:value-of select="description"/>
0513         </p>
0514         <xsl:if test="original/@fileName != ''">
0515           <p style="width: {full/@width};">
0516           <a href="{original/@fileName}"><xsl:value-of select="$i18nOriginalImage"/></a>
0517           (<xsl:value-of select="original/@width"/>x<xsl:value-of select="original/@height"/>)
0518           </p>
0519         </xsl:if>
0520       </div>
0521     </div>
0522   
0523     <xsl:if test="($paginationLocation = 'bottom') or ($paginationLocation = 'both')">
0524       <xsl:call-template name="image.pagination">
0525         <xsl:with-param name="indexPage" select="$indexPage"/>
0526       </xsl:call-template>
0527     </xsl:if>
0528 
0529     <xsl:if test="$author != ''">
0530       <div class="footer">
0531         All Images Copyright &#169; <xsl:value-of select="$author"/>
0532       </div>
0533     </xsl:if>
0534   
0535   </body>
0536   </html>
0537 </xsl:template>
0538 
0539 
0540 <!-- ##################### COLLECTION LIST PAGE GENERATION ################ -->
0541 <!--
0542   If more than one collection was selected for export then a collectionListPage
0543   is generated which provides a list of all the individual collections.
0544 -->
0545 <xsl:template name="collectionListPage">
0546 <html>
0547   <head>
0548     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
0549     <meta name="KEYWORDS" content="photography,software,photos,digital darkroom,gallery,image,photographer"/>
0550     <meta name="generator" content="DigiKam"/>
0551     <title><xsl:value-of select="$i18nCollectionList"/></title>
0552     <link rel="stylesheet" href="elegant/resources/css/master.css" type="text/css" media="screen"/>
0553     <xsl:choose>
0554       <xsl:when test="$style = 'custom'">
0555         <xsl:call-template name="customStyle"/>
0556       </xsl:when>
0557       <xsl:otherwise>
0558         <link rel="stylesheet" type="text/css" media="screen">
0559           <xsl:attribute name="href">elegant/resources/css/<xsl:value-of select="$style"/></xsl:attribute>
0560         </link>
0561       </xsl:otherwise>
0562     </xsl:choose>
0563   </head>
0564   <body>
0565     <h1>
0566       <xsl:value-of select="$i18nCollectionList"/>
0567     </h1>
0568     <div id="content">
0569       <ul>
0570         <xsl:for-each select="collections/collection">
0571           <xsl:variable name="altName" select="name"/>
0572           <li>
0573             <a href="{fileName}.html">
0574               <!-- Use first image as collection image -->
0575               <img src="{fileName}/{image[1]/thumbnail/@fileName}" width="{image[1]/thumbnail/@width}" height="{image[1]/thumbnail/@height}" alt="{$altName}"/><br /><xsl:value-of select="name"/>
0576             </a>
0577           </li>
0578           <exsl:document href="{fileName}.html"
0579             method="xml"
0580             indent="yes" 
0581             encoding="iso-8859-1" 
0582             doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
0583             doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN">
0584             <xsl:call-template name="collectionPage">
0585               <xsl:with-param name="pageFilename"><xsl:value-of select="fileName"/>.html</xsl:with-param>
0586               <xsl:with-param name="pageNum" select="0"/>
0587             </xsl:call-template>
0588           </exsl:document>
0589         </xsl:for-each>
0590       </ul>
0591     </div>
0592     <!-- /content -->
0593     <xsl:if test="$author != ''">
0594       <div class="footer">
0595         All Images Copyright &#169; <xsl:value-of select="$author"/>
0596       </div>
0597     </xsl:if>
0598   </body>
0599 </html>
0600 </xsl:template>
0601 <!-- ##################### END COLLECTION LIST PAGE GENERATION ############ -->
0602 
0603 
0604 <!-- ##################### STARTING POINT ################################# -->
0605 <!--
0606   Determines if we need to create a collectionListPage or just one
0607   collectionStartPage.
0608 -->
0609 <xsl:template match="/">
0610   <xsl:choose>
0611     <xsl:when test="$numCollections &gt; 1">
0612       <xsl:call-template name="collectionListPage"/>
0613     </xsl:when>
0614     <xsl:otherwise>
0615       <xsl:for-each select="collections/collection">
0616         <xsl:call-template name="collectionPage">
0617           <xsl:with-param name="pageFilename">index.html</xsl:with-param>
0618           <xsl:with-param name="pageNum" select="0"/>
0619         </xsl:call-template>
0620       </xsl:for-each>
0621     </xsl:otherwise>
0622   </xsl:choose>
0623 </xsl:template>
0624 <!-- ##################### END STARTING POINT ############################# -->
0625 
0626 </xsl:transform>