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 |
|
---|
5 | <xsl:include href="style.xsl"/>
|
---|
6 | <xsl:include href="service-params.xsl"/>
|
---|
7 |
|
---|
8 | <xsl:output method="html"/>
|
---|
9 |
|
---|
10 | <xsl:template name="pageHead">
|
---|
11 | <head>
|
---|
12 | <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
|
---|
13 | </head>
|
---|
14 | </xsl:template>
|
---|
15 |
|
---|
16 | <xsl:template match="pageResponse">
|
---|
17 | <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
|
---|
18 |
|
---|
19 | <center>
|
---|
20 | <xsl:call-template name="collectionPageBanner">
|
---|
21 | <xsl:with-param name="collName" select="$collName"/>
|
---|
22 | </xsl:call-template>
|
---|
23 | <xsl:apply-templates select="service">
|
---|
24 | <xsl:with-param name="collName" select="$collName"/>
|
---|
25 | </xsl:apply-templates>
|
---|
26 | </center>
|
---|
27 |
|
---|
28 | <!-- Process the query response -->
|
---|
29 | <xsl:if test="documentNodeList">
|
---|
30 | <xsl:call-template name="greenBarResults"/>
|
---|
31 |
|
---|
32 | <!-- If query term information is available, display it -->
|
---|
33 | <br/>
|
---|
34 | <xsl:if test="count(termList/term) > 0">
|
---|
35 | <small>
|
---|
36 | <xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template>
|
---|
37 | <xsl:for-each select="termList/term">
|
---|
38 | <xsl:if test="position() > 1">, </xsl:if>
|
---|
39 | <xsl:value-of select="@name"/>: <xsl:value-of select="@freq"/>
|
---|
40 | </xsl:for-each>
|
---|
41 | </small>
|
---|
42 | <br/>
|
---|
43 | </xsl:if>
|
---|
44 |
|
---|
45 | <!-- If the number of matching documents is known, display it -->
|
---|
46 | <xsl:variable name="numDocsMatched" select="metadataList/metadata[@name='numDocsMatched']/@value"/>
|
---|
47 | <xsl:if test="$numDocsMatched">
|
---|
48 | <xsl:choose>
|
---|
49 | <xsl:when test="$numDocsMatched='0'">
|
---|
50 | <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template>
|
---|
51 | </xsl:when>
|
---|
52 | <xsl:when test="$numDocsMatched='1'">
|
---|
53 | <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template>
|
---|
54 | </xsl:when>
|
---|
55 | <xsl:otherwise>
|
---|
56 | <xsl:value-of select="$numDocsMatched"/> documents matched the query.
|
---|
57 | </xsl:otherwise>
|
---|
58 | </xsl:choose>
|
---|
59 | </xsl:if>
|
---|
60 |
|
---|
61 | <!-- Display the matching documents -->
|
---|
62 | <table>
|
---|
63 | <tr valign="top">
|
---|
64 | <xsl:for-each select="documentNodeList/documentNode">
|
---|
65 | <tr>
|
---|
66 | <xsl:apply-templates select=".">
|
---|
67 | <xsl:with-param name="collName" select="$collName"/>
|
---|
68 | </xsl:apply-templates>
|
---|
69 | </tr>
|
---|
70 | </xsl:for-each>
|
---|
71 | </tr>
|
---|
72 | </table>
|
---|
73 | </xsl:if>
|
---|
74 | <xsl:call-template name="greenBar"/>
|
---|
75 | </xsl:template>
|
---|
76 |
|
---|
77 |
|
---|
78 | <xsl:template match="service">
|
---|
79 | <xsl:param name="collName">coll-name</xsl:param>
|
---|
80 | <xsl:variable name="subaction"><xsl:value-of select="../request/@subaction"/></xsl:variable>
|
---|
81 | <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
|
---|
82 | <h3><xsl:value-of select="display/name"/></h3><p/>
|
---|
83 | <form name="QueryForm" method="get" action="/gsdl3/{$library}">
|
---|
84 | <xsl:apply-templates select="paramList"/>
|
---|
85 | <input type="hidden" name="a" value="q"/>
|
---|
86 | <input type="hidden" name="sa" value="{$subaction}"/>
|
---|
87 | <input type="hidden" name="rt" value="r"/>
|
---|
88 | <input type="hidden" name="s" value="{@name}"/>
|
---|
89 | <input type="hidden" name="c" value="{$collName}"/>
|
---|
90 | <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
|
---|
91 | </form>
|
---|
92 | </xsl:template>
|
---|
93 |
|
---|
94 |
|
---|
95 | <xsl:template match="paramList">
|
---|
96 | <p/><table width="537">
|
---|
97 | <xsl:for-each select="param">
|
---|
98 | <xsl:choose>
|
---|
99 | <xsl:when test="@type='multi'">
|
---|
100 | <tr><td colspan='2'>
|
---|
101 | <xsl:apply-templates select='.'/></td></tr>
|
---|
102 | </xsl:when>
|
---|
103 | <xsl:otherwise>
|
---|
104 | <xsl:variable name="pname" select="@name"/>
|
---|
105 | <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
|
---|
106 | </xsl:otherwise>
|
---|
107 | </xsl:choose>
|
---|
108 | </xsl:for-each>
|
---|
109 | </table>
|
---|
110 | </xsl:template>
|
---|
111 |
|
---|
112 |
|
---|
113 | <!-- a param list that puts params in pairs- wont work as is with new
|
---|
114 | param handling stuff -->
|
---|
115 | <!--
|
---|
116 | <xsl:template match="paramList">
|
---|
117 | <p/><table width="537">
|
---|
118 | <xsl:choose>
|
---|
119 | <xsl:when test='count(param)>4'>
|
---|
120 | <xsl:for-each select="param[position() mod 2 = 1]">
|
---|
121 | <tr><xsl:apply-templates select="."/>
|
---|
122 | <xsl:if test="following-sibling::param[1]"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
|
---|
123 | </xsl:for-each>
|
---|
124 | </xsl:when>
|
---|
125 | <xsl:otherwise>
|
---|
126 | <xsl:for-each select="param">
|
---|
127 | <tr><xsl:apply-templates select='.'/></tr>
|
---|
128 | </xsl:for-each>
|
---|
129 | </xsl:otherwise>
|
---|
130 | </xsl:choose>
|
---|
131 | </table>
|
---|
132 | </xsl:template>
|
---|
133 | -->
|
---|
134 |
|
---|
135 |
|
---|
136 | <xsl:template match="documentNode">
|
---|
137 | <xsl:param name="collName"/>
|
---|
138 | <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
|
---|
139 |
|
---|
140 | <td>
|
---|
141 | <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if></xsl:attribute>
|
---|
142 | <xsl:apply-templates select="." mode="displayNodeIcon"/>
|
---|
143 | </a>
|
---|
144 | </td>
|
---|
145 | <td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
|
---|
146 | </xsl:template>
|
---|
147 |
|
---|
148 |
|
---|
149 | <xsl:template name="greenBarResults">
|
---|
150 | <p/>
|
---|
151 | <center>
|
---|
152 | <img src="interfaces/default/images/qryresb.gif" width="537" height="17"/>
|
---|
153 | </center>
|
---|
154 | </xsl:template>
|
---|
155 |
|
---|
156 | </xsl:stylesheet>
|
---|