source: greenstone3/trunk/web/ui/skins/oran/xsl/collectDocument.xsl@ 16447

Last change on this file since 16447 was 16447, checked in by davidb, 16 years ago

More careful declaration of XSLT header information for produces XML, not HTML output. This is needed for the JAVA code that then takes some transformed code, parses it back in to a DOM (needs to be XML) and then does some final adjustments. When output was HTML, empty elements such as <script ../> could loose their closing />.

File size: 6.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gslib="http://www.greenstone.org/skinning"
6 xmlns:xalan="http://xml.apache.org/xalan">
7
8<xsl:import href="./util.xsl"/>
9
10<xsl:template match="/">
11<html>
12 <head>
13 <title>
14 <gslib:metadataItem name="siteName" />
15 /
16 <gslib:metadataItem name="collectionName" />
17 </title>
18
19 <gslib:css/>
20 <gslib:js/>
21 </head>
22 <body>
23 <xsl:if test="$document_currentSection/@nodeType = 'root'">
24 <xsl:attribute name="onload">showContents()</xsl:attribute>
25 </xsl:if>
26
27 <div id="container">
28 <div id="header">
29 <div class="title_minor">
30 <a href="{$site_homeUrl}">
31 <gslib:metadataItem name="siteName" />
32 </a>
33 </div>
34
35 <div class="title_major">
36 <gslib:metadataItem name="collectionName" />
37 </div>
38
39 <div id="tablist" class="linklist">
40 <ul>
41 <xsl:for-each select="$services">
42 <li>
43 <a href="">
44 <xsl:attribute name="href"> <gslib:service_url/> </xsl:attribute>
45 <xsl:attribute name="title"> <gslib:service_description/> </xsl:attribute>
46 <gslib:service_title/>
47 </a>
48 </li>
49 </xsl:for-each>
50
51 <li>
52 <a href="{$collection_homeUrl}">
53 Home
54 </a>
55 </li>
56 </ul>
57 </div>
58
59 <div class="quicksearchBox" >
60 <form method="get" name="quickSearch">
61 <input type="text" name="s1.query" value="{$search_query}"/>
62
63 <input type="submit" value="Quick Search"/>
64 <gslib:search_hiddenInputs/>
65 </form>
66 </div>
67
68 </div>
69
70 <div id="content" class="noSidebar">
71
72 <br/>
73
74 <xsl:if test="$document_coverImage_exists='true'">
75 <div class="coverImage">
76 <img src="{$document_coverImage_url}"> </img>
77 </div>
78 </xsl:if>
79
80 <h1>
81 <gslib:document_title/>
82 </h1>
83
84 <xsl:choose>
85 <xsl:when test="$document_type='simple'">
86 <div id="subServiceList" class="linklist">
87 <ul>
88 <li>
89 <a href="" target="_blank" title="open in new window">detach</a>
90 </li>
91 </ul>
92 </div>
93
94 <br/><br/>
95
96 <div class="documentBody">
97 <gslib:document_content/>
98 </div>
99 </xsl:when>
100
101 <xsl:when test="$document_type='hierarchy' and $document_is_expanded != 'true'">
102 <div id="subServiceList" class="linklist">
103 <ul>
104 <li>
105 <a href="{$document_expanded_url}" title="view entire document">expand</a>
106 </li>
107 <li>
108 <a href="" target="_blank" title="open in new window">detach</a>
109 </li>
110 </ul>
111 </div>
112
113 <a id="contentsLink" onclick="showContents()">contents</a>
114
115 <div id="contents">
116 <ul>
117 <xsl:for-each select="$document_topLevelNodes">
118 <xsl:call-template name="addDocNodeToContents"/>
119 </xsl:for-each>
120 </ul>
121 </div>
122
123 <br/><br/>
124
125 <div class="documentBody">
126
127 <xsl:choose>
128 <xsl:when test="$document_ancestorSections!=''">
129 <p class="ancestorSections">
130 <xsl:for-each select="$document_ancestorSections_titles">
131 <xsl:value-of select="."/> /
132 </xsl:for-each>
133 </p>
134
135 <h2 class="subsectionHeader"> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
136
137 </xsl:when>
138
139 <xsl:otherwise>
140 <xsl:if test="$document_currentSection/@nodeType != 'root'">
141 <h2> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
142 </xsl:if>
143 </xsl:otherwise>
144 </xsl:choose>
145
146 <xsl:call-template name="section_navigation" />
147
148 <gslib:document_currentSection_content/>
149
150 <xsl:call-template name="section_navigation" />
151 </div>
152 </xsl:when>
153
154 <xsl:when test="$document_type='hierarchy' and $document_is_expanded">
155 <div id="subServiceList" class="linklist">
156 <ul>
157 <li>
158 <a href="{$document_collapsed_url}" title="view document as sections">collapse</a>
159 </li>
160 <li>
161 <a href="" target="_blank" title="open in new window">detach</a>
162 </li>
163 </ul>
164 </div>
165
166
167 <br/><br/>
168 <xsl:for-each select="$document_allSections">
169
170 <xsl:variable name="depth"><gslib:document_section_depth/></xsl:variable>
171
172 <xsl:element name="h{$depth + 1}">
173 <gslib:document_section_title/>
174 </xsl:element>
175
176 <gslib:document_section_content/>
177 </xsl:for-each>
178 </xsl:when>
179
180 </xsl:choose>
181 </div>
182
183 <div id="footer" >
184 <gslib:uiItem name="collectionFooter"/>
185 </div>
186 </div>
187 </body>
188</html>
189</xsl:template>
190
191<xsl:template name="addDocNodeToContents">
192
193 <xsl:variable name="sId"> <gslib:document_section_id/></xsl:variable>
194
195 <li class="expanded" id="{$sId}">
196 <xsl:choose>
197 <xsl:when test="@nodeType='leaf'">
198 <xsl:attribute name="class">leaf</xsl:attribute>
199 </xsl:when>
200 <xsl:otherwise>
201 <xsl:attribute name="class">collapsed</xsl:attribute>
202 </xsl:otherwise>
203 </xsl:choose>
204 <a>
205 <xsl:choose>
206 <xsl:when test=".=$document_currentSection">
207 <xsl:attribute name="id">currentSection</xsl:attribute>
208 </xsl:when>
209 <xsl:when test="@nodeType='leaf'">
210 <xsl:attribute name="href"><gslib:documentNode_url/>&amp;ec=1</xsl:attribute>
211 </xsl:when>
212 <xsl:otherwise>
213 <xsl:attribute name="onclick">toggleNode('<gslib:document_section_id/>')</xsl:attribute>
214 </xsl:otherwise>
215 </xsl:choose>
216
217 <gslib:document_section_title/>
218 </a>
219
220 <xsl:if test="./documentNode">
221 <ul>
222 <xsl:for-each select="./documentNode">
223 <xsl:call-template name="addDocNodeToContents"/>
224 </xsl:for-each>
225 </ul>
226 </xsl:if>
227 </li>
228</xsl:template>
229
230<xsl:template name="section_navigation">
231 <xsl:if test="$document_previousSection!='' or $document_nextSection!=''">
232 <div class="sectionNav">
233 <xsl:if test="$document_previousSection!=''">
234 <a class="prevSection" href="{$document_previousSection_url}" title="{$document_previousSection_title}"> &lt; Previous Section</a>
235 </xsl:if>
236 <xsl:if test="$document_nextSection!=''">
237 <a class="nextSection" href="{$document_nextSection_url}" title="{$document_nextSection_title}">Next Section &gt;</a>
238 </xsl:if>
239 </div>
240 </xsl:if>
241</xsl:template>
242
243</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.