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 wherever 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="9" 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 useful when generating tables -->
108
109
110
111		<xsl:call-template name="toc-with-group">
112			<xsl:with-param name="group" select="3"/>
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:choose>
159						<xsl:when test="last()=1 and position()=last()">
160						  <xsl:call-template name="empty-doc"/>
161						  <xsl:call-template name="empty-doc"/>
162						</xsl:when>
163						<xsl:when test="last()=2 and position()=last()">
164						  <xsl:call-template name="empty-doc"/>
165						</xsl:when>
166					</xsl:choose>
167
168		 	</xsl:for-each>
169
170	 	<!-- @ post group code here -->
171
172   		<td colspan="2" class="ccolor"></td>
173	   </tr>
174
175	 	<!-- - - -->
176
177	 </xsl:template>
178
179	<xsl:template name="empty-doc">
180		<td width="50"> <p>	</p></td>
181		<td width="200"> <p>	</p></td>
182	</xsl:template>
183
184
185	<!-- also when using groups, in the end it comes
186	to this template, which is called for each document -->
187
188	<xsl:template match="document">
189		<!-- file format icon -->
190
191		<td width="50"> <p>
192				<xsl:apply-templates select="@icon"/>
193		</p></td>
194
195		<td width="200"> <p>
196
197			<xsl:apply-templates select="@title"/>
198			<xsl:apply-templates select="@description"/>
199			<xsl:apply-templates select="@author"/>
200			<xsl:apply-templates select="@create-date"/>
201			<xsl:apply-templates select="@update-date"/>
202			<xsl:apply-templates select="@filename"/>
203			<xsl:apply-templates select="@format"/>
204			<xsl:apply-templates select="@pages"/>
205			<xsl:apply-templates select="@size"/>
206
207		</p> </td>
208
209	</xsl:template>
210
211</xsl:stylesheet>
212