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