Changeset 4252 for trunk/gsdl3/web/interfaces/default/transform
- Timestamp:
- 2003-05-08T13:54:03+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/web/interfaces/default/transform/classifier.xsl
r4146 r4252 11 11 <xsl:template name="pageHead"> 12 12 <head> 13 <title><xsl:call-template name="text"><xsl:with-param name="key"> nzdl</xsl:with-param></xsl:call-template></title>13 <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title> 14 14 </head> 15 15 </xsl:template> … … 47 47 </xsl:when> 48 48 <xsl:otherwise> 49 <td align='center'><a href="{$library}?a=b& s={$serviceName}&c={$collName}&cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose>49 <td align='center'><a href="{$library}?a=b&rt=r&s={$serviceName}&c={$collName}&cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose> 50 50 </xsl:for-each> 51 51 </tr></table> … … 62 62 <xsl:variable name="orientation"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable> 63 63 <xsl:variable name='mode'><xsl:value-of select='$orientation'/>-<xsl:value-of select='$interleave'/></xsl:variable> 64 <!-- cant seem to do this any other way, ie mode='{$mode}' doesn't work --> 64 65 <xsl:choose> 65 66 <xsl:when test="$mode='horizontal-true'"> … … 80 81 <!-- vertical and interleave = true: process all document and classifier children together, recursively --> 81 82 <xsl:template match="classifier" mode="vertical-true"> 82 <xsl:param name="collName" >coll-name</xsl:param>83 <xsl:param name="serviceName" >service-name</xsl:param>83 <xsl:param name="collName"/> 84 <xsl:param name="serviceName"/> 84 85 <table width='537'> 85 86 <xsl:for-each select='classifierNode|documentNode'> … … 96 97 <!--vertical and interleave = false: process all classifier nodes, recursively, then do the document ones separately --> 97 98 <xsl:template match="classifier" mode="vertical-false"> 98 <xsl:param name="collName" >coll-name</xsl:param>99 <xsl:param name="serviceName" >service-name</xsl:param>99 <xsl:param name="collName"/> 100 <xsl:param name="serviceName"/> 100 101 <!-- process the nodes and documents separately--> 101 102 <table width='537'> … … 114 115 115 116 <xsl:template match="classifier" mode="horizontal-true"> 116 <xsl:param name="collName" >coll-name</xsl:param>117 <xsl:param name="serviceName" >service-name</xsl:param>117 <xsl:param name="collName"/> 118 <xsl:param name="serviceName"/> 118 119 <!-- process the nodes and documents together --> 119 120 … … 141 142 142 143 <xsl:template match="classifier" mode="horizontal-false"> 143 <xsl:param name="collName" >coll-name</xsl:param>144 <xsl:param name="serviceName" >service-name</xsl:param>144 <xsl:param name="collName"/> 145 <xsl:param name="serviceName"/> 145 146 <!-- process the nodes and documents separately--> 146 147 … … 161 162 </xsl:template> 162 163 163 <xsl:template match="documentNode"> 164 <xsl:param name="collName">coll-name</xsl:param> 165 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 166 <td><a href="{$library}?a=d&c={$collName}&d={@nodeID}"><img src='interfaces/default/images/book.gif' width='18' height='11' border='0'/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td> 167 </xsl:template> 168 <!-- 169 <xslt:template xmlns:xslt="http://www.w3.org/1999/XSL/Transform" match="documentNode" priority="4"> 170 <xslt:param name="collName">coll-name</xslt:param> 171 172 <xslt:variable name="library" select="ancestor::page/pageExtra/config/library_name" /> <td> 173 <a href="{$library}?a=d&c={$collName}&d={@nodeID}"> 174 <img border="0" height="11" src="interfaces/default/images/book.gif" width="18" /></a> 175 </td> 176 177 <td> 178 <xslt:value-of select="metadataList/metadata[@name='Source']" /></td> 179 </xslt:template> 180 --> 181 <!-- icon + title --> 164 <!-- default doc node template: icon and title --> 165 <xsl:template match="documentNode"> 166 <xsl:param name="collName"/> 167 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/> 168 <td><a href="{$library}?a=d&c={$collName}&d={@nodeID}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td> 169 </xsl:template> 170 171 <!-- default classifier node template: icon + title --> 182 172 <xsl:template match="classifierNode"> 183 <xsl:param name="collName" >coll-name</xsl:param>184 <xsl:param name="serviceName" >service-name</xsl:param>173 <xsl:param name="collName"/> 174 <xsl:param name="serviceName"/> 185 175 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 186 <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b& s=<xsl:value-of select='$serviceName'/>&c=<xsl:value-of select='$collName'/>&cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>187 </xsl:template> 188 189 <!-- the title is a link: an alternative template-->176 <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&rt=r&s=<xsl:value-of select='$serviceName'/>&c=<xsl:value-of select='$collName'/>&cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td> 177 </xsl:template> 178 179 <!-- an alternative classifier node template: the title is a link --> 190 180 <!-- 191 181 <xsl:template match="classifierNode"> 192 <xsl:param name="collName" >coll-name</xsl:param>193 <xsl:param name="serviceName" >service-name</xsl:param>182 <xsl:param name="collName"/> 183 <xsl:param name="serviceName"/> 194 184 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/> 195 <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b& s=<xsl:value-of select='$serviceName'/>&c=<xsl:value-of select='$collName'/>&cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>185 <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&rt=r&s=<xsl:value-of select='$serviceName'/>&c=<xsl:value-of select='$collName'/>&cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td> 196 186 </xsl:template> 197 187 --> … … 200 190 <!-- if interleave=true, process all child nodes and documents, else just do nodes --> 201 191 202 203 192 <xsl:template match="classifierNode" mode="process-all-children"> 204 <xsl:param name="collName" >coll-name</xsl:param>205 <xsl:param name="serviceName" >service-name</xsl:param>193 <xsl:param name="collName"/> 194 <xsl:param name="serviceName"/> 206 195 <td><p/> 207 <!-- only do this if there are children --> 208 <xsl:if test="classifierNode|documentNode"> 209 <xsl:choose> 210 <xsl:when test='@orientation="vertical"'> 211 <table> 212 <xsl:for-each select='classifierNode|documentNode'> 213 <tr valign='top'><xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates></tr> 214 <xsl:if test='name()="classifierNode"'> 215 <tr valign='top'><td><xsl:text> </xsl:text></td><xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/></xsl:apply-templates></tr> 216 </xsl:if> 217 </xsl:for-each> 218 </table> 219 </xsl:when> 220 <xsl:otherwise> <!-- horizontal --> 221 <table> 222 <tr valign='top'> 196 <!-- only do this if there are children --> 197 <xsl:if test="classifierNode|documentNode"> 198 <xsl:choose> 199 <xsl:when test='@orientation="vertical"'> 200 <table> 223 201 <xsl:for-each select='classifierNode|documentNode'> 224 < xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>202 <tr valign='top'><xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates></tr> 225 203 <xsl:if test='name()="classifierNode"'> 226 < xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>227 </xsl:if> 204 <tr valign='top'><td><xsl:text> </xsl:text></td><xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/></xsl:apply-templates></tr> 205 </xsl:if> 228 206 </xsl:for-each> 229 </tr> 230 </table> 231 </xsl:otherwise> 232 </xsl:choose> 233 </xsl:if> 207 </table> 208 </xsl:when> 209 <xsl:otherwise> <!-- horizontal --> 210 <table> 211 <tr valign='top'> 212 <xsl:for-each select='classifierNode|documentNode'> 213 <xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates> 214 <xsl:if test='name()="classifierNode"'> 215 <xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates> 216 </xsl:if> 217 </xsl:for-each> 218 </tr> 219 </table> 220 </xsl:otherwise> 221 </xsl:choose> 222 </xsl:if> 234 223 </td> 235 224 </xsl:template> 236 225 237 226 <xsl:template match="classifierNode" mode="process-node-children"> 238 <xsl:param name="collName" >coll-name</xsl:param>239 <xsl:param name="serviceName" >ClassifierBrowse</xsl:param>227 <xsl:param name="collName"/> 228 <xsl:param name="serviceName"/> 240 229 <td><p/> 241 230 <xsl:if test='classifierNode'><!-- only do this if there are child nodes - netscape craps out at an empty table like <table /> -->
Note:
See TracChangeset
for help on using the changeset viewer.