1<?xml version="1.0" encoding="UTF-8"?> 2<!--*********************************************************** 3 * 4 * Licensed to the Apache Software Foundation (ASF) under one 5 * or more contributor license agreements. See the NOTICE file 6 * distributed with this work for additional information 7 * regarding copyright ownership. The ASF licenses this file 8 * to you under the Apache License, Version 2.0 (the 9 * "License"); you may not use this file except in compliance 10 * with the License. You may obtain a copy of the License at 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 14 * Unless required by applicable law or agreed to in writing, 15 * software distributed under the License is distributed on an 16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 * KIND, either express or implied. See the License for the 18 * specific language governing permissions and limitations 19 * under the License. 20 * 21 ***********************************************************--> 22 23 24 25<xsl:stylesheet version="1.0" 26 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 27 xmlns="http://www.w3.org/1999/xhtml"> 28 29 <xsl:output method = "html" 30 media-type = "text/html" 31 indent = "yes" 32 doctype-public = "-//W3C//DTD HTML 4.0 Transitional//EN" 33 omit-xml-declaration = "yes" 34 standalone = "yes" /> 35 36 <xsl:include href="../layout.xsl"/> 37 38 39 <!-- ============================= 40 ROOT 41 ================================== --> 42 43 44 <xsl:template match="/"> 45 <html> 46 <xsl:call-template name="head"/> 47 <xsl:call-template name="body"/> 48 </html> 49 </xsl:template> 50 51 52 <!-- ============================= 53 HTML BODY 54 ================================== --> 55 56 <xsl:template name="body"> 57 <body> 58 <xsl:call-template name="title"/> 59 <xsl:call-template name="toc"/> 60 </body> 61 </xsl:template> 62 63 64 <xsl:template name="toc"> 65 <!-- 66 @ pre toc html here 67 --> 68 69 <!-- use this to group documents, it 70 is for example usefull when generating tables --> 71 72 <xsl:variable name="group" select="3"/> 73 74 <xsl:for-each select="/session/content/document[ ( ( position() - 1 ) mod $group ) = 0 ]"> 75 76 <!-- 77 @ pre group html here 78 --> 79 80 <xsl:call-template name="document-group"> 81 <xsl:with-param name="group" select="$group"/> 82 </xsl:call-template> 83 84 <!-- 85 @ post group html here 86 --> 87 88 </xsl:for-each> 89 90 91 <!-- use this alternative if you do not need to use groups 92 (uncomment to use - and do not forget to comment the group 93 option above...)--> 94 95 <!-- 96 <xsl:apply-templates select="/session/content/document"/> 97 --> 98 99 <!-- 100 @ post toc html here 101 --> 102 103 </xsl:template> 104 105 <!-- also when using groups, in the end it comes 106 to this template, which is called for each document --> 107 <xsl:template match="document"> 108 <xsl:apply-templates select="@title"/> 109 <xsl:apply-templates select="@description"/> 110 <xsl:apply-templates select="@author"/> 111 <xsl:apply-templates select="@create-date"/> 112 <xsl:apply-templates select="@update-date"/> 113 <xsl:apply-templates select="@filename"/> 114 <xsl:apply-templates select="@format"/> 115 <xsl:apply-templates select="@format-icon"/> 116 <xsl:apply-templates select="@format-icon"/> 117 </xsl:template> 118 119 120 121 <xsl:template name="document-group"> 122 <xsl:param name="group"/> 123 124 <!-- @ pre group code here --> 125 126 <!-- - - --> 127 128 <xsl:variable name="count" select="(position() - 1) * $group + 1"/> 129 130 <xsl:for-each select="/session/content/document[$count <= position() and position() < ($count + $group)]"> 131 132 <xsl:apply-templates select="."/> 133 134 </xsl:for-each> 135 136 <!-- @ post group code here --> 137 138 <!-- - - --> 139 140 </xsl:template> 141 142 143 <xsl:template name="title"> 144 <!-- 145 @ Pre title html code here 146 --> 147 148 <xsl:value-of select="/session/general-info/@title"/> 149 150 <!-- 151 @ Post title html code here 152 --> 153 </xsl:template> 154 155 <!-- ============================= 156 Document properties 157 158 This section contains templates which 159 give the document properties... 160 161 ================================== --> 162 163 <!-- this tempaltes gives the 164 relative href of the document. To use 165 with the <a href="..."> attribute--> 166 167 168 <xsl:template match="document" mode="href"> 169 <xsl:value-of select="concat(../@directory,'/')"/> 170 <xsl:if test="@dir"> 171 <xsl:value-of select="concat(@dir,'/')"/> 172 </xsl:if> 173 <xsl:value-of select="@fn"/> 174 </xsl:template> 175 176 177 <xsl:template match="document/@title"> 178 <span class="doctitle"> 179 <a> 180 <xsl:attribute name="href"> 181 <xsl:apply-templates select=".." mode="href"/> 182 </xsl:attribute> 183 184 <xsl:value-of select="."/> 185 </a> 186 </span> 187 <br/> 188 </xsl:template> 189 190 191 <xsl:template match="document/@description"> 192 <span class="docdescription"> 193 <xsl:value-of select="."/> 194 </span> 195 <br/> 196 </xsl:template> 197 198 199 <xsl:template match="document/@author"> 200 <span class="docauthor"> 201 <xsl:value-of select="."/> 202 </span> 203 <br/> 204 </xsl:template> 205 206 207 <xsl:template match="document/@create-date"> 208 <span class="doccreationdate"> 209 <xsl:value-of select="."/> 210 </span> 211 <br/> 212 </xsl:template> 213 214 215 <xsl:template match="document/@update-date"> 216 <span class="doclastchangeddate"> 217 <xsl:value-of select="."/> 218 </span> 219 <br/> 220 </xsl:template> 221 222 223 <xsl:template match="document/@filename"> 224 <span class="docfilename"> 225 <xsl:value-of select="."/> 226 </span> 227 <br/> 228 </xsl:template> 229 230 231 <xsl:template match="document/@format"> 232 <span class="docfileformatinfo"> 233 <xsl:value-of select="."/> 234 </span> 235 <br/> 236 </xsl:template> 237 238 239 <xsl:template match="document/@pages"> 240 <span class="docnumberofpages"> 241 <xsl:value-of select="."/> 242 </span> 243 <br/> 244 </xsl:template> 245 246 247 <xsl:template match="document/@size"> 248 <span class="docsizeinkb"> 249 <xsl:value-of select="."/> 250 </span> 251 <br/> 252 </xsl:template> 253 254 <xsl:template match="document/@icon"> 255 <img src="images/{.}"/> 256 <br/> 257 </xsl:template> 258 259 260 <!-- ============================= 261 HTML HEAD 262 263 this section should not be changed 264 ================================== --> 265 266 <xsl:template name="head"> 267 <head> 268 <title> 269 <xsl:value-of select="/session/general-info/@title"/> 270 </title> 271 <!-- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> --> 272 <meta HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=UTF-8"/> 273 <meta name="description" content="{/session/general-info/@description}"/> 274 <meta name="keywords" content="{/session/general-info/@keywords}"/> 275 <meta name="author" content="{/session/general-info/@author}"/> 276 <meta name="email" content="{/session/general-info/@email}"/> 277 <meta name="copyright" content="{/session/general-info/@copyright}"/> 278 <!-- create date? 279 update date? 280 fav icon? 281 --> 282 <link href="style.css" rel="stylesheet" type="text/css"/> 283 284 </head> 285 </xsl:template> 286 287</xsl:stylesheet> 288