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