1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?> 2*8eb6fccdSAndrew Rist<!--*********************************************************** 3*8eb6fccdSAndrew Rist * 4*8eb6fccdSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 5*8eb6fccdSAndrew Rist * or more contributor license agreements. See the NOTICE file 6*8eb6fccdSAndrew Rist * distributed with this work for additional information 7*8eb6fccdSAndrew Rist * regarding copyright ownership. The ASF licenses this file 8*8eb6fccdSAndrew Rist * to you under the Apache License, Version 2.0 (the 9*8eb6fccdSAndrew Rist * "License"); you may not use this file except in compliance 10*8eb6fccdSAndrew Rist * with the License. You may obtain a copy of the License at 11*8eb6fccdSAndrew Rist * 12*8eb6fccdSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 13*8eb6fccdSAndrew Rist * 14*8eb6fccdSAndrew Rist * Unless required by applicable law or agreed to in writing, 15*8eb6fccdSAndrew Rist * software distributed under the License is distributed on an 16*8eb6fccdSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17*8eb6fccdSAndrew Rist * KIND, either express or implied. See the License for the 18*8eb6fccdSAndrew Rist * specific language governing permissions and limitations 19*8eb6fccdSAndrew Rist * under the License. 20*8eb6fccdSAndrew Rist * 21*8eb6fccdSAndrew Rist ***********************************************************--> 22cdf0e10cSrcweir<!-- ================================================= 23cdf0e10cSrcweir 24cdf0e10cSrcweirThis template is a skeleton for single level TOC pages 25cdf0e10cSrcweirDo not overwrite this ! copy it and complete the missing 26cdf0e10cSrcweircode. 27cdf0e10cSrcweir 28cdf0e10cSrcweirI use the @ character whereever there is a missing code, so 29cdf0e10cSrcweiryou can use a simple find to navigate and find the 30cdf0e10cSrcweirplaces... 31cdf0e10cSrcweir 32cdf0e10cSrcweir====================================================== --> 33cdf0e10cSrcweir<!DOCTYPE xsl:stylesheet [ 34cdf0e10cSrcweir 35cdf0e10cSrcweir<!ENTITY x1 "0"> 36cdf0e10cSrcweir<!ENTITY x2 "250"> 37cdf0e10cSrcweir<!ENTITY x3 "500"> 38cdf0e10cSrcweir 39cdf0e10cSrcweir<!ENTITY y1 "0"> 40cdf0e10cSrcweir<!ENTITY y2 "150"> 41cdf0e10cSrcweir<!ENTITY y3 "0"> 42cdf0e10cSrcweir 43cdf0e10cSrcweir 44cdf0e10cSrcweir]> 45cdf0e10cSrcweir<xsl:stylesheet version="1.0" 46cdf0e10cSrcweir xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 47cdf0e10cSrcweir xmlns="http://www.w3.org/1999/xhtml"> 48cdf0e10cSrcweir 49cdf0e10cSrcweir <xsl:output method = "html" 50cdf0e10cSrcweir media-type = "text/html" 51cdf0e10cSrcweir indent = "yes" 52cdf0e10cSrcweir doctype-public = "-//W3C//DTD HTML 4.0 Transitional//EN" 53cdf0e10cSrcweir omit-xml-declaration = "yes" 54cdf0e10cSrcweir standalone = "yes" /> 55cdf0e10cSrcweir 56cdf0e10cSrcweir <xsl:include href="../layout.xsl"/> 57cdf0e10cSrcweir 58cdf0e10cSrcweir <!-- ============================= 59cdf0e10cSrcweir HTML BODY 60cdf0e10cSrcweir ================================== --> 61cdf0e10cSrcweir 62cdf0e10cSrcweir <xsl:template name="body"> 63cdf0e10cSrcweir <body> 64cdf0e10cSrcweir <xsl:call-template name="title"/> 65cdf0e10cSrcweir <xsl:call-template name="toc"/> 66cdf0e10cSrcweir </body> 67cdf0e10cSrcweir </xsl:template> 68cdf0e10cSrcweir 69cdf0e10cSrcweir 70cdf0e10cSrcweir <xsl:template name="toc"> 71cdf0e10cSrcweir <!-- 72cdf0e10cSrcweir @ pre toc html here 73cdf0e10cSrcweir --> 74cdf0e10cSrcweir 75cdf0e10cSrcweir <xsl:apply-templates select="/session/content/document"/> 76cdf0e10cSrcweir 77cdf0e10cSrcweir <!-- 78cdf0e10cSrcweir @ post toc html here 79cdf0e10cSrcweir --> 80cdf0e10cSrcweir 81cdf0e10cSrcweir </xsl:template> 82cdf0e10cSrcweir 83cdf0e10cSrcweir 84cdf0e10cSrcweir 85cdf0e10cSrcweir <!-- also when using groups, in the end it comes 86cdf0e10cSrcweir to this template, which is called for each document --> 87cdf0e10cSrcweir <xsl:template match="document"> 88cdf0e10cSrcweir 89cdf0e10cSrcweir <xsl:variable name="i" select="position() - 1"/> 90cdf0e10cSrcweir 91cdf0e10cSrcweir <xsl:variable name="x1"> 92cdf0e10cSrcweir <xsl:call-template name="x"/> 93cdf0e10cSrcweir </xsl:variable> 94cdf0e10cSrcweir 95cdf0e10cSrcweir <xsl:variable name="x" select="number($x1) + 50 "/> 96cdf0e10cSrcweir 97cdf0e10cSrcweir <xsl:variable name="y1"> 98cdf0e10cSrcweir <xsl:call-template name="y"/> 99cdf0e10cSrcweir </xsl:variable> 100cdf0e10cSrcweir 101cdf0e10cSrcweir <xsl:variable name="y" select="(floor($i div 3)) * 300 + number($y1) + 80 "/> 102cdf0e10cSrcweir 103cdf0e10cSrcweir <div style="position:absolute; padding:15px; left:{$x}px; top:{$y}px; width:170px; height:220px; z-index:1" class="tcolor"> 104cdf0e10cSrcweir <div align="center"> 105cdf0e10cSrcweir 106cdf0e10cSrcweir <xsl:apply-templates select="@icon"/> 107cdf0e10cSrcweir <p> 108cdf0e10cSrcweir <xsl:apply-templates select="@title"/> 109cdf0e10cSrcweir <xsl:apply-templates select="@description"/> 110cdf0e10cSrcweir <xsl:apply-templates select="@author"/> 111cdf0e10cSrcweir <xsl:apply-templates select="@create-date"/> 112cdf0e10cSrcweir <xsl:apply-templates select="@update-date"/> 113cdf0e10cSrcweir <xsl:apply-templates select="@filename"/> 114cdf0e10cSrcweir <xsl:apply-templates select="@format"/> 115cdf0e10cSrcweir <xsl:apply-templates select="@pages"/> 116cdf0e10cSrcweir <xsl:apply-templates select="@size"/> 117cdf0e10cSrcweir </p> 118cdf0e10cSrcweir </div> 119cdf0e10cSrcweir </div> 120cdf0e10cSrcweir </xsl:template> 121cdf0e10cSrcweir 122cdf0e10cSrcweir <xsl:template name="x"> 123cdf0e10cSrcweir <xsl:variable name="i" select="position()"/> 124cdf0e10cSrcweir <xsl:choose> 125cdf0e10cSrcweir <xsl:when test="$i = 2"> 126cdf0e10cSrcweir &x2; 127cdf0e10cSrcweir </xsl:when> 128cdf0e10cSrcweir <xsl:when test="$i = 3"> 129cdf0e10cSrcweir &x3; 130cdf0e10cSrcweir </xsl:when> 131cdf0e10cSrcweir <xsl:otherwise> 132cdf0e10cSrcweir <xsl:choose> 133cdf0e10cSrcweir <xsl:when test="($i mod 3) = 1"> 134cdf0e10cSrcweir &x1; 135cdf0e10cSrcweir </xsl:when> 136cdf0e10cSrcweir <xsl:when test="($i mod 3) = 2"> 137cdf0e10cSrcweir &x3; 138cdf0e10cSrcweir </xsl:when> 139cdf0e10cSrcweir <xsl:when test="($i mod 3) = 0"> 140cdf0e10cSrcweir &x2; 141cdf0e10cSrcweir </xsl:when> 142cdf0e10cSrcweir </xsl:choose> 143cdf0e10cSrcweir </xsl:otherwise> 144cdf0e10cSrcweir </xsl:choose> 145cdf0e10cSrcweir </xsl:template> 146cdf0e10cSrcweir 147cdf0e10cSrcweir <xsl:template name="y"> 148cdf0e10cSrcweir <xsl:variable name="i" select="position()"/> 149cdf0e10cSrcweir <xsl:choose> 150cdf0e10cSrcweir <xsl:when test="$i = 2"> 151cdf0e10cSrcweir &y2; 152cdf0e10cSrcweir </xsl:when> 153cdf0e10cSrcweir <xsl:when test="$i = 3"> 154cdf0e10cSrcweir &y3; 155cdf0e10cSrcweir </xsl:when> 156cdf0e10cSrcweir <xsl:otherwise> 157cdf0e10cSrcweir <xsl:choose> 158cdf0e10cSrcweir <xsl:when test="($i mod 3) = 1"> 159cdf0e10cSrcweir &y1; 160cdf0e10cSrcweir </xsl:when> 161cdf0e10cSrcweir <xsl:when test="($i mod 3) = 2"> 162cdf0e10cSrcweir &y3; 163cdf0e10cSrcweir </xsl:when> 164cdf0e10cSrcweir <xsl:when test="($i mod 3) = 0"> 165cdf0e10cSrcweir &y2; 166cdf0e10cSrcweir </xsl:when> 167cdf0e10cSrcweir </xsl:choose> 168cdf0e10cSrcweir </xsl:otherwise> 169cdf0e10cSrcweir </xsl:choose> 170cdf0e10cSrcweir </xsl:template> 171cdf0e10cSrcweir 172cdf0e10cSrcweir 173cdf0e10cSrcweir <xsl:template name="document-group"> 174cdf0e10cSrcweir <xsl:param name="group"/> 175cdf0e10cSrcweir 176cdf0e10cSrcweir <!-- @ pre group code here --> 177cdf0e10cSrcweir 178cdf0e10cSrcweir <!-- - - --> 179cdf0e10cSrcweir 180cdf0e10cSrcweir <xsl:variable name="count" select="(position() - 1) * $group + 1"/> 181cdf0e10cSrcweir 182cdf0e10cSrcweir <xsl:for-each select="/session/content/document[$count <= position() and position() < ($count + $group)]"> 183cdf0e10cSrcweir 184cdf0e10cSrcweir <xsl:apply-templates select="."/> 185cdf0e10cSrcweir 186cdf0e10cSrcweir </xsl:for-each> 187cdf0e10cSrcweir 188cdf0e10cSrcweir <!-- @ post group code here --> 189cdf0e10cSrcweir 190cdf0e10cSrcweir <!-- - - --> 191cdf0e10cSrcweir 192cdf0e10cSrcweir </xsl:template> 193cdf0e10cSrcweir 194cdf0e10cSrcweir 195cdf0e10cSrcweir <xsl:template name="title"> 196cdf0e10cSrcweir <!-- 197cdf0e10cSrcweir @ Pre title html code here 198cdf0e10cSrcweir --> 199cdf0e10cSrcweir <div style="position:absolute; left:280px; top:8px; width:220px; z-index:2; padding:10px" class="ccolor"> 200cdf0e10cSrcweir <div align="center" class="toctitle"> 201cdf0e10cSrcweir <xsl:value-of select="/session/general-info/@title"/> 202cdf0e10cSrcweir   203cdf0e10cSrcweir <!-- 204cdf0e10cSrcweir @ Post title html code here 205cdf0e10cSrcweir --> 206cdf0e10cSrcweir </div> 207cdf0e10cSrcweir </div> 208cdf0e10cSrcweir </xsl:template> 209cdf0e10cSrcweir 210cdf0e10cSrcweir</xsl:stylesheet> 211