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.
27I use the @ character whereever there is a missing code, so
28you can use a simple find to navigate and find the
29places...
30====================================================== -->
31
32<xsl:stylesheet version="1.0"
33   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
34	xmlns="http://www.w3.org/1999/xhtml">
35
36	<xsl:output method               = "html"
37                media-type           = "text/html"
38                indent               = "yes"
39                doctype-public       = "-//W3C//DTD HTML 4.0 Transitional//EN"
40                omit-xml-declaration = "yes"
41                standalone           = "yes" />
42
43	<xsl:include href="../layout.xsl"/>
44
45
46	 <!-- =============================
47	               HTML BODY
48	 ================================== -->
49
50	 <xsl:template name="body">
51
52	 	<body>
53
54			<!--
55		     @ pre code here
56			-->
57
58			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tcolor">
59
60		 		<xsl:call-template name="title"/>
61
62				<!--
63			     @ inter code here
64				-->
65
66		 		<xsl:call-template name="toc"/>
67
68				<!--
69			     @ post code here
70				-->
71
72			</table>
73
74	 	</body>
75
76	 </xsl:template>
77
78
79
80
81	 <xsl:template name="title">
82	    <!--
83	      @ Pre title html code here
84	    -->
85		 <tr>
86    			<td height="200%" colspan="7" class="toctitle">
87
88			    	<xsl:value-of select="/session/general-info/@title"/>
89
90	    <!--
91	      @ Post title html code here
92	    -->
93
94 				</td>
95	  	</tr>
96
97	 </xsl:template>
98
99
100 	 <xsl:template name="toc">
101
102		<!-- @ pre toc html here -->
103
104		<!-- - - -->
105
106		<!-- use this to group documents, it
107		is for example usefull when generating tables -->
108
109
110
111		<xsl:call-template name="toc-with-group">
112			<xsl:with-param name="group" select="2"/>
113		</xsl:call-template>
114
115
116		<!-- use this alternative if you do not need to use groups
117		(uncomment to use - and do not forget to comment the group
118		option above...)-->
119
120		<!-- <xsl:apply-templates select="/session/content/document"/> -->
121
122		<!-- @ post toc html here	-->
123
124		<!-- - - -->
125
126	 </xsl:template>
127
128
129	 <xsl:template name="toc-with-group">
130	 	<xsl:param name="group"/>
131
132	 	<xsl:for-each select="/session/content/document[ ( ( position() - 1 ) mod $group ) = 0 ]">
133
134				<xsl:call-template name="document-group">
135			  		<xsl:with-param name="group" select="$group"/>
136				</xsl:call-template>
137
138		</xsl:for-each>
139
140	 </xsl:template>
141
142	 <xsl:template name="document-group">
143	 	<xsl:param name="group"/>
144
145	 	<!-- @ pre group code here -->
146
147	 	<tr>
148	   	<td width="30" height="200" class="ccolor"></td>
149
150	 	<!-- - - -->
151
152		 	<xsl:variable name="count" select="(position() - 1) * $group + 1"/>
153
154		 	<xsl:for-each select="/session/content/document[$count &lt;= position() and position() &lt; ($count + $group)]">
155
156					<xsl:apply-templates select="."/>
157
158					<xsl:if test="last()=1 and position()=last()">
159					  <xsl:call-template name="empty-doc"/>
160					</xsl:if>
161
162		 	</xsl:for-each>
163
164	 	<!-- @ post group code here -->
165
166   		<td colspan="2" class="ccolor"></td>
167	   </tr>
168
169	 	<!-- - - -->
170
171	 </xsl:template>
172
173	<xsl:template name="empty-doc">
174		<td width="50"> <p>	</p></td>
175		<td width="200"> <p>	</p></td>
176	</xsl:template>
177
178
179	<!-- also when using groups, in the end it comes
180	to this template, which is called for each document -->
181
182	<xsl:template match="document">
183		<!-- file format icon -->
184
185		<td width="50"> <p>
186				<xsl:apply-templates select="@icon"/>
187		</p></td>
188
189		<td width="200"> <p>
190
191			<xsl:apply-templates select="@title"/>
192			<xsl:apply-templates select="@description"/>
193			<xsl:apply-templates select="@author"/>
194			<xsl:apply-templates select="@create-date"/>
195			<xsl:apply-templates select="@update-date"/>
196			<xsl:apply-templates select="@filename"/>
197			<xsl:apply-templates select="@format"/>
198			<xsl:apply-templates select="@pages"/>
199			<xsl:apply-templates select="@size"/>
200
201		</p> </td>
202
203	</xsl:template>
204
205</xsl:stylesheet>
206