- Timestamp:
- 2022-11-04T12:10:15+13:00 (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/expand-gsf.xsl
r36528 r36880 140 140 did need the character to be entity-mapped --> 141 141 <xsl:template match="gsf:squote"><xslt:text disable-output-escaping="yes">'</xslt:text></xsl:template> 142 142 143 <xsl:template name="gsf:assocfilepathVariable"> 144 <xslt:variable name="thisAssocfilepath"> 145 <xslt:choose> 146 <xslt:when test="/page/pageResponse/document"> 147 <xslt:choose> 148 <xslt:when test="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']"> 149 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" /> 150 </xslt:when> 151 <xslt:otherwise> 152 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/documentNode[@nodeType='root']/metadataList/metadata[@name='assocfilepath']" /> 153 </xslt:otherwise> 154 </xslt:choose> 155 </xslt:when> 156 <xslt:otherwise> 157 <xslt:choose> 158 <xslt:when test="metadataList/metadata[@name='assocfilepath']"> 159 <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='assocfilepath']" /> 160 </xslt:when> 161 <xslt:otherwise> 162 <xslt:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='root_assocfilepath']" /> 163 </xslt:otherwise> 164 </xslt:choose> 165 </xslt:otherwise> 166 </xslt:choose> 167 </xslt:variable> 168 169 </xsl:template> 170 143 171 <xsl:template match="gsf:image"> 144 172 <xslt:variable name="metaName"> … … 150 178 </xsl:choose> 151 179 </xslt:variable> 152 <xslt:variable name="thisAssocfilepath"> 153 <xslt:choose> 154 <xslt:when test="/page/pageResponse/document"> 155 <xslt:choose> 156 <xslt:when test="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']"> 157 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" /> 158 </xslt:when> 159 <xslt:otherwise> 160 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/documentNode[@nodeType='root']/metadataList/metadata[@name='assocfilepath']" /> 161 </xslt:otherwise> 162 </xslt:choose> 163 </xslt:when> 164 <xslt:otherwise> 165 <xslt:choose> 166 <xslt:when test="(.//metadataList)[last()]/metadata[@name='assocfilepath']"> 167 <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='assocfilepath']" /> 168 </xslt:when> 169 <xslt:otherwise> 170 <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='root_assocfilepath']" /> 171 </xslt:otherwise> 172 </xslt:choose> 173 </xslt:otherwise> 174 </xslt:choose> 175 </xslt:variable> 180 <!-- output the $thisAssocfilepath variable definition--> 181 <xsl:call-template name="gsf:assocfilepathVariable"/> 176 182 <xslt:if test="./metadataList/metadata[@name = $metaName]"> 177 183 <img> … … 268 274 </xsl:when> 269 275 <xsl:when test="@type='source'"> 270 <xslt:variable name="thisAssocfilepath"> 271 <xslt:choose> 272 <xslt:when test="/page/pageResponse/document"> 273 <xslt:choose> 274 <xslt:when test="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']"> 275 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" /> 276 </xslt:when> 277 <xslt:otherwise> 278 <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/documentNode[@nodeType='root']/metadataList/metadata[@name='assocfilepath']" /> 279 </xslt:otherwise> 280 </xslt:choose> 281 </xslt:when> 282 <xslt:otherwise> 283 <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='root_assocfilepath']" /> 284 </xslt:otherwise> 285 </xslt:choose> 286 </xslt:variable> 276 <xsl:call-template name="gsf:assocfilepathVariable"/> 287 277 <xsl:variable name="image_meta"> 288 278 <xsl:choose> … … 307 297 disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']" />/index/assoc/<xslt:value-of 308 298 disable-output-escaping="yes" select="$thisAssocfilepath" />/<xslt:value-of 309 disable-output-escaping="yes" select=" (.//metadataList)[last()]/metadata[@name='{$image_meta}']" />299 disable-output-escaping="yes" select="metadataList/metadata[@name='{$image_meta}']" /> 310 300 </xslt:attribute> 311 301 <xsl:copy-of select="$opt-title"/> … … 377 367 <xsl:when test="@OIDmetadata"> 378 368 <xsl:variable name="OIDmeta" select="@OIDmetadata"/> 379 <xslt:value-of select=" (.//metadataList)[last()]/metadata[@name='{$OIDmeta}']"/>369 <xslt:value-of select="metadataList/metadata[@name='{$OIDmeta}']"/> 380 370 </xsl:when> 381 371 <xsl:otherwise> … … 617 607 <xslt:for-each> 618 608 <xsl:attribute name="select"> 619 (<xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>.//metadataList)[last()]/metadata[<xsl:value-of select="$meta_test"/><xsl:if test="@lang">609 <xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>metadataList/metadata[<xsl:value-of select="$meta_test"/><xsl:if test="@lang"> 620 610 <xsl:text> and @lang=</xsl:text> 621 611 <xsl:value-of select="@lang"/> … … 648 638 <xslt:for-each> 649 639 <xsl:attribute name="select"> 650 (<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>640 (<xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>metadataList/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> 651 641 </xsl:attribute><xsl:choose><xsl:when test='@sort'><xslt:sort/></xsl:when><xsl:when test="gsf:sort"><xslt:sort><xsl:copy-of select="gsf:sort/@*"/></xslt:sort></xsl:when></xsl:choose><xsl:if test='@separator'><xslt:if test='position()>1'><xsl:value-of select='@separator'/></xslt:if></xsl:if> 652 642 <xsl:apply-templates/> … … 742 732 <xsl:for-each select="gsf:metadata"> 743 733 <xslt:when> 744 <xsl:attribute name="test"> (.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:attribute>734 <xsl:attribute name="test">metadataList/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:attribute> 745 735 <xsl:apply-templates select="."/> 746 736 </xslt:when> … … 763 753 <xsl:choose> 764 754 <xsl:when test="@preprocess"> 765 <xslt:value-of select="util:{@preprocess}( (.//metadataList)[last()]/metadata[@name='{$meta-name}'], /page/@lang )"/>755 <xslt:value-of select="util:{@preprocess}(metadataList/metadata[@name='{$meta-name}'], /page/@lang )"/> 766 756 </xsl:when> 767 757 <xsl:otherwise> 768 <xslt:value-of select=" (.//metadataList)[last()]/metadata[@name='{$meta-name}']"/>758 <xslt:value-of select="metadataList/metadata[@name='{$meta-name}']"/> 769 759 </xsl:otherwise> 770 760 </xsl:choose>
Note:
See TracChangeset
for help on using the changeset viewer.