source: main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl@ 26368

Last change on this file since 26368 was 26368, checked in by kjdon, 8 years ago

moved param stuff to query-common.xsl so it can be shared. made 'displaying X to Y of Z docs' a single sentence in dictionary, with args passed in. better for translation when word order is different

File size: 21.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsvar="http://www.greenstone.org/skinning-var"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9 extension-element-prefixes="java util"
10 exclude-result-prefixes="java util gsf">
11
12 <!-- use the 'main' layout -->
13 <xsl:import href="layouts/main.xsl"/>
14
15 <xsl:include href="query-common.xsl"/>
16 <!-- set page title -->
17 <xsl:template name="pageTitle"><gslib:serviceName/></xsl:template>
18
19 <!-- set page breadcrumbs -->
20 <xsl:template name="breadcrumbs"> <gslib:siteLink/><gslib:rightArrow/><xsl:if test="/page/pageResponse/collection"> <gslib:collectionNameLinked/><gslib:rightArrow/></xsl:if></xsl:template>
21
22 <!-- the page content -->
23 <xsl:template match="/page">
24 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'qs']) or /page/pageRequest/paramList/param[@name = 'qs']/@value = ''">
25 <xsl:call-template name="queryPage"/>
26 </xsl:if>
27 <xsl:call-template name="resultsPage"/>
28 </xsl:template>
29
30 <xsl:template name="resultsPage">
31 <xsl:call-template name="resultsPagePre"/>
32 <xsl:call-template name="displayTermInfo"/>
33 <xsl:call-template name="displayResults"/>
34 <xsl:call-template name="resultsPagePost"/>
35 </xsl:template>
36
37 <!-- optional cgi-params for links to document pages -->
38 <xsl:variable name="opt-doc-link-args">p.s=<gsvar:this-service/></xsl:variable>
39
40 <xsl:template name="displayResults">
41 <xsl:if test="/page/pageResponse/facetList/facet">
42 <script type="text/javascript" src="interfaces/{$interface_name}/js/facet-scripts.js"><xsl:text> </xsl:text></script>
43 <div id="facetSelector">
44 <xsl:for-each select="/page/pageResponse/facetList/facet">
45 <xsl:if test="count(count) > 0">
46 <ul class="facetTable ui-widget-content" indexName="{@name}">
47 <xsl:variable name="serviceName"><xsl:value-of select="/page/pageRequest/paramList/param[@name = 's']/@value"/></xsl:variable>
48 <xsl:variable name="indexShortName"><xsl:value-of select="@name"/></xsl:variable>
49 <xsl:variable name="countSize">
50 <xsl:choose>
51 <xsl:when test="/page/pageResponse/format[@type='search']/gsf:option[@name='facetTableRows']">
52 <xsl:value-of select="/page/pageResponse/format[@type='search']/gsf:option[@name='facetTableRows']/@value"/>
53 </xsl:when>
54 <xsl:otherwise>8</xsl:otherwise>
55 </xsl:choose>
56 </xsl:variable>
57
58 <li class="ui-widget-header" style="text-transform:capitalize; text-align:center;">
59 <xsl:choose>
60 <xsl:when test="/page/pageResponse/collection/serviceList/service[@name = $serviceName]/paramList/param[@name = 'index']">
61 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name = $serviceName]/paramList/param[@name = 'index']/option[@name = $indexShortName]/displayItem"/>
62 </xsl:when>
63 <xsl:when test="/page/pageResponse/collection/serviceList/service[@name = $serviceName]/paramList/param[@name = 'complexField']/param[@name = 'fqf']">
64 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name = $serviceName]/paramList/param[@name = 'complexField']/param[@name = 'fqf']/option[@name = $indexShortName]/displayItem"/>
65 </xsl:when>
66 </xsl:choose>
67 </li>
68 <xsl:for-each select="count">
69 <li>
70 <xsl:attribute name="style">
71 <xsl:if test="position() > $countSize">display:none;<xsl:value-of select="$indexShortName"/></xsl:if>
72 </xsl:attribute>
73 <input type="checkbox" onclick="performRefinedSearch();"/><span><xsl:value-of select="@name"/></span>(<xsl:value-of select="."/>)
74 </li>
75 </xsl:for-each>
76 <xsl:if test="count(count) > $countSize">
77 <li class="expandCollapseFacetList{$indexShortName}"><a class="expandCollapseFacetListLink{$indexShortName}" href="javascript:expandFacetList('{$indexShortName}', {$countSize});">See more...</a></li>
78 </xsl:if>
79 </ul>
80 </xsl:if>
81 </xsl:for-each>
82 </div>
83 </xsl:if>
84 <div id="resultsArea">
85 <xsl:attribute name="class">
86 <xsl:if test="/page/pageResponse/facetList/facet">facetedResults</xsl:if>
87 </xsl:attribute>
88 <table id="resultsTable">
89 <xsl:for-each select="pageResponse/documentNodeList/documentNode">
90 <tr id="div{@nodeID}" class="document">
91 <xsl:apply-templates select="."/>
92 <xsl:call-template name="documentNodePost"/>
93 </tr>
94 </xsl:for-each>
95 <br/>
96 </table>
97
98 <!-- Previous/Next buttons-->
99 <xsl:call-template name="prevNextButtons"/>
100 </div>
101 <xsl:if test="/page/pageResponse/facetList/facet">
102 <div style="clear:both;"><xsl:text> </xsl:text></div>
103 </xsl:if>
104 </xsl:template>
105
106 <xsl:template name="queryPage">
107 <xsl:for-each select="pageResponse/service">
108 <form name="QueryForm" method="get" action="{$library_name}/collection/{$collName}/search/{@name}">
109 <div>
110 <input type="hidden" name="a" value="q"/>
111 <input type="hidden" name="sa"><xsl:attribute name="value"><xsl:value-of select="/page/pageRequest/@subaction"/></xsl:attribute></input>
112 <input type="hidden" name="rt" value="rd"/>
113 <xsl:choose>
114 <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.maxDocs']">
115 <input type="hidden" name="s1.maxDocs">
116 <xsl:attribute name="value">
117 <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.maxDocs']/@value"/>
118 </xsl:attribute>
119 </input>
120 </xsl:when>
121 <xsl:otherwise>
122 <input type="hidden" name="s1.maxDocs" value="100"/>
123 </xsl:otherwise>
124 </xsl:choose>
125 <xsl:choose>
126 <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.hitsPerPage']">
127 <input type="hidden" name="s1.hitsPerPage">
128 <xsl:attribute name="value">
129 <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.hitsPerPage']/@value"/>
130 </xsl:attribute>
131 </input>
132 </xsl:when>
133 <xsl:otherwise>
134 <input type="hidden" name="s1.hitsPerPage" value="20"/>
135 </xsl:otherwise>
136 </xsl:choose>
137
138 <xsl:variable name="ns">s1.</xsl:variable>
139 <xsl:for-each select="paramList/param">
140 <xsl:choose>
141 <xsl:when test="@name = 'maxDocs' or @name = 'hitsPerPage'">
142 </xsl:when>
143 <xsl:when test="@type='multi'">
144 <xsl:apply-templates select="."><xsl:with-param name="ns" select="$ns"/></xsl:apply-templates>
145 </xsl:when>
146 <xsl:otherwise>
147 <xsl:call-template name="param-display"><xsl:with-param name="ns" select="$ns"/></xsl:call-template>
148 </xsl:otherwise>
149 </xsl:choose>
150 </xsl:for-each>
151 <br/>
152 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
153 </div>
154 </form>
155 </xsl:for-each>
156 </xsl:template>
157
158 <xsl:template name="displayTermInfo">
159 <!-- Find the total number of documents returned -->
160 <xsl:variable name="docMax">
161 <xsl:choose>
162 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']">
163 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']"/>
164 </xsl:when>
165 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']">
166 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']"/>
167 </xsl:when>
168 <xsl:otherwise><xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/></xsl:otherwise>
169 </xsl:choose>
170 </xsl:variable>
171
172 <!-- Find the number of documents displayed per page -->
173 <xsl:variable name="level">
174 <xsl:choose>
175 <xsl:when test="/page/pageRequest/paramList/param[@name='level']">
176 <xsl:value-of select="/page/pageRequest/paramList/param[@name='level']/@value" />
177 </xsl:when>
178 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.level']">
179 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.level']/@value" />
180 </xsl:when>
181 <xsl:otherwise>Doc</xsl:otherwise>
182 </xsl:choose>
183 </xsl:variable>
184
185 <!-- The list of search terms with their frequency and document count -->
186 <xsl:choose>
187 <xsl:when test="$docMax &gt; 0">
188 <p class="termList">
189 <xsl:if test="count(/page/pageResponse/termList/stopword) &gt; 0">
190 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.common')"/><xsl:text> </xsl:text>
191 </xsl:if>
192
193 <xsl:if test="/page/pageResponse/termList/stopword">
194 <xsl:for-each select="/page/pageResponse/termList/stopword">
195 <span style="font-style:italic;"><xsl:value-of select="@name"/></span><xsl:text> </xsl:text>
196 </xsl:for-each>
197 <br /><br />
198 </xsl:if>
199
200 <xsl:for-each select="/page/pageResponse/termList/term">
201 <xsl:choose>
202 <!-- If there is only one or two search terms then show the expanded information -->
203 <xsl:when test="count(/page/pageResponse/termList/term) &lt; 3">
204 <span class="termInfo">
205 <span style="font-style:italic;"><xsl:value-of select="@name"/></span>
206 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.occurs')"/><xsl:text> </xsl:text>
207 <xsl:choose>
208 <xsl:when test="@freq = 1">
209 <xsl:value-of select="@freq"/>
210 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.time')"/>
211 </xsl:when>
212 <xsl:when test="@freq &lt; 0"></xsl:when>
213 <xsl:when test="@freq &gt; 1">
214 <xsl:value-of select="@freq"/>
215 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.time_plural')"/>
216 </xsl:when>
217 </xsl:choose>
218 <xsl:if test="not(not(@numDocsMatch) or @numDocsMatch = '')">
219 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.in')"/><xsl:text> </xsl:text>
220 <xsl:value-of select="@numDocsMatch"/>
221 <xsl:choose>
222 <xsl:when test="@numDocsMatch = 1">
223 <xsl:text> </xsl:text>
224 <xsl:choose>
225 <xsl:when test="$level = 'Doc'">
226 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
227 </xsl:when>
228 <xsl:otherwise>
229 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section')"/>
230 </xsl:otherwise>
231 </xsl:choose>
232 </xsl:when>
233 <xsl:when test="@numDocsMatch &gt; 1">
234 <xsl:text> </xsl:text>
235 <xsl:choose>
236 <xsl:when test="$level = 'Doc'">
237 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
238 </xsl:when>
239 <xsl:otherwise>
240 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
241 </xsl:otherwise>
242 </xsl:choose>
243 </xsl:when>
244 </xsl:choose>
245 </xsl:if>
246 <br />
247 </span>
248 </xsl:when>
249 <xsl:otherwise>
250 <span style="font-style:italic;"><xsl:value-of select="@name"/></span> (<xsl:value-of select="@freq"/>)
251 </xsl:otherwise>
252 </xsl:choose>
253 </xsl:for-each>
254 </p>
255 </xsl:when>
256 <xsl:otherwise><!-- 0 results. Still need to check for search term being stopwords -->
257 <xsl:choose>
258 <xsl:when test="count(/page/pageResponse/termList/stopword) &gt; 0">
259 <p class="termList">
260 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.common')"/><xsl:text> </xsl:text>
261
262 <xsl:if test="/page/pageResponse/termList/stopword">
263 <xsl:for-each select="/page/pageResponse/termList/stopword">
264 <span style="font-style:italic;"><xsl:value-of select="@name"/></span><xsl:text> </xsl:text>
265 </xsl:for-each>
266 <br /><br />
267 </xsl:if>
268 </p>
269 </xsl:when>
270 <xsl:otherwise><!-- 0 results and not owing to stopwords.-->
271 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
272 </xsl:otherwise>
273 </xsl:choose>
274 </xsl:otherwise>
275 </xsl:choose>
276 </xsl:template>
277
278 <xsl:template name="prevNextButtons">
279 <!-- Current page -->
280 <xsl:variable name="currentPage">
281 <xsl:choose>
282 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.startPage']/@value">
283 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.startPage']/@value" />
284 </xsl:when>
285 <xsl:when test="/page/pageRequest/paramList/param[@name='startPage']/@value">
286 <xsl:value-of select="/page/pageRequest/paramList/param[@name='startPage']/@value" />
287 </xsl:when>
288 <xsl:otherwise>1</xsl:otherwise>
289 </xsl:choose>
290 </xsl:variable>
291
292 <xsl:variable name="usesS1">
293 <xsl:choose>
294 <xsl:when test="/page/pageResponse/service/paramList/param[@name='startPage']">true</xsl:when>
295 <xsl:otherwise>false</xsl:otherwise>
296 </xsl:choose>
297 </xsl:variable>
298
299 <!-- Find the total number of documents returned -->
300 <xsl:variable name="docMax">
301 <xsl:choose>
302 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']">
303 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsReturned']"/>
304 </xsl:when>
305 <xsl:when test="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']">
306 <xsl:value-of select="/page/pageResponse/metadataList/metadata[@name = 'numDocsMatched']"/>
307 </xsl:when>
308 <xsl:otherwise><xsl:value-of select="count(/page/pageResponse/documentNodeList/documentNode)"/></xsl:otherwise>
309 </xsl:choose>
310 </xsl:variable>
311
312 <!-- Find the number of documents displayed per page -->
313 <xsl:variable name="docsPerPage">
314 <xsl:choose>
315 <xsl:when test="/page/pageRequest/paramList/param[@name='hitsPerPage']">
316 <xsl:value-of select="/page/pageRequest/paramList/param[@name='hitsPerPage']/@value" />
317 </xsl:when>
318 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.hitsPerPage']">
319 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.hitsPerPage']/@value" />
320 </xsl:when>
321 <xsl:otherwise>20</xsl:otherwise>
322 </xsl:choose>
323 </xsl:variable>
324
325 <!-- Find the number of documents displayed per page -->
326 <xsl:variable name="level">
327 <xsl:choose>
328 <xsl:when test="/page/pageRequest/paramList/param[@name='level']">
329 <xsl:value-of select="/page/pageRequest/paramList/param[@name='level']/@value" />
330 </xsl:when>
331 <xsl:when test="/page/pageRequest/paramList/param[@name='s1.level']">
332 <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.level']/@value" />
333 </xsl:when>
334 <xsl:otherwise>Doc</xsl:otherwise>
335 </xsl:choose>
336 </xsl:variable>
337
338 <table id="searchResultNavTable"><tr>
339 <xsl:variable name="startPageName"><xsl:if test="$usesS1 = 'true'">s1.</xsl:if>startPage</xsl:variable>
340
341 <!-- Previous button -->
342 <td id="prevArrowTD">
343 <xsl:if test="$currentPage != 1">
344 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
345 <img src="interfaces/default/images/previous.png"/>
346 </a>
347 </xsl:if>
348 </td>
349 <td id="prevTD">
350 <xsl:if test="$currentPage != 1">
351 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">Previous</a>
352 </xsl:if>
353 </td>
354
355 <!-- Search result status bar (in english it reads "Displaying X to Y of Z documents") -->
356 <xsl:if test="$docMax &gt; 0">
357 <xsl:variable name="startdoc" select="($currentPage - 1) * $docsPerPage + 1"/>
358 <xsl:variable name="enddoc"><xsl:choose>
359 <xsl:when test="($currentPage * $docsPerPage + 1) &gt; $docMax">
360 <xsl:value-of select="$docMax"/>
361 </xsl:when>
362 <xsl:otherwise>
363 <xsl:value-of select="$currentPage * $docsPerPage"/>
364 </xsl:otherwise>
365 </xsl:choose></xsl:variable>
366 <xsl:variable name="level"> <xsl:choose>
367 <xsl:when test="$docMax = 1">
368 <xsl:text> </xsl:text>
369 <xsl:choose>
370 <xsl:when test="$level = 'Doc'">
371 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
372 </xsl:when>
373 <xsl:otherwise>
374 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section')"/>
375 </xsl:otherwise>
376 </xsl:choose>
377 </xsl:when>
378 <xsl:otherwise>
379 <xsl:text> </xsl:text>
380 <xsl:choose>
381 <xsl:when test="$level = 'Doc'">
382 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
383 </xsl:when>
384 <xsl:otherwise>
385 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
386 </xsl:otherwise>
387 </xsl:choose>
388 </xsl:otherwise>
389 </xsl:choose></xsl:variable>
390 <td id="searchResultsStatusBar">
391 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.displayingnumdocs', concat($startdoc,';', $enddoc, ';', $docMax, ';', $level))"/>
392 </td>
393 </xsl:if>
394
395 <!-- Next button -->
396 <td id="nextTD">
397 <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
398 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">Next</a>
399 </xsl:if>
400 </td>
401 <td id="nextArrowTD">
402 <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
403 <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}&amp;qs={/page/pageRequest/paramList/param[@name='qs']/@value}">
404 <img src="interfaces/default/images/next.png"/>
405 </a>
406 </xsl:if>
407 </td>
408 </tr></table>
409 </xsl:template>
410
411 <!-- puts all the params into a=p&p=h type form - need to change this if use
412 multi params -->
413 <xsl:template match="paramList" mode="cgi">
414 <xsl:param name="ns">s1.</xsl:param>
415 <xsl:for-each select="param">
416 <xsl:variable name='pname' select="@name"/>
417 <xsl:text>&amp;</xsl:text><xsl:value-of select="$ns"/><xsl:value-of select="@name"/>=<xsl:apply-templates select="." mode="calculate-default"><xsl:with-param name='ns' select='$ns'/></xsl:apply-templates>
418 </xsl:for-each>
419 </xsl:template>
420
421
422
423
424
425
426
427 <xsl:template name="resultsPagePre">
428 <!-- OVERWRITE TO INSERT CONTENT BEFORE THE RESULTS PAGE -->
429 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
430 <xsl:call-template name="mapFeaturesJSONNodes"/>
431 </xsl:if>
432 </xsl:template>
433
434 <xsl:template name="resultsPagePost">
435 <!-- OVERWRITE TO INSERT CONTENT AFTER THE RESULTS PAGE -->
436 </xsl:template>
437
438 <xsl:template name="documentNodePre">
439 <!-- OVERWRITE TO INSERT CONTENT BEFORE EVERY DOCUMENT NODE -->
440 </xsl:template>
441
442 <xsl:template name="documentNodePost">
443 <!-- OVERWRITE TO INSERT CONTENT AFTER EVERY DOCUMENT NODE -->
444 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
445 <xsl:call-template name="mapFeaturesIcon"/>
446 </xsl:if>
447 </xsl:template>
448
449 <xsl:template name="mapFeaturesJSONNodes">
450 <div id="jsonNodes" style="display:none;">
451 <xsl:text>[</xsl:text>
452 <xsl:for-each select="//documentNode">
453 <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
454 <xsl:text>{</xsl:text>
455 <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
456 <xsl:text disable-output-escaping="yes">"title":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/><xsl:text disable-output-escaping="yes">",</xsl:text>
457 <xsl:text disable-output-escaping="yes">"lat":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/><xsl:text>,</xsl:text>
458 <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
459 <xsl:text>}</xsl:text>
460 <xsl:if test="not(position() = count(//documentNode))">
461 <xsl:text>,</xsl:text>
462 </xsl:if>
463 </xsl:if>
464 </xsl:for-each>
465 <xsl:text>]</xsl:text>
466 </div>
467
468 <div id="map_canvas" style="margin:0px auto; width:450px; height:500px; float:right;"><xsl:text> </xsl:text></div>
469
470 <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
471 <gsf:metadata name="Latitude" hidden="true"/>
472 <gsf:metadata name="Longitude" hidden="true"/>
473 </xsl:template>
474
475 <xsl:template name="mapFeaturesIcon">
476 <td style="padding-left:5px; padding-right:5px;" valign="top">
477 <a href="javascript:focusDocument('{@nodeID}');"><img src="interfaces/default/images/map_marker.png"/></a>
478 </td>
479 </xsl:template>
480</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.