1 <?xml version=
"1.0" encoding=
"UTF-8"?>
2 <!-- =================================================
4 This template is a skeleton for single level TOC pages
5 Do not overwrite this ! copy it and complete the missing
8 I use the @ character whereever there is a missing code, so
9 you can use a simple find to navigate and find the
12 ====================================================== -->
13 <!DOCTYPE xsl:stylesheet [
25 <xsl:stylesheet version=
"1.0"
26 xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
27 xmlns=
"http://www.w3.org/1999/xhtml">
29 <xsl:output method =
"html"
30 media-type =
"text/html"
32 doctype-public =
"-//W3C//DTD HTML 4.0 Transitional//EN"
33 omit-xml-declaration =
"yes"
36 <xsl:include href=
"../layout.xsl"/>
38 <!-- =============================
40 ================================== -->
42 <xsl:template name=
"body">
44 <xsl:call-template name=
"title"/>
45 <xsl:call-template name=
"toc"/>
50 <xsl:template name=
"toc">
55 <xsl:apply-templates select=
"/session/content/document"/>
65 <!-- also when using groups, in the end it comes
66 to this template, which is called for each document -->
67 <xsl:template match=
"document">
69 <xsl:variable name=
"i" select=
"position() - 1"/>
71 <xsl:variable name=
"x1">
72 <xsl:call-template name=
"x"/>
75 <xsl:variable name=
"x" select=
"number($x1) + 50 "/>
77 <xsl:variable name=
"y1">
78 <xsl:call-template name=
"y"/>
81 <xsl:variable name=
"y" select=
"(floor($i div 3)) * 300 + number($y1) + 80 "/>
83 <div style=
"position:absolute; padding:15px; left:{$x}px; top:{$y}px; width:170px; height:220px; z-index:1" class=
"tcolor">
86 <xsl:apply-templates select=
"@icon"/>
88 <xsl:apply-templates select=
"@title"/>
89 <xsl:apply-templates select=
"@description"/>
90 <xsl:apply-templates select=
"@author"/>
91 <xsl:apply-templates select=
"@create-date"/>
92 <xsl:apply-templates select=
"@update-date"/>
93 <xsl:apply-templates select=
"@filename"/>
94 <xsl:apply-templates select=
"@format"/>
95 <xsl:apply-templates select=
"@pages"/>
96 <xsl:apply-templates select=
"@size"/>
102 <xsl:template name=
"x">
103 <xsl:variable name=
"i" select=
"position()"/>
105 <xsl:when test=
"$i = 2">
108 <xsl:when test=
"$i = 3">
113 <xsl:when test=
"($i mod 3) = 1">
116 <xsl:when test=
"($i mod 3) = 2">
119 <xsl:when test=
"($i mod 3) = 0">
127 <xsl:template name=
"y">
128 <xsl:variable name=
"i" select=
"position()"/>
130 <xsl:when test=
"$i = 2">
133 <xsl:when test=
"$i = 3">
138 <xsl:when test=
"($i mod 3) = 1">
141 <xsl:when test=
"($i mod 3) = 2">
144 <xsl:when test=
"($i mod 3) = 0">
153 <xsl:template name=
"document-group">
154 <xsl:param name=
"group"/>
156 <!-- @ pre group code here -->
160 <xsl:variable name=
"count" select=
"(position() - 1) * $group + 1"/>
162 <xsl:for-each select=
"/session/content/document[$count <= position() and position() < ($count + $group)]">
164 <xsl:apply-templates select=
"."/>
168 <!-- @ post group code here -->
175 <xsl:template name=
"title">
177 @ Pre title html code here
179 <div style=
"position:absolute; left:280px; top:8px; width:220px; z-index:2; padding:10px" class=
"ccolor">
180 <div align=
"center" class=
"toctitle">
181 <xsl:value-of select=
"/session/general-info/@title"/>
184 @ Post title html code here