[19860] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <xsl:stylesheet version="1.0"
|
---|
[24115] | 3 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 4 | xmlns:xslt="output.xsl"
|
---|
| 5 | xmlns:java="http://xml.apache.org/xslt/java"
|
---|
| 6 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
| 7 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
| 8 | extension-element-prefixes="java">
|
---|
[24458] | 9 | <xsl:param name="interface_name"/>
|
---|
| 10 | <xsl:param name="library_name"/>
|
---|
[26326] | 11 | <xsl:param name="site_name"/>
|
---|
| 12 | <xsl:param name="collName"/>
|
---|
[26460] | 13 |
|
---|
[24115] | 14 | <xsl:output method="xml"/>
|
---|
| 15 | <xsl:namespace-alias stylesheet-prefix="xslt" result-prefix="xsl"/>
|
---|
[19860] | 16 |
|
---|
[24115] | 17 | <xsl:template match="format">
|
---|
| 18 | <format>
|
---|
| 19 | <xsl:apply-templates/>
|
---|
| 20 | </format>
|
---|
| 21 | </xsl:template>
|
---|
[26460] | 22 |
|
---|
[24115] | 23 | <xsl:template match="gsf:template">
|
---|
| 24 | <xslt:template>
|
---|
| 25 | <xsl:copy-of select="@*"/>
|
---|
| 26 | <xsl:attribute name="priority">2</xsl:attribute>
|
---|
| 27 | <xsl:if test=".//gsf:link">
|
---|
| 28 | <xslt:param name="serviceName"/>
|
---|
| 29 | <xslt:param name="collName"/>
|
---|
| 30 | </xsl:if>
|
---|
| 31 | <xsl:apply-templates/>
|
---|
| 32 | </xslt:template>
|
---|
| 33 | </xsl:template>
|
---|
[26460] | 34 |
|
---|
[24458] | 35 | <xsl:template match="gsf:variable">
|
---|
| 36 | <xslt:variable>
|
---|
| 37 | <xsl:copy-of select="@*"/>
|
---|
| 38 | <xsl:apply-templates/>
|
---|
| 39 | </xslt:variable>
|
---|
| 40 | <script type="text/javascript">
|
---|
[26500] | 41 | gs.variables.<xsl:value-of select="@name"/>
|
---|
| 42 | <xslt:text disable-output-escaping="yes"> = "</xslt:text>
|
---|
| 43 | <xsl:apply-templates/>
|
---|
[26460] | 44 | <xslt:text disable-output-escaping="yes">";</xslt:text>
|
---|
[24458] | 45 | </script>
|
---|
| 46 | </xsl:template>
|
---|
[26460] | 47 |
|
---|
[24792] | 48 | <xsl:template match="gsf:defaultClassifierNode">
|
---|
| 49 | <xslt:call-template name="defaultClassifierNode"/>
|
---|
| 50 | </xsl:template>
|
---|
[25002] | 51 |
|
---|
[26439] | 52 |
|
---|
| 53 | <xsl:template match="gsf:script[@src]">
|
---|
[26460] | 54 | <script>
|
---|
| 55 | <xsl:attribute name='src'>
|
---|
| 56 | <xsl:value-of select="@src"/>
|
---|
| 57 | </xsl:attribute>
|
---|
| 58 | <xslt:attribute name='type'>text/javascript</xslt:attribute>
|
---|
| 59 | <xslt:comment/>
|
---|
| 60 | <!-- comment used to ensure script tag is not collapsed -->
|
---|
| 61 | </script>
|
---|
[26439] | 62 | </xsl:template>
|
---|
| 63 |
|
---|
| 64 |
|
---|
| 65 | <xsl:template match="gsf:script">
|
---|
[26460] | 66 | <script type="text/javascript">
|
---|
| 67 | <xslt:text disable-output-escaping="yes">
|
---|
| 68 | <xsl:apply-templates/>
|
---|
| 69 | </xslt:text>
|
---|
| 70 | </script>
|
---|
[26439] | 71 | </xsl:template>
|
---|
| 72 |
|
---|
| 73 | <xsl:template match="gsf:style[@src]">
|
---|
[26460] | 74 | <link rel="stylesheet" type="text/css">
|
---|
| 75 | <xsl:attribute name='href'>
|
---|
| 76 | <xsl:value-of select="@src"/>
|
---|
| 77 | </xsl:attribute>
|
---|
| 78 | </link>
|
---|
[26439] | 79 | </xsl:template>
|
---|
| 80 |
|
---|
| 81 | <xsl:template match="gsf:style">
|
---|
[26460] | 82 | <style type="text/css">
|
---|
| 83 | <xsl:apply-templates/>
|
---|
| 84 | </style>
|
---|
[26439] | 85 | </xsl:template>
|
---|
| 86 |
|
---|
| 87 |
|
---|
[25002] | 88 | <xsl:template match="gsf:image">
|
---|
[26022] | 89 | <xslt:variable name="metaName">
|
---|
[26020] | 90 | <xsl:choose>
|
---|
| 91 | <xsl:when test="@type = 'thumb'">Thumb</xsl:when>
|
---|
| 92 | <xsl:when test="@type = 'screen'">Screen</xsl:when>
|
---|
| 93 | <xsl:when test="@type = 'source'">SourceFile</xsl:when>
|
---|
| 94 | </xsl:choose>
|
---|
[26022] | 95 | </xslt:variable>
|
---|
| 96 | <xslt:if test="(.//metadataList)[last()]/metadata[@name = $metaName]">
|
---|
[26020] | 97 | <img>
|
---|
| 98 | <xslt:attribute name='src'>
|
---|
| 99 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name = 'httpPath']"/>
|
---|
| 100 | <xsl:text>/index/assoc/</xsl:text>
|
---|
| 101 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>
|
---|
| 102 | <xsl:text>/</xsl:text>
|
---|
[26022] | 103 | <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $metaName]"/>
|
---|
[26020] | 104 | </xslt:attribute>
|
---|
| 105 | </img>
|
---|
[26022] | 106 | </xslt:if>
|
---|
[25002] | 107 | </xsl:template>
|
---|
| 108 |
|
---|
[26500] | 109 | <xsl:template match="params"></xsl:template>
|
---|
| 110 |
|
---|
[24115] | 111 | <xsl:template match="gsf:link">
|
---|
[26467] | 112 |
|
---|
[26460] | 113 | <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
|
---|
| 114 | <xsl:variable name="opt-title">
|
---|
| 115 | <xsl:choose>
|
---|
[26467] | 116 | <xsl:when test="@title">
|
---|
| 117 | <xslt:attribute name="title">
|
---|
| 118 | <xsl:value-of select="@title"/>
|
---|
| 119 | </xslt:attribute>
|
---|
[26460] | 120 | </xsl:when>
|
---|
[26467] | 121 | <xsl:when test="@titlekey">
|
---|
| 122 | <xslt:attribute name="title">
|
---|
| 123 | <xslt:value-of disable-output-escaping="yes" select="util:getCollectionText($collName, $site_name, /page/@lang, '{@titlekey}')"/>
|
---|
| 124 | </xslt:attribute>
|
---|
[26460] | 125 | </xsl:when>
|
---|
| 126 | </xsl:choose>
|
---|
| 127 | </xsl:variable>
|
---|
[26467] | 128 |
|
---|
[24115] | 129 | <xsl:choose>
|
---|
[26326] | 130 | <xsl:when test="@type='query'">
|
---|
| 131 | <a>
|
---|
[26504] | 132 | <xsl:if test="@target">
|
---|
| 133 | <xsl:attribute name='target'>
|
---|
| 134 | <xsl:value-of select='@target'/>
|
---|
| 135 | </xsl:attribute>
|
---|
| 136 | </xsl:if>
|
---|
| 137 |
|
---|
[26326] | 138 | <xslt:attribute name='href'>
|
---|
| 139 | <xslt:value-of select='$library_name'/>
|
---|
| 140 | <xsl:text>/collection/</xsl:text>
|
---|
| 141 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
| 142 | <xsl:text>/search/</xsl:text>
|
---|
| 143 | <xsl:choose>
|
---|
| 144 | <xsl:when test="@name">
|
---|
| 145 | <xsl:value-of select="@name"/>
|
---|
| 146 | </xsl:when>
|
---|
| 147 | <xsl:otherwise>
|
---|
| 148 | <xsl:text>TextQuery</xsl:text>
|
---|
| 149 | </xsl:otherwise>
|
---|
| 150 | </xsl:choose>
|
---|
[26467] | 151 | <xsl:if test="params">?rt=rd&<xsl:copy-of select="params/node()"/></xsl:if>
|
---|
[26326] | 152 | </xslt:attribute>
|
---|
[26460] | 153 | <xsl:copy-of select="$opt-title"/>
|
---|
[26326] | 154 | <xsl:apply-templates/>
|
---|
| 155 | </a>
|
---|
| 156 | </xsl:when>
|
---|
[24115] | 157 | <xsl:when test="@type='classifier'">
|
---|
| 158 | <a>
|
---|
[26504] | 159 | <xsl:if test="@target">
|
---|
| 160 | <xsl:attribute name='target'>
|
---|
| 161 | <xsl:value-of select='@target'/>
|
---|
| 162 | </xsl:attribute>
|
---|
| 163 | </xsl:if>
|
---|
| 164 |
|
---|
[24115] | 165 | <xslt:attribute name='href'>
|
---|
| 166 | <xslt:value-of select='$library_name'/>
|
---|
[25438] | 167 | <xsl:text>/collection/</xsl:text>
|
---|
[24115] | 168 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
[25438] | 169 | <xsl:text>/browse/</xsl:text>
|
---|
[26326] | 170 | <xsl:choose>
|
---|
| 171 | <xsl:when test="@nodeID">
|
---|
| 172 | <xsl:value-of select="@nodeID"/>
|
---|
| 173 | </xsl:when>
|
---|
| 174 | <xsl:otherwise>
|
---|
| 175 | <xslt:value-of select='util:replace(@nodeID, ".", "/")'/>
|
---|
| 176 | </xsl:otherwise>
|
---|
| 177 | </xsl:choose>
|
---|
[24115] | 178 | </xslt:attribute>
|
---|
[26460] | 179 | <xsl:copy-of select="$opt-title"/>
|
---|
[24115] | 180 | <xsl:apply-templates/>
|
---|
| 181 | </a>
|
---|
| 182 | </xsl:when>
|
---|
[24127] | 183 | <xsl:when test="@type='source'">
|
---|
[26504] | 184 | <a>
|
---|
| 185 | <xsl:if test="@target">
|
---|
| 186 | <xsl:attribute name='target'>
|
---|
| 187 | <xsl:value-of select='@target'/>
|
---|
| 188 | </xsl:attribute>
|
---|
| 189 | </xsl:if>
|
---|
| 190 |
|
---|
[26460] | 191 | <xslt:attribute name='href'>
|
---|
| 192 | <xslt:value-of
|
---|
[24127] | 193 | disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']" />/index/assoc/<xslt:value-of
|
---|
[25177] | 194 | disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='assocfilepath']" />/<xslt:value-of
|
---|
[26460] | 195 | disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='srclinkFile']" />
|
---|
| 196 | </xslt:attribute>
|
---|
| 197 | <xsl:copy-of select="$opt-title"/>
|
---|
| 198 | <xsl:apply-templates/>
|
---|
[24127] | 199 | </a>
|
---|
| 200 | </xsl:when>
|
---|
[26043] | 201 | <xsl:when test="@type='web'">
|
---|
[26460] | 202 | <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, 'weblink')]"/>
|
---|
| 203 | <xsl:apply-templates/>
|
---|
| 204 | <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, '/weblink')]"/>
|
---|
[26043] | 205 | </xsl:when>
|
---|
[26326] | 206 | <xsl:when test="@type='page'">
|
---|
[26317] | 207 | <a>
|
---|
[26504] | 208 | <xsl:if test="@target">
|
---|
| 209 | <xsl:attribute name='target'>
|
---|
| 210 | <xsl:value-of select='@target'/>
|
---|
| 211 | </xsl:attribute>
|
---|
| 212 | </xsl:if>
|
---|
| 213 |
|
---|
[26317] | 214 | <xslt:attribute name='href'>
|
---|
| 215 | <xslt:value-of select='$library_name'/>
|
---|
| 216 | <xsl:text>/collection/</xsl:text>
|
---|
[26326] | 217 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
| 218 | <xsl:text>/page/</xsl:text>
|
---|
| 219 | <xsl:value-of select="@page"/>
|
---|
| 220 | </xslt:attribute>
|
---|
[26460] | 221 | <xsl:copy-of select="$opt-title"/>
|
---|
| 222 | <xsl:apply-templates/>
|
---|
[26317] | 223 | </a>
|
---|
[26326] | 224 | </xsl:when>
|
---|
[26043] | 225 | <xsl:when test="@type='equivdoc'">
|
---|
[26460] | 226 | <xsl:call-template name="gsf:equivlinkgs3"/>
|
---|
[26043] | 227 | </xsl:when>
|
---|
[27101] | 228 | <xsl:when test="@type='rss'">
|
---|
| 229 | <a>
|
---|
| 230 | <xslt:attribute name='href'>
|
---|
| 231 | <xslt:value-of select='$library_name'/>
|
---|
| 232 | <xsl:text>?a=rss&l=en&site=</xsl:text>
|
---|
| 233 | <xslt:value-of select="$site_name"/>
|
---|
| 234 | <xsl:text>&c=</xsl:text>
|
---|
| 235 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
| 236 | </xslt:attribute>
|
---|
| 237 | <xsl:apply-templates/>
|
---|
| 238 | </a>
|
---|
| 239 | </xsl:when>
|
---|
[26460] | 240 | <xsl:otherwise>
|
---|
| 241 | <!-- a document link -->
|
---|
[24115] | 242 | <xslt:variable name="bookswitch">
|
---|
| 243 | <xslt:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
| 244 | </xslt:variable>
|
---|
[25361] | 245 | <a>
|
---|
[26504] | 246 | <xsl:if test="@target">
|
---|
| 247 | <xsl:attribute name='target'>
|
---|
| 248 | <xsl:value-of select='@target'/>
|
---|
| 249 | </xsl:attribute>
|
---|
| 250 | </xsl:if>
|
---|
| 251 |
|
---|
[26460] | 252 | <xsl:copy-of select="$opt-title"/>
|
---|
[25361] | 253 | <xslt:attribute name="href">
|
---|
| 254 | <xslt:value-of select='$library_name'/>
|
---|
| 255 | <xsl:text>/collection/</xsl:text>
|
---|
| 256 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
| 257 | <xsl:text>/document/</xsl:text>
|
---|
[26460] | 258 | <xsl:choose>
|
---|
| 259 | <xsl:when test="@OID">
|
---|
| 260 | <xsl:value-of select="@OID"/>
|
---|
| 261 | </xsl:when>
|
---|
| 262 | <xsl:when test="@OIDmetadata">
|
---|
| 263 | <xsl:variable name="OIDmeta" select="@OIDmetadata"/>
|
---|
| 264 | <xslt:value-of select="(.//metadataList)[last()]/metadata[@name='{$OIDmeta}']"/>
|
---|
| 265 | </xsl:when>
|
---|
| 266 | <xsl:otherwise>
|
---|
| 267 | <xslt:value-of select='@nodeID'/>
|
---|
| 268 | </xsl:otherwise>
|
---|
| 269 | </xsl:choose>
|
---|
[25919] | 270 | <xslt:choose>
|
---|
| 271 | <xslt:when test="$bookswitch = 'on' or $bookswitch = 'flashxml'">
|
---|
| 272 | <xsl:text>?book=on</xsl:text>
|
---|
| 273 | </xslt:when>
|
---|
| 274 | <xslt:otherwise>
|
---|
[26460] | 275 | <xslt:if test="$opt-doc-link-args">?<xslt:value-of select="$opt-doc-link-args"/>
|
---|
| 276 | </xslt:if>
|
---|
[25919] | 277 | </xslt:otherwise>
|
---|
| 278 | </xslt:choose>
|
---|
[25361] | 279 | </xslt:attribute>
|
---|
| 280 | <xsl:apply-templates/>
|
---|
| 281 | </a>
|
---|
[24115] | 282 | </xsl:otherwise>
|
---|
| 283 | </xsl:choose>
|
---|
| 284 | </xsl:template>
|
---|
[19860] | 285 |
|
---|
[24115] | 286 | <xsl:template match="gsf:icon">
|
---|
| 287 | <xsl:choose>
|
---|
| 288 | <xsl:when test="@type='classifier'">
|
---|
[26460] | 289 | <img style="border:0px">
|
---|
| 290 | <xsl:attribute name="src">
|
---|
| 291 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/>
|
---|
| 292 | </xsl:attribute>
|
---|
| 293 | </img>
|
---|
[24115] | 294 | </xsl:when>
|
---|
[26043] | 295 | <xsl:when test="@type='web'">
|
---|
[26460] | 296 | <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, 'webicon')]"/>
|
---|
[26043] | 297 | </xsl:when>
|
---|
[26121] | 298 | <xsl:when test="@file">
|
---|
[26460] | 299 | <img>
|
---|
| 300 | <xslt:attribute name='src'>
|
---|
| 301 | <xsl:choose>
|
---|
| 302 | <xsl:when test="not(@select) or @select='site'">
|
---|
| 303 | <xsl:value-of disable-output-escaping="yes" select="concat('interfaces/',$interface_name,'/images/',@file)"/>
|
---|
| 304 | </xsl:when>
|
---|
| 305 | <xsl:when test="@select='collection'">
|
---|
| 306 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
|
---|
| 307 | <xsl:value-of disable-output-escaping="yes" select="concat('/images/',@file)"/>
|
---|
| 308 | </xsl:when>
|
---|
| 309 | </xsl:choose>
|
---|
| 310 | </xslt:attribute>
|
---|
| 311 | </img>
|
---|
[26121] | 312 | </xsl:when>
|
---|
[25361] | 313 | <xsl:when test="not(@type) or @type='document'">
|
---|
[26460] | 314 | <img style="border:0px">
|
---|
| 315 | <xslt:attribute name="id">documentBasketBook<xslt:value-of select="/page/pageResponse/collection/@name"/>:<xslt:value-of select="@nodeID"/>
|
---|
| 316 | </xslt:attribute>
|
---|
| 317 | <xslt:attribute name="src">
|
---|
| 318 | <xslt:choose>
|
---|
| 319 | <xslt:when test="@docType='hierarchy' and @nodeType='root'">
|
---|
| 320 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'book_image')"/>
|
---|
| 321 | </xslt:when>
|
---|
| 322 | <xslt:otherwise>
|
---|
| 323 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_icon_image')"/>
|
---|
| 324 | </xslt:otherwise>
|
---|
| 325 | </xslt:choose>
|
---|
| 326 | </xslt:attribute>
|
---|
| 327 | </img>
|
---|
[24115] | 328 | </xsl:when>
|
---|
| 329 | </xsl:choose>
|
---|
| 330 | </xsl:template>
|
---|
[26460] | 331 |
|
---|
| 332 | <!-- calls a template in gslib.xsl in order to avoid xsl vs xslt issue -->
|
---|
| 333 | <!--<xsl:template match="gsf:equivlinkgs3">
|
---|
[26023] | 334 | <xslt:call-template name="equivDocLinks">
|
---|
| 335 | <xslt:with-param name="count" select="0"/>
|
---|
| 336 | </xslt:call-template>
|
---|
[26031] | 337 | </xsl:template>-->
|
---|
[26023] | 338 |
|
---|
[26460] | 339 | <!-- Another way (also works with DSpace tutorial): build all the equivalent document links for the current document in one go. No looping necessary: handled in function call. -->
|
---|
| 340 | <xsl:template match="gsf:equivlinkgs3" name="gsf:equivlinkgs3">
|
---|
| 341 | <xslt:variable name="docicon" select="metadataList/metadata[contains(@name, 'equivDocIcon')]"/>
|
---|
| 342 | <xslt:variable name="docStartlink" select="metadataList/metadata[contains(@name, 'all_*,*_equivDocLink')]"/>
|
---|
| 343 | <xslt:variable name="docEndlink" select="metadataList/metadata[contains(@name, '/equivDocLink')]"/>
|
---|
[26023] | 344 |
|
---|
[26460] | 345 | <xslt:variable name="equivDocLinks" select="java:org.greenstone.gsdl3.util.XSLTUtil.getEquivDocLinks(',',$docicon, $docStartlink, $docEndlink, ' ')" />
|
---|
| 346 | <xslt:value-of disable-output-escaping="yes" select="$equivDocLinks"/>
|
---|
| 347 | </xsl:template>
|
---|
[26023] | 348 |
|
---|
[26460] | 349 | <!--
|
---|
[26023] | 350 | In the collection's format statement, could have the following javascript+XSLT in place of
|
---|
| 351 | the gsf:equivlinkgs3 element (which resolves to the XSLT in config_format.xsl and gslib.xsl).
|
---|
| 352 | <xsl:text disable-output-escaping="yes"><script>var equivDocIcon= [ "
|
---|
| 353 | </xsl:text>
|
---|
| 354 | <gsf:metadata name="equivDocIcon" separator="", "" multiple="true"/>
|
---|
| 355 | <xsl:text disable-output-escaping="yes">"];var equivDocStartLink= [ "
|
---|
| 356 | </xsl:text>
|
---|
| 357 | <gsf:metadata name="equivDocLink" separator="","" multiple="true"/>
|
---|
| 358 | <xsl:text disable-output-escaping="yes">"];var equivDocEndLink= [ "
|
---|
| 359 | </xsl:text>
|
---|
| 360 | <gsf:metadata name="/equivDocLink" separator="","" multiple="true"/>
|
---|
| 361 | <xsl:text disable-output-escaping="yes">"];for (var i=0; i<equivDocIcon.length; i++) { document.write(equivDocStartLink[i]+ equivDocIcon[i] + equivDocEndLink[i]); }</script>
|
---|
| 362 | </xsl:text>
|
---|
| 363 | -->
|
---|
| 364 |
|
---|
[25941] | 365 | <!-- gsf:cgiparam example, as used by the Enhanced PDF tutorial:
|
---|
| 366 | <a><xsl:attribute name="href"><gsf:metadata name="httpPath" type="collection"/>/index/assoc/<gsf:metadata name="archivedir"/>/<gsf:metadata name="srclinkFile"/>#search=&quot;<gsf:cgi-param name="query"/>&quot;</xsl:attribute>src doc link with query highlighting</a> -->
|
---|
| 367 | <xsl:template match="gsf:cgi-param">
|
---|
| 368 | <xslt:value-of disable-output-escaping="yes" select="/page/pageRequest/paramList/param[@name='s1.{@name}']/@value"/>
|
---|
| 369 | </xsl:template>
|
---|
[24359] | 370 |
|
---|
[25752] | 371 | <!-- A GLI user can use a gsf:displayText element in GS3's Format Features to retrieve
|
---|
| 372 | a string defined in either collectionConfig.xml or else the interface dictionaries.
|
---|
| 373 | If the requested string occurs in neither, the request string itself will be output. -->
|
---|
[25732] | 374 | <xsl:template match="gsf:displayText">
|
---|
[26460] | 375 | <xslt:variable name="displaytext">
|
---|
| 376 | <xsl:call-template name="gsf:displayItem"/>
|
---|
| 377 | </xslt:variable>
|
---|
[25752] | 378 |
|
---|
[26460] | 379 | <xslt:choose>
|
---|
| 380 | <xslt:when test="$displaytext != ''">
|
---|
| 381 | <xslt:value-of disable-output-escaping="yes" select="$displaytext"/>
|
---|
| 382 | </xslt:when>
|
---|
| 383 | <xslt:otherwise>
|
---|
| 384 | <xslt:variable name="interfacetxt">
|
---|
| 385 | <xsl:call-template name="gsf:interfaceText"/>
|
---|
| 386 | </xslt:variable>
|
---|
[25752] | 387 |
|
---|
[26460] | 388 | <xslt:choose>
|
---|
| 389 | <xslt:when test="$interfacetxt != ''">
|
---|
| 390 | <xslt:value-of disable-output-escaping="yes" select="$interfacetxt"/>
|
---|
| 391 | </xslt:when>
|
---|
| 392 | <xslt:otherwise>
|
---|
| 393 | <xslt:value-of disable-output-escaping="yes" select="'{@name}'"/>
|
---|
| 394 | </xslt:otherwise>
|
---|
| 395 | </xslt:choose>
|
---|
| 396 | </xslt:otherwise>
|
---|
| 397 | </xslt:choose>
|
---|
[25752] | 398 | </xsl:template>
|
---|
| 399 |
|
---|
| 400 | <!-- With gsf:displayItem, a user can request a displayItem from collectionConfig.xml -->
|
---|
| 401 | <xsl:template match="gsf:displayItem" name="gsf:displayItem">
|
---|
[26460] | 402 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItem[@name='{@name}']"/>
|
---|
[25732] | 403 | </xsl:template>
|
---|
| 404 |
|
---|
[25752] | 405 | <!-- With gsf:interfaceText, a user can request a string from the interface dictionaries in the current lang -->
|
---|
| 406 | <xsl:template match="gsf:interfaceText" name="gsf:interfaceText">
|
---|
[26460] | 407 | <xslt:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, '{@name}')"/>
|
---|
[25732] | 408 | </xsl:template>
|
---|
[26250] | 409 | <!-- With gsf:collectionText, a user can request a string from the collection's dictionary in the current lang -->
|
---|
| 410 | <xsl:template match="gsf:collectionText" name="gsf:collectionText">
|
---|
[26460] | 411 | <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
|
---|
[26387] | 412 | <xslt:copy-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')/node()"/>
|
---|
[26250] | 413 | </xsl:template>
|
---|
[25732] | 414 |
|
---|
[24792] | 415 | <!-- if this gsf:metadata is a child of a document node then we want to get the metadata for that node -->
|
---|
[26176] | 416 | <xsl:template match="gsf:metadata">
|
---|
| 417 | <xsl:if test="not(@hidden = 'true')">
|
---|
| 418 | <!-- set hidden=true on a gsf:metadata so that it gets retrieved from the server but not displayed -->
|
---|
[26460] | 419 | <xsl:variable name="meta_name">
|
---|
| 420 | <xsl:call-template name="getMetadataName"/>
|
---|
| 421 | </xsl:variable>
|
---|
[26176] | 422 | <xsl:variable name="separator">
|
---|
| 423 | <xsl:choose>
|
---|
[26460] | 424 | <xsl:when test="@separator">
|
---|
| 425 | <xsl:value-of disable-output-escaping='yes' select="@separator"/>
|
---|
| 426 | </xsl:when>
|
---|
| 427 | <xsl:when test="separator">
|
---|
| 428 | <xsl:copy-of select="separator/node()"/>
|
---|
| 429 | </xsl:when>
|
---|
| 430 | <xsl:otherwise>
|
---|
| 431 | <xsl:text>, </xsl:text>
|
---|
| 432 | </xsl:otherwise>
|
---|
[26176] | 433 | </xsl:choose>
|
---|
| 434 | </xsl:variable>
|
---|
| 435 | <xsl:variable name="prefix">
|
---|
| 436 | <xsl:choose>
|
---|
[26460] | 437 | <xsl:when test="@prefix">
|
---|
| 438 | <xsl:value-of disable-output-escaping='yes' select="@prefix"/>
|
---|
| 439 | </xsl:when>
|
---|
| 440 | <xsl:when test="prefix">
|
---|
| 441 | <xsl:copy-of select="prefix/node()"/>
|
---|
| 442 | </xsl:when>
|
---|
[26176] | 443 | </xsl:choose>
|
---|
| 444 | </xsl:variable>
|
---|
| 445 | <xsl:variable name="suffix">
|
---|
| 446 | <xsl:choose>
|
---|
[26460] | 447 | <xsl:when test="@suffix">
|
---|
| 448 | <xsl:value-of disable-output-escaping='yes' select="@suffix"/>
|
---|
| 449 | </xsl:when>
|
---|
| 450 | <xsl:when test="suffix">
|
---|
| 451 | <xsl:copy-of select="suffix/node()"/>
|
---|
| 452 | </xsl:when>
|
---|
[26176] | 453 | </xsl:choose>
|
---|
| 454 | </xsl:variable>
|
---|
| 455 | <xsl:variable name="postest">
|
---|
| 456 | <xsl:choose>
|
---|
| 457 | <xsl:when test="@pos = 'first'">position()=1</xsl:when>
|
---|
| 458 | <xsl:when test="@pos = 'last'">position() = last()</xsl:when>
|
---|
[26460] | 459 | <xsl:when test="@pos">position() = <xsl:value-of select="@pos"/>
|
---|
| 460 | </xsl:when>
|
---|
[26176] | 461 | <xsl:otherwise>true()</xsl:otherwise>
|
---|
| 462 | </xsl:choose>
|
---|
| 463 | </xsl:variable>
|
---|
| 464 | <xsl:variable name="multiple">
|
---|
| 465 | <xsl:choose>
|
---|
| 466 | <xsl:when test="@pos">false()</xsl:when>
|
---|
| 467 | <xsl:otherwise>true()</xsl:otherwise>
|
---|
| 468 | </xsl:choose>
|
---|
| 469 | </xsl:variable>
|
---|
| 470 | <xslt:for-each>
|
---|
| 471 | <xsl:attribute name="select">
|
---|
[26460] | 472 | <xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>(.//metadataList)[last()]/metadata[@name='<xsl:value-of select="$meta_name"/>'<xsl:if test="@lang">
|
---|
| 473 | <xsl:text> and @lang=</xsl:text>
|
---|
| 474 | <xsl:value-of select="@lang"/>
|
---|
| 475 | </xsl:if>
|
---|
| 476 | <xsl:text>]</xsl:text>
|
---|
[26176] | 477 | </xsl:attribute>
|
---|
| 478 | <xslt:if test="{$postest}">
|
---|
[26460] | 479 | <xslt:if test="{$multiple} and position()>1"><xsl:copy-of select="$separator"/>
|
---|
| 480 | </xslt:if>
|
---|
[26176] | 481 | <xsl:copy-of select="$prefix"/>
|
---|
| 482 | <xsl:choose>
|
---|
| 483 | <xsl:when test="@format">
|
---|
| 484 | <xslt:value-of disable-output-escaping='yes' select="util:{@format}(., /page/@lang )"/>
|
---|
| 485 | </xsl:when>
|
---|
| 486 | <xsl:otherwise>
|
---|
| 487 | <xslt:value-of disable-output-escaping='yes' select="."/>
|
---|
| 488 | </xsl:otherwise>
|
---|
| 489 | </xsl:choose>
|
---|
| 490 | </xslt:if>
|
---|
| 491 | <xsl:copy-of select="$suffix"/>
|
---|
| 492 | </xslt:for-each>
|
---|
| 493 | </xsl:if>
|
---|
| 494 | </xsl:template>
|
---|
[26092] | 495 |
|
---|
[26500] | 496 |
|
---|
[26467] | 497 | <xsl:template match="gsf:foreach-metadata">
|
---|
| 498 | <xsl:variable name="meta_name"><xsl:call-template name="getMetadataName"/></xsl:variable>
|
---|
| 499 | <xslt:for-each>
|
---|
| 500 | <xsl:attribute name="select">
|
---|
| 501 | <xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>(.//metadataList)[last()]/metadata[@name='<xsl:value-of select="$meta_name"/>'<xsl:if test="@lang"><xsl:text> and @lang=</xsl:text><xsl:value-of select="@lang"/></xsl:if><xsl:text>]</xsl:text>
|
---|
| 502 | </xsl:attribute><xsl:if test='@separator'><xslt:if test='position()>1'><xsl:value-of select='@separator'/></xslt:if></xsl:if>
|
---|
| 503 | <xsl:apply-templates/>
|
---|
| 504 | </xslt:for-each>
|
---|
| 505 | </xsl:template>
|
---|
| 506 |
|
---|
| 507 | <xsl:template match="gsf:meta-value">
|
---|
| 508 | <xslt:value-of select="."/>
|
---|
| 509 | </xsl:template>
|
---|
[26092] | 510 |
|
---|
[26500] | 511 | <xsl:template name="getMetadataName">
|
---|
| 512 | <xsl:if test='@select'>
|
---|
| 513 | <xsl:value-of select='@select'/>
|
---|
| 514 | <xsl:text>_</xsl:text>
|
---|
| 515 | </xsl:if>
|
---|
| 516 | <xsl:value-of select="@name"/>
|
---|
| 517 | </xsl:template>
|
---|
[26467] | 518 |
|
---|
[26500] | 519 |
|
---|
[24115] | 520 | <xsl:template match="gsf:text">
|
---|
[26020] | 521 | <xslt:call-template name="documentNodeText"/>
|
---|
[24115] | 522 | </xsl:template>
|
---|
[26387] | 523 |
|
---|
[26460] | 524 | <xsl:template match="gsf:if-metadata-exists">
|
---|
| 525 | <xsl:variable name="meta-path">
|
---|
| 526 | <xsl:for-each select="gsf:metadata">(.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:for-each>
|
---|
| 527 | </xsl:variable>
|
---|
| 528 | <xslt:choose>
|
---|
| 529 | <xslt:when test="{$meta-path}">
|
---|
| 530 | <xsl:apply-templates select="gsf:if/node()"/>
|
---|
| 531 | </xslt:when>
|
---|
| 532 | <xsl:if test="gsf:else">
|
---|
| 533 | <xslt:otherwise>
|
---|
| 534 | <xsl:apply-templates select="gsf:else/node()"/>
|
---|
| 535 | </xslt:otherwise>
|
---|
| 536 | </xsl:if>
|
---|
| 537 | </xslt:choose>
|
---|
| 538 | </xsl:template>
|
---|
| 539 |
|
---|
[24792] | 540 | <xsl:template match="gsf:choose-metadata">
|
---|
| 541 | <xslt:choose>
|
---|
| 542 | <xsl:for-each select="gsf:metadata">
|
---|
| 543 | <xslt:when>
|
---|
[26093] | 544 | <xsl:attribute name="test">(.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:attribute>
|
---|
[24792] | 545 | <xsl:apply-templates select="."/>
|
---|
| 546 | </xslt:when>
|
---|
| 547 | </xsl:for-each>
|
---|
| 548 | <xsl:if test="gsf:default">
|
---|
[26460] | 549 | <xslt:otherwise>
|
---|
| 550 | <xsl:apply-templates select="gsf:default"/>
|
---|
| 551 | </xslt:otherwise>
|
---|
[24792] | 552 | </xsl:if>
|
---|
| 553 | </xslt:choose>
|
---|
| 554 | </xsl:template>
|
---|
[26460] | 555 |
|
---|
[24115] | 556 | <xsl:template match="gsf:switch">
|
---|
[26460] | 557 | <xsl:variable name="meta-name">
|
---|
| 558 | <xsl:for-each select="gsf:metadata">
|
---|
| 559 | <xsl:call-template name="getMetadataName"/>
|
---|
| 560 | </xsl:for-each>
|
---|
| 561 | </xsl:variable>
|
---|
| 562 | <xslt:variable name="meta">
|
---|
| 563 | <xsl:choose>
|
---|
| 564 | <xsl:when test="@preprocess">
|
---|
| 565 | <xslt:value-of select="util:{@preprocess}((.//metadataList)[last()]/metadata[@name='{$meta-name}'], /page/@lang )"/>
|
---|
| 566 | </xsl:when>
|
---|
| 567 | <xsl:otherwise>
|
---|
| 568 | <xslt:value-of select="(.//metadataList)[last()]/metadata[@name='{$meta-name}']"/>
|
---|
| 569 | </xsl:otherwise>
|
---|
| 570 | </xsl:choose>
|
---|
| 571 | </xslt:variable>
|
---|
[24115] | 572 | <xslt:choose>
|
---|
| 573 | <xsl:for-each select="gsf:when">
|
---|
| 574 | <xslt:when test="util:{@test}($meta, '{@test-value}')">
|
---|
| 575 | <xsl:apply-templates/>
|
---|
| 576 | </xslt:when>
|
---|
| 577 | </xsl:for-each>
|
---|
| 578 | <xsl:if test="gsf:otherwise">
|
---|
| 579 | <xslt:otherwise>
|
---|
| 580 | <xsl:apply-templates select="gsf:otherwise/node()"/>
|
---|
| 581 | </xslt:otherwise>
|
---|
| 582 | </xsl:if>
|
---|
| 583 | </xslt:choose>
|
---|
| 584 | </xsl:template>
|
---|
[26460] | 585 |
|
---|
[26500] | 586 | <!--
|
---|
| 587 | <gsf:headMetaTags> exists for controlling the <meta name="x" content="y"> elements that appear in the HTML <head></head>
|
---|
| 588 | XPATH is used to select this item (in header.xsl). It does not need an explicit definition here in this file
|
---|
| 589 | -->
|
---|
| 590 |
|
---|
[24115] | 591 | <xsl:template match="*">
|
---|
| 592 | <xsl:copy>
|
---|
[26460] | 593 | <xsl:copy-of select="@*"/>
|
---|
[24115] | 594 | <xsl:apply-templates/>
|
---|
| 595 | </xsl:copy>
|
---|
| 596 | </xsl:template>
|
---|
[19860] | 597 |
|
---|
| 598 | </xsl:stylesheet>
|
---|
| 599 |
|
---|
| 600 |
|
---|