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
24This template is a skeleton for single level TOC pages
25Do not overwrite this ! copy it and complete the missing
26code.
27
28I use the @ character wherever there is a missing code, so
29you can use a simple find to navigate and find the
30places...
31
32====================================================== -->
33<!DOCTYPE xsl:stylesheet [
34
35<!ENTITY x1 "0">
36<!ENTITY x2 "250">
37<!ENTITY x3 "500">
38
39<!ENTITY y1 "0">
40<!ENTITY y2 "150">
41<!ENTITY y3 "0">
42
43
44]>
45<xsl:stylesheet version="1.0"
46   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
47	xmlns="http://www.w3.org/1999/xhtml">
48
49	<xsl:output method               = "html"
50                media-type           = "text/html"
51                indent               = "yes"
52                doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
53                omit-xml-declaration = "yes"
54                standalone           = "yes" />
55
56	<xsl:include href="../layout.xsl"/>
57
58	 <!-- =============================
59	               HTML BODY
60	 ================================== -->
61
62	 <xsl:template name="body">
63	 	<body>
64	   <xsl:call-template name="title"/>
65	 	<xsl:call-template name="toc"/>
66	 	</body>
67	 </xsl:template>
68
69
70	 <xsl:template name="toc">
71		<!--
72		     @ pre toc html here
73		-->
74
75		<xsl:apply-templates select="/session/content/document"/>
76
77		<!--
78		     @ post toc html here
79		-->
80
81	 </xsl:template>
82
83
84
85	<!-- also when using groups, in the end it comes
86	to this template, which is called for each document -->
87	<xsl:template match="document">
88
89	  <xsl:variable name="i"	select="position() - 1"/>
90
91	  <xsl:variable name="x1">
92	    <xsl:call-template name="x"/>
93	  </xsl:variable>
94
95		<xsl:variable name="x" select="number($x1) + 50 "/>
96
97	  <xsl:variable name="y1">
98	  	 <xsl:call-template name="y"/>
99	  </xsl:variable>
100
101		<xsl:variable name="y" select="(floor($i div 3)) * 300 + number($y1) + 80 "/>
102
103	  <div style="position:absolute; padding:15px; left:{$x}px; top:{$y}px; width:170px; height:220px; z-index:1" class="tcolor">
104  		<div align="center">
105
106    		<xsl:apply-templates select="@icon"/>
107    		<p>
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="@pages"/>
116			<xsl:apply-templates select="@size"/>
117			</p>
118		  </div>
119	  </div>
120	</xsl:template>
121
122	<xsl:template name="x">
123		<xsl:variable name="i" select="position()"/>
124		<xsl:choose>
125			<xsl:when test="$i = 2">
126				&x2;
127		   </xsl:when>
128			<xsl:when test="$i = 3">
129				&x3;
130		   </xsl:when>
131			<xsl:otherwise>
132				<xsl:choose>
133					<xsl:when test="($i mod 3) = 1">
134						&x1;
135					</xsl:when>
136					<xsl:when test="($i mod 3) = 2">
137						&x3;
138					</xsl:when>
139					<xsl:when test="($i mod 3) = 0">
140						&x2;
141					</xsl:when>
142				</xsl:choose>
143			</xsl:otherwise>
144		</xsl:choose>
145	</xsl:template>
146
147	<xsl:template name="y">
148		<xsl:variable name="i" select="position()"/>
149		<xsl:choose>
150			<xsl:when test="$i = 2">
151				&y2;
152		   </xsl:when>
153			<xsl:when test="$i = 3">
154				&y3;
155		   </xsl:when>
156			<xsl:otherwise>
157				<xsl:choose>
158					<xsl:when test="($i mod 3) = 1">
159						&y1;
160					</xsl:when>
161					<xsl:when test="($i mod 3) = 2">
162						&y3;
163					</xsl:when>
164					<xsl:when test="($i mod 3) = 0">
165						&y2;
166					</xsl:when>
167				</xsl:choose>
168			</xsl:otherwise>
169		</xsl:choose>
170	</xsl:template>
171
172
173	 <xsl:template name="document-group">
174	 	<xsl:param name="group"/>
175
176	 	<!-- @ pre group code here -->
177
178	 	<!-- - - -->
179
180		 	<xsl:variable name="count" select="(position() - 1) * $group + 1"/>
181
182		 	<xsl:for-each select="/session/content/document[$count &lt;= position() and position() &lt; ($count + $group)]">
183
184				<xsl:apply-templates select="."/>
185
186		 	</xsl:for-each>
187
188	 	<!-- @ post group code here -->
189
190	 	<!-- - - -->
191
192	 </xsl:template>
193
194
195	 <xsl:template name="title">
196	    <!--
197	      @ Pre title html code here
198	    -->
199	   <div style="position:absolute; left:280px; top:8px; width:220px; z-index:2; padding:10px" class="ccolor">
200		  <div align="center" class="toctitle">
201		  	<xsl:value-of select="/session/general-info/@title"/>
202		  	&#160;
203	    <!--
204	      @ Post title html code here
205	    -->
206	    	</div>
207    	</div>
208	 </xsl:template>
209
210</xsl:stylesheet>
211