source: main/trunk/greenstone3/web/interfaces/gs2/transform/classifier.xsl@ 25381

Last change on this file since 25381 was 25381, checked in by ak19, 12 years ago

Getting the gs2-library servlet (gs2 interface) work again: 1. the changes to GSXSLT.java ensure that when merging inherited stylesheets, not only duplicated template names and but also duplicated template matches as well as include hrefs and output methods are reduced to only one instance, which are solely those occurring in the stylesheet that is most relevant. As stylesheets are passed in from TransformingReceptionist in the necessary order, this was easily done. 2. To get the main page to work again, the gs2 interface's home.xsl file needed to match a template on page/pageResponse not just pageResponse so that duplicate template matches can be picked up in GSXSLT.java. 3. The gs2 interface's classifier.xsl needs to define a template match for classifierList which has now been copied from the equivalent file in the default interface. This allows the Browse pages of the gs2-library servlet to work again. 4. The namespaces used in default interface's util.xsl has been made consistent with equivalent definitions in other Greenstone xsl files. This did not fix any errors, but it's less confusing now.

  • Property svn:keywords set to Author Date Id Revision
File size: 3.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 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <!-- style includes global params interface_name, library_name -->
10 <xsl:include href="style.xsl"/>
11 <xsl:include href="classifiertools.xsl"/>
12 <!-- classifiertools needs this-->
13 <xsl:include href="berrytools.xsl"/>
14 <xsl:output method="html"/>
15
16 <!-- the main page layout template is here -->
17 <xsl:template match="page">
18 <html>
19 <head>
20 <title>
21 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
22 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
23 </title>
24 <xsl:call-template name="globalStyle"/>
25 <xsl:call-template name="pageStyle"/>
26 </head>
27 <body>
28 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
29 <div id="page-wrapper">
30 <xsl:apply-templates select="pageResponse"/>
31 <xsl:call-template name="greenstoneFooter"/>
32 </div>
33 </body>
34 </html>
35 </xsl:template>
36
37 <xsl:template name="pageTitle">
38 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
39 </xsl:template>
40
41 <!-- page specific style goes here -->
42 <xsl:template name="pageStyle"/>
43
44 <xsl:template match="pageResponse">
45 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
46 <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
47 <xsl:variable name="cl" select="/page/pageRequest/paramList/param[@name='cl']/@value"/>
48 <xsl:variable name="clTop">
49 <xsl:choose>
50 <xsl:when test="contains($cl, '.')"><xsl:value-of select="substring-before($cl, '.')"/></xsl:when>
51 <xsl:otherwise>
52 <xsl:value-of select="$cl"/>
53 </xsl:otherwise>
54 </xsl:choose>
55 </xsl:variable>
56 <xsl:call-template name="standardPageBanner">
57 <xsl:with-param name="collName" select="$collName"/>
58 <xsl:with-param name="pageType">browse</xsl:with-param>
59 <xsl:with-param name="clTop" select="$clTop"/>
60 </xsl:call-template>
61 <xsl:call-template name="navigationBar">
62 <xsl:with-param name="collName" select="$collName"/>
63 <xsl:with-param name="clTop" select="$clTop"/>
64 </xsl:call-template>
65 <div class="document">
66 <xsl:apply-templates select="classifier">
67 <xsl:with-param name="collName" select="$collName"/>
68 <xsl:with-param name="serviceName" select="$serviceName"/>
69 </xsl:apply-templates>
70 </div>
71 </xsl:template>
72
73 <xsl:template match="classifierList">
74 <xsl:param name="collName"/>
75 <xsl:param name="serviceName"/>
76 <xsl:variable name="selected" select="/page/pageResponse/classifier/@name"/>
77 <ul id="classifierlist">
78 <xsl:for-each select="classifier">
79 <xsl:choose>
80 <xsl:when test="@name=$selected">
81 <li id="activeclassifier"><xsl:value-of select="displayItem[@name='name']"/></li>
82 </xsl:when>
83 <xsl:otherwise>
84 <li><a href="{$library_name}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></li></xsl:otherwise></xsl:choose>
85
86 </xsl:for-each>
87 </ul>
88 </xsl:template>
89
90
91</xsl:stylesheet>
92
93
94
95
96
97
Note: See TracBrowser for help on using the repository browser.