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 | extension-element-prefixes="java">
|
---|
6 |
|
---|
7 | <xsl:include href="style.xsl"/>
|
---|
8 |
|
---|
9 | <xsl:output method="html"/>
|
---|
10 |
|
---|
11 | <xsl:template match="page">
|
---|
12 | <html>
|
---|
13 | <xsl:call-template name="greenstoneHead"/>
|
---|
14 | <body xsl:use-attribute-sets="body-style">
|
---|
15 | <center>
|
---|
16 | <xsl:apply-templates select="response/collection"/>
|
---|
17 | </center>
|
---|
18 | <xsl:call-template name="greenstoneFooter"/>
|
---|
19 | </body>
|
---|
20 | </html>
|
---|
21 | </xsl:template>
|
---|
22 |
|
---|
23 | <xsl:template match="collection">
|
---|
24 |
|
---|
25 | <xsl:call-template name="collectionPageBanner">
|
---|
26 | <xsl:with-param name="collName"><xsl:value-of select="@name"/></xsl:with-param>
|
---|
27 | <xsl:with-param name="collIcon"><xsl:value-of select="metadataList/metadata[@name='iconCollection']"/></xsl:with-param>
|
---|
28 | </xsl:call-template>
|
---|
29 | <p/><xsl:apply-templates select="metadataList">
|
---|
30 | <xsl:with-param name="collName"><xsl:value-of select="@name"/></xsl:with-param>
|
---|
31 | </xsl:apply-templates>
|
---|
32 | <p/><xsl:apply-templates select="serviceList">
|
---|
33 | <xsl:with-param name="collName"><xsl:value-of select="@name"/></xsl:with-param>
|
---|
34 | </xsl:apply-templates>
|
---|
35 | </xsl:template>
|
---|
36 |
|
---|
37 |
|
---|
38 | <xsl:template match="metadataList">
|
---|
39 | <xsl:param name="collName">coll-name</xsl:param>
|
---|
40 | <h2>Collection description</h2>
|
---|
41 | <p/>
|
---|
42 | <table>
|
---|
43 | <xsl:for-each select="metadata">
|
---|
44 | <tr><td><xsl:value-of select="@name"/></td><td><xsl:value-of select="."/></td></tr>
|
---|
45 | </xsl:for-each>
|
---|
46 | </table>
|
---|
47 | </xsl:template>
|
---|
48 |
|
---|
49 | <xsl:template match="serviceList">
|
---|
50 | <xsl:param name="collName">coll-name</xsl:param>
|
---|
51 | <h2>Services available</h2>
|
---|
52 | <table>
|
---|
53 | <xsl:for-each select="service[@type='query']">
|
---|
54 | <xsl:variable name="serviceName"><xsl:value-of select="@name"/></xsl:variable>
|
---|
55 | <tr>
|
---|
56 | <xsl:if test="contains($serviceName, 'Query')">
|
---|
57 | <xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Query')"/></xsl:variable>
|
---|
58 | <xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
|
---|
59 | <td><xsl:call-template name="text"><xsl:with-param name="key">common/search</xsl:with-param></xsl:call-template></td>
|
---|
60 | <td><a><xsl:attribute name="href">library?a=q&sa=<xsl:value-of select="$lower-type"/>&c=<xsl:value-of select="$collName"/></xsl:attribute><xsl:value-of select="substring-before($serviceName, 'Query')"/></a></td>
|
---|
61 | </xsl:if>
|
---|
62 | <xsl:if test="contains($serviceName, 'Browse')">
|
---|
63 | <xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Browse')"/></xsl:variable>
|
---|
64 | <xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
|
---|
65 | <td><xsl:call-template name="text"><xsl:with-param name="key">common/browse</xsl:with-param></xsl:call-template></td>
|
---|
66 | <td><a><xsl:attribute name="href">library?a=b&sa=<xsl:value-of select="$lower-type"/>&c=<xsl:value-of select="$collName"/></xsl:attribute><xsl:value-of select="substring-before($serviceName, 'Browse')"/></a></td>
|
---|
67 | </xsl:if>
|
---|
68 | </tr>
|
---|
69 |
|
---|
70 | </xsl:for-each>
|
---|
71 | </table>
|
---|
72 | <xsl:call-template name="greenBar"/>
|
---|
73 | </xsl:template>
|
---|
74 |
|
---|
75 |
|
---|
76 | </xsl:stylesheet>
|
---|
77 |
|
---|