Changeset 29234

Show
Ignore:
Timestamp:
25.08.2014 15:48:30 (5 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed up a recent commit to the XSLT for gsf:link that had broken the assocfilepath links of src documents in those cases where the pageResponse had no document subelement but a classifier subelement. The result was that, when browsing, src document links were broken, having no assocfilepath. Now the XSLT handles both cases. If there's no document subelement, it behaves as before a recent commit.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/config_format.xsl

    r29223 r29234  
    201201            </xsl:when> 
    202202            <xsl:when test="@type='source'"> 
     203                <xslt:variable name="thisAssocfilepath">                     
     204                    <xslt:choose> 
     205                        <xslt:when test="/page/pageResponse/document"> 
     206                            <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" /> 
     207                        </xslt:when> 
     208                        <xslt:otherwise> 
     209                            <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='assocfilepath']" /> 
     210                        </xslt:otherwise> 
     211                    </xslt:choose>                       
     212                </xslt:variable> 
    203213                <a> 
    204                         <xsl:if test="@target"> 
     214                    <xsl:if test="@target"> 
    205215                      <xsl:attribute name='target'> 
    206216                        <xsl:value-of select='@target'/> 
    207217                      </xsl:attribute>    
    208218                    </xsl:if> 
    209  
    210219                    <xslt:attribute name='href'> 
    211220                        <xslt:value-of  
    212221                   disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']" />/index/assoc/<xslt:value-of  
    213                    disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name='assocfilepath']" />/<xslt:value-of  
     222                   disable-output-escaping="yes" select="$thisAssocfilepath" />/<xslt:value-of  
    214223                   disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name='srclinkFile']" /> 
    215224                    </xslt:attribute>