[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>
|
---|
[26460] | 228 | <xsl:otherwise>
|
---|
| 229 | <!-- a document link -->
|
---|
[24115] | 230 | <xslt:variable name="bookswitch">
|
---|
| 231 | <xslt:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/>
|
---|
| 232 | </xslt:variable>
|
---|
[25361] | 233 | <a>
|
---|
[26504] | 234 | <xsl:if test="@target">
|
---|
| 235 | <xsl:attribute name='target'>
|
---|
| 236 | <xsl:value-of select='@target'/>
|
---|
| 237 | </xsl:attribute>
|
---|
| 238 | </xsl:if>
|
---|
| 239 |
|
---|
[26460] | 240 | <xsl:copy-of select="$opt-title"/>
|
---|
[25361] | 241 | <xslt:attribute name="href">
|
---|
| 242 | <xslt:value-of select='$library_name'/>
|
---|
| 243 | <xsl:text>/collection/</xsl:text>
|
---|
| 244 | <xslt:value-of select='/page/pageResponse/collection/@name'/>
|
---|
| 245 | <xsl:text>/document/</xsl:text>
|
---|
[26460] | 246 | <xsl:choose>
|
---|
| 247 | <xsl:when test="@OID">
|
---|
| 248 | <xsl:value-of select="@OID"/>
|
---|
| 249 | </xsl:when>
|
---|
| 250 | <xsl:when test="@OIDmetadata">
|
---|
| 251 | <xsl:variable name="OIDmeta" select="@OIDmetadata"/>
|
---|
| 252 | <xslt:value-of select="(.//metadataList)[last()]/metadata[@name='{$OIDmeta}']"/>
|
---|
| 253 | </xsl:when>
|
---|
| 254 | <xsl:otherwise>
|
---|
| 255 | <xslt:value-of select='@nodeID'/>
|
---|
| 256 | </xsl:otherwise>
|
---|
| 257 | </xsl:choose>
|
---|
[25919] | 258 | <xslt:choose>
|
---|
| 259 | <xslt:when test="$bookswitch = 'on' or $bookswitch = 'flashxml'">
|
---|
| 260 | <xsl:text>?book=on</xsl:text>
|
---|
| 261 | </xslt:when>
|
---|
| 262 | <xslt:otherwise>
|
---|
[26460] | 263 | <xslt:if test="$opt-doc-link-args">?<xslt:value-of select="$opt-doc-link-args"/>
|
---|
| 264 | </xslt:if>
|
---|
[25919] | 265 | </xslt:otherwise>
|
---|
| 266 | </xslt:choose>
|
---|
[25361] | 267 | </xslt:attribute>
|
---|
| 268 | <xsl:apply-templates/>
|
---|
| 269 | </a>
|
---|
[24115] | 270 | </xsl:otherwise>
|
---|
| 271 | </xsl:choose>
|
---|
| 272 | </xsl:template>
|
---|
[19860] | 273 |
|
---|
[24115] | 274 | <xsl:template match="gsf:icon">
|
---|
| 275 | <xsl:choose>
|
---|
| 276 | <xsl:when test="@type='classifier'">
|
---|
[26460] | 277 | <img style="border:0px">
|
---|
| 278 | <xsl:attribute name="src">
|
---|
| 279 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/>
|
---|
| 280 | </xsl:attribute>
|
---|
| 281 | </img>
|
---|
[24115] | 282 | </xsl:when>
|
---|
[26043] | 283 | <xsl:when test="@type='web'">
|
---|
[26460] | 284 | <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[contains(@name, 'webicon')]"/>
|
---|
[26043] | 285 | </xsl:when>
|
---|
[26121] | 286 | <xsl:when test="@file">
|
---|
[26460] | 287 | <img>
|
---|
| 288 | <xslt:attribute name='src'>
|
---|
| 289 | <xsl:choose>
|
---|
| 290 | <xsl:when test="not(@select) or @select='site'">
|
---|
| 291 | <xsl:value-of disable-output-escaping="yes" select="concat('interfaces/',$interface_name,'/images/',@file)"/>
|
---|
| 292 | </xsl:when>
|
---|
| 293 | <xsl:when test="@select='collection'">
|
---|
| 294 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
|
---|
| 295 | <xsl:value-of disable-output-escaping="yes" select="concat('/images/',@file)"/>
|
---|
| 296 | </xsl:when>
|
---|
| 297 | </xsl:choose>
|
---|
| 298 | </xslt:attribute>
|
---|
| 299 | </img>
|
---|
[26121] | 300 | </xsl:when>
|
---|
[25361] | 301 | <xsl:when test="not(@type) or @type='document'">
|
---|
[26460] | 302 | <img style="border:0px">
|
---|
| 303 | <xslt:attribute name="id">documentBasketBook<xslt:value-of select="/page/pageResponse/collection/@name"/>:<xslt:value-of select="@nodeID"/>
|
---|
| 304 | </xslt:attribute>
|
---|
| 305 | <xslt:attribute name="src">
|
---|
| 306 | <xslt:choose>
|
---|
| 307 | <xslt:when test="@docType='hierarchy' and @nodeType='root'">
|
---|
| 308 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'book_image')"/>
|
---|
| 309 | </xslt:when>
|
---|
| 310 | <xslt:otherwise>
|
---|
| 311 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'page_icon_image')"/>
|
---|
| 312 | </xslt:otherwise>
|
---|
| 313 | </xslt:choose>
|
---|
| 314 | </xslt:attribute>
|
---|
| 315 | </img>
|
---|
[24115] | 316 | </xsl:when>
|
---|
| 317 | </xsl:choose>
|
---|
| 318 | </xsl:template>
|
---|
[26460] | 319 |
|
---|
| 320 | <!-- calls a template in gslib.xsl in order to avoid xsl vs xslt issue -->
|
---|
| 321 | <!--<xsl:template match="gsf:equivlinkgs3">
|
---|
[26023] | 322 | <xslt:call-template name="equivDocLinks">
|
---|
| 323 | <xslt:with-param name="count" select="0"/>
|
---|
| 324 | </xslt:call-template>
|
---|
[26031] | 325 | </xsl:template>-->
|
---|
[26023] | 326 |
|
---|
[26460] | 327 | <!-- 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. -->
|
---|
| 328 | <xsl:template match="gsf:equivlinkgs3" name="gsf:equivlinkgs3">
|
---|
| 329 | <xslt:variable name="docicon" select="metadataList/metadata[contains(@name, 'equivDocIcon')]"/>
|
---|
| 330 | <xslt:variable name="docStartlink" select="metadataList/metadata[contains(@name, 'all_*,*_equivDocLink')]"/>
|
---|
| 331 | <xslt:variable name="docEndlink" select="metadataList/metadata[contains(@name, '/equivDocLink')]"/>
|
---|
[26023] | 332 |
|
---|
[26460] | 333 | <xslt:variable name="equivDocLinks" select="java:org.greenstone.gsdl3.util.XSLTUtil.getEquivDocLinks(',',$docicon, $docStartlink, $docEndlink, ' ')" />
|
---|
| 334 | <xslt:value-of disable-output-escaping="yes" select="$equivDocLinks"/>
|
---|
| 335 | </xsl:template>
|
---|
[26023] | 336 |
|
---|
[26460] | 337 | <!--
|
---|
[26023] | 338 | In the collection's format statement, could have the following javascript+XSLT in place of
|
---|
| 339 | the gsf:equivlinkgs3 element (which resolves to the XSLT in config_format.xsl and gslib.xsl).
|
---|
| 340 | <xsl:text disable-output-escaping="yes"><script>var equivDocIcon= [ "
|
---|
| 341 | </xsl:text>
|
---|
| 342 | <gsf:metadata name="equivDocIcon" separator="", "" multiple="true"/>
|
---|
| 343 | <xsl:text disable-output-escaping="yes">"];var equivDocStartLink= [ "
|
---|
| 344 | </xsl:text>
|
---|
| 345 | <gsf:metadata name="equivDocLink" separator="","" multiple="true"/>
|
---|
| 346 | <xsl:text disable-output-escaping="yes">"];var equivDocEndLink= [ "
|
---|
| 347 | </xsl:text>
|
---|
| 348 | <gsf:metadata name="/equivDocLink" separator="","" multiple="true"/>
|
---|
| 349 | <xsl:text disable-output-escaping="yes">"];for (var i=0; i<equivDocIcon.length; i++) { document.write(equivDocStartLink[i]+ equivDocIcon[i] + equivDocEndLink[i]); }</script>
|
---|
| 350 | </xsl:text>
|
---|
| 351 | -->
|
---|
| 352 |
|
---|
[25941] | 353 | <!-- gsf:cgiparam example, as used by the Enhanced PDF tutorial:
|
---|
| 354 | <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> -->
|
---|
| 355 | <xsl:template match="gsf:cgi-param">
|
---|
| 356 | <xslt:value-of disable-output-escaping="yes" select="/page/pageRequest/paramList/param[@name='s1.{@name}']/@value"/>
|
---|
| 357 | </xsl:template>
|
---|
[24359] | 358 |
|
---|
[25752] | 359 | <!-- A GLI user can use a gsf:displayText element in GS3's Format Features to retrieve
|
---|
| 360 | a string defined in either collectionConfig.xml or else the interface dictionaries.
|
---|
| 361 | If the requested string occurs in neither, the request string itself will be output. -->
|
---|
[25732] | 362 | <xsl:template match="gsf:displayText">
|
---|
[26460] | 363 | <xslt:variable name="displaytext">
|
---|
| 364 | <xsl:call-template name="gsf:displayItem"/>
|
---|
| 365 | </xslt:variable>
|
---|
[25752] | 366 |
|
---|
[26460] | 367 | <xslt:choose>
|
---|
| 368 | <xslt:when test="$displaytext != ''">
|
---|
| 369 | <xslt:value-of disable-output-escaping="yes" select="$displaytext"/>
|
---|
| 370 | </xslt:when>
|
---|
| 371 | <xslt:otherwise>
|
---|
| 372 | <xslt:variable name="interfacetxt">
|
---|
| 373 | <xsl:call-template name="gsf:interfaceText"/>
|
---|
| 374 | </xslt:variable>
|
---|
[25752] | 375 |
|
---|
[26460] | 376 | <xslt:choose>
|
---|
| 377 | <xslt:when test="$interfacetxt != ''">
|
---|
| 378 | <xslt:value-of disable-output-escaping="yes" select="$interfacetxt"/>
|
---|
| 379 | </xslt:when>
|
---|
| 380 | <xslt:otherwise>
|
---|
| 381 | <xslt:value-of disable-output-escaping="yes" select="'{@name}'"/>
|
---|
| 382 | </xslt:otherwise>
|
---|
| 383 | </xslt:choose>
|
---|
| 384 | </xslt:otherwise>
|
---|
| 385 | </xslt:choose>
|
---|
[25752] | 386 | </xsl:template>
|
---|
| 387 |
|
---|
| 388 | <!-- With gsf:displayItem, a user can request a displayItem from collectionConfig.xml -->
|
---|
| 389 | <xsl:template match="gsf:displayItem" name="gsf:displayItem">
|
---|
[26460] | 390 | <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/displayItem[@name='{@name}']"/>
|
---|
[25732] | 391 | </xsl:template>
|
---|
| 392 |
|
---|
[25752] | 393 | <!-- With gsf:interfaceText, a user can request a string from the interface dictionaries in the current lang -->
|
---|
| 394 | <xsl:template match="gsf:interfaceText" name="gsf:interfaceText">
|
---|
[26460] | 395 | <xslt:value-of disable-output-escaping="yes" select="util:getInterfaceText($interface_name, /page/@lang, '{@name}')"/>
|
---|
[25732] | 396 | </xsl:template>
|
---|
[26250] | 397 | <!-- With gsf:collectionText, a user can request a string from the collection's dictionary in the current lang -->
|
---|
| 398 | <xsl:template match="gsf:collectionText" name="gsf:collectionText">
|
---|
[26460] | 399 | <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
|
---|
[26387] | 400 | <xslt:copy-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')/node()"/>
|
---|
[26250] | 401 | </xsl:template>
|
---|
[25732] | 402 |
|
---|
[24792] | 403 | <!-- if this gsf:metadata is a child of a document node then we want to get the metadata for that node -->
|
---|
[26176] | 404 | <xsl:template match="gsf:metadata">
|
---|
| 405 | <xsl:if test="not(@hidden = 'true')">
|
---|
| 406 | <!-- set hidden=true on a gsf:metadata so that it gets retrieved from the server but not displayed -->
|
---|
[26460] | 407 | <xsl:variable name="meta_name">
|
---|
| 408 | <xsl:call-template name="getMetadataName"/>
|
---|
| 409 | </xsl:variable>
|
---|
[26176] | 410 | <xsl:variable name="separator">
|
---|
| 411 | <xsl:choose>
|
---|
[26460] | 412 | <xsl:when test="@separator">
|
---|
| 413 | <xsl:value-of disable-output-escaping='yes' select="@separator"/>
|
---|
| 414 | </xsl:when>
|
---|
| 415 | <xsl:when test="separator">
|
---|
| 416 | <xsl:copy-of select="separator/node()"/>
|
---|
| 417 | </xsl:when>
|
---|
| 418 | <xsl:otherwise>
|
---|
| 419 | <xsl:text>, </xsl:text>
|
---|
| 420 | </xsl:otherwise>
|
---|
[26176] | 421 | </xsl:choose>
|
---|
| 422 | </xsl:variable>
|
---|
| 423 | <xsl:variable name="prefix">
|
---|
| 424 | <xsl:choose>
|
---|
[26460] | 425 | <xsl:when test="@prefix">
|
---|
| 426 | <xsl:value-of disable-output-escaping='yes' select="@prefix"/>
|
---|
| 427 | </xsl:when>
|
---|
| 428 | <xsl:when test="prefix">
|
---|
| 429 | <xsl:copy-of select="prefix/node()"/>
|
---|
| 430 | </xsl:when>
|
---|
[26176] | 431 | </xsl:choose>
|
---|
| 432 | </xsl:variable>
|
---|
| 433 | <xsl:variable name="suffix">
|
---|
| 434 | <xsl:choose>
|
---|
[26460] | 435 | <xsl:when test="@suffix">
|
---|
| 436 | <xsl:value-of disable-output-escaping='yes' select="@suffix"/>
|
---|
| 437 | </xsl:when>
|
---|
| 438 | <xsl:when test="suffix">
|
---|
| 439 | <xsl:copy-of select="suffix/node()"/>
|
---|
| 440 | </xsl:when>
|
---|
[26176] | 441 | </xsl:choose>
|
---|
| 442 | </xsl:variable>
|
---|
| 443 | <xsl:variable name="postest">
|
---|
| 444 | <xsl:choose>
|
---|
| 445 | <xsl:when test="@pos = 'first'">position()=1</xsl:when>
|
---|
| 446 | <xsl:when test="@pos = 'last'">position() = last()</xsl:when>
|
---|
[26460] | 447 | <xsl:when test="@pos">position() = <xsl:value-of select="@pos"/>
|
---|
| 448 | </xsl:when>
|
---|
[26176] | 449 | <xsl:otherwise>true()</xsl:otherwise>
|
---|
| 450 | </xsl:choose>
|
---|
| 451 | </xsl:variable>
|
---|
| 452 | <xsl:variable name="multiple">
|
---|
| 453 | <xsl:choose>
|
---|
| 454 | <xsl:when test="@pos">false()</xsl:when>
|
---|
| 455 | <xsl:otherwise>true()</xsl:otherwise>
|
---|
| 456 | </xsl:choose>
|
---|
| 457 | </xsl:variable>
|
---|
| 458 | <xslt:for-each>
|
---|
| 459 | <xsl:attribute name="select">
|
---|
[26460] | 460 | <xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>(.//metadataList)[last()]/metadata[@name='<xsl:value-of select="$meta_name"/>'<xsl:if test="@lang">
|
---|
| 461 | <xsl:text> and @lang=</xsl:text>
|
---|
| 462 | <xsl:value-of select="@lang"/>
|
---|
| 463 | </xsl:if>
|
---|
| 464 | <xsl:text>]</xsl:text>
|
---|
[26176] | 465 | </xsl:attribute>
|
---|
| 466 | <xslt:if test="{$postest}">
|
---|
[26460] | 467 | <xslt:if test="{$multiple} and position()>1"><xsl:copy-of select="$separator"/>
|
---|
| 468 | </xslt:if>
|
---|
[26176] | 469 | <xsl:copy-of select="$prefix"/>
|
---|
| 470 | <xsl:choose>
|
---|
| 471 | <xsl:when test="@format">
|
---|
| 472 | <xslt:value-of disable-output-escaping='yes' select="util:{@format}(., /page/@lang )"/>
|
---|
| 473 | </xsl:when>
|
---|
| 474 | <xsl:otherwise>
|
---|
| 475 | <xslt:value-of disable-output-escaping='yes' select="."/>
|
---|
| 476 | </xsl:otherwise>
|
---|
| 477 | </xsl:choose>
|
---|
| 478 | </xslt:if>
|
---|
| 479 | <xsl:copy-of select="$suffix"/>
|
---|
| 480 | </xslt:for-each>
|
---|
| 481 | </xsl:if>
|
---|
| 482 | </xsl:template>
|
---|
[26092] | 483 |
|
---|
[26500] | 484 |
|
---|
[26467] | 485 | <xsl:template match="gsf:foreach-metadata">
|
---|
| 486 | <xsl:variable name="meta_name"><xsl:call-template name="getMetadataName"/></xsl:variable>
|
---|
| 487 | <xslt:for-each>
|
---|
| 488 | <xsl:attribute name="select">
|
---|
| 489 | <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>
|
---|
| 490 | </xsl:attribute><xsl:if test='@separator'><xslt:if test='position()>1'><xsl:value-of select='@separator'/></xslt:if></xsl:if>
|
---|
| 491 | <xsl:apply-templates/>
|
---|
| 492 | </xslt:for-each>
|
---|
| 493 | </xsl:template>
|
---|
| 494 |
|
---|
| 495 | <xsl:template match="gsf:meta-value">
|
---|
| 496 | <xslt:value-of select="."/>
|
---|
| 497 | </xsl:template>
|
---|
[26092] | 498 |
|
---|
[26500] | 499 | <xsl:template name="getMetadataName">
|
---|
| 500 | <xsl:if test='@select'>
|
---|
| 501 | <xsl:value-of select='@select'/>
|
---|
| 502 | <xsl:text>_</xsl:text>
|
---|
| 503 | </xsl:if>
|
---|
| 504 | <xsl:value-of select="@name"/>
|
---|
| 505 | </xsl:template>
|
---|
[26467] | 506 |
|
---|
[26500] | 507 |
|
---|
[24115] | 508 | <xsl:template match="gsf:text">
|
---|
[26020] | 509 | <xslt:call-template name="documentNodeText"/>
|
---|
[24115] | 510 | </xsl:template>
|
---|
[26387] | 511 |
|
---|
[26460] | 512 | <xsl:template match="gsf:if-metadata-exists">
|
---|
| 513 | <xsl:variable name="meta-path">
|
---|
| 514 | <xsl:for-each select="gsf:metadata">(.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:for-each>
|
---|
| 515 | </xsl:variable>
|
---|
| 516 | <xslt:choose>
|
---|
| 517 | <xslt:when test="{$meta-path}">
|
---|
| 518 | <xsl:apply-templates select="gsf:if/node()"/>
|
---|
| 519 | </xslt:when>
|
---|
| 520 | <xsl:if test="gsf:else">
|
---|
| 521 | <xslt:otherwise>
|
---|
| 522 | <xsl:apply-templates select="gsf:else/node()"/>
|
---|
| 523 | </xslt:otherwise>
|
---|
| 524 | </xsl:if>
|
---|
| 525 | </xslt:choose>
|
---|
| 526 | </xsl:template>
|
---|
| 527 |
|
---|
[24792] | 528 | <xsl:template match="gsf:choose-metadata">
|
---|
| 529 | <xslt:choose>
|
---|
| 530 | <xsl:for-each select="gsf:metadata">
|
---|
| 531 | <xslt:when>
|
---|
[26093] | 532 | <xsl:attribute name="test">(.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:attribute>
|
---|
[24792] | 533 | <xsl:apply-templates select="."/>
|
---|
| 534 | </xslt:when>
|
---|
| 535 | </xsl:for-each>
|
---|
| 536 | <xsl:if test="gsf:default">
|
---|
[26460] | 537 | <xslt:otherwise>
|
---|
| 538 | <xsl:apply-templates select="gsf:default"/>
|
---|
| 539 | </xslt:otherwise>
|
---|
[24792] | 540 | </xsl:if>
|
---|
| 541 | </xslt:choose>
|
---|
| 542 | </xsl:template>
|
---|
[26460] | 543 |
|
---|
[24115] | 544 | <xsl:template match="gsf:switch">
|
---|
[26460] | 545 | <xsl:variable name="meta-name">
|
---|
| 546 | <xsl:for-each select="gsf:metadata">
|
---|
| 547 | <xsl:call-template name="getMetadataName"/>
|
---|
| 548 | </xsl:for-each>
|
---|
| 549 | </xsl:variable>
|
---|
| 550 | <xslt:variable name="meta">
|
---|
| 551 | <xsl:choose>
|
---|
| 552 | <xsl:when test="@preprocess">
|
---|
| 553 | <xslt:value-of select="util:{@preprocess}((.//metadataList)[last()]/metadata[@name='{$meta-name}'], /page/@lang )"/>
|
---|
| 554 | </xsl:when>
|
---|
| 555 | <xsl:otherwise>
|
---|
| 556 | <xslt:value-of select="(.//metadataList)[last()]/metadata[@name='{$meta-name}']"/>
|
---|
| 557 | </xsl:otherwise>
|
---|
| 558 | </xsl:choose>
|
---|
| 559 | </xslt:variable>
|
---|
[24115] | 560 | <xslt:choose>
|
---|
| 561 | <xsl:for-each select="gsf:when">
|
---|
| 562 | <xslt:when test="util:{@test}($meta, '{@test-value}')">
|
---|
| 563 | <xsl:apply-templates/>
|
---|
| 564 | </xslt:when>
|
---|
| 565 | </xsl:for-each>
|
---|
| 566 | <xsl:if test="gsf:otherwise">
|
---|
| 567 | <xslt:otherwise>
|
---|
| 568 | <xsl:apply-templates select="gsf:otherwise/node()"/>
|
---|
| 569 | </xslt:otherwise>
|
---|
| 570 | </xsl:if>
|
---|
| 571 | </xslt:choose>
|
---|
| 572 | </xsl:template>
|
---|
[26460] | 573 |
|
---|
[26500] | 574 | <!--
|
---|
| 575 | <gsf:headMetaTags> exists for controlling the <meta name="x" content="y"> elements that appear in the HTML <head></head>
|
---|
| 576 | XPATH is used to select this item (in header.xsl). It does not need an explicit definition here in this file
|
---|
| 577 | -->
|
---|
| 578 |
|
---|
[24115] | 579 | <xsl:template match="*">
|
---|
| 580 | <xsl:copy>
|
---|
[26460] | 581 | <xsl:copy-of select="@*"/>
|
---|
[24115] | 582 | <xsl:apply-templates/>
|
---|
| 583 | </xsl:copy>
|
---|
| 584 | </xsl:template>
|
---|
[19860] | 585 |
|
---|
| 586 | </xsl:stylesheet>
|
---|
| 587 |
|
---|
| 588 |
|
---|