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