Changeset 30689

Show
Ignore:
Timestamp:
08.08.2016 10:39:04 (3 years ago)
Author:
kjdon
Message:

making gsf:image type=cover work. also, simplified paths. docnodes only seem to have one metadataList nowadays...hope it doesn't break something else

Files:
1 modified

Legend:

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

    r30544 r30689  
    137137                <xsl:when test="@type = 'screen'">Screen</xsl:when> 
    138138                <xsl:when test="@type = 'source'">SourceFile</xsl:when> 
     139                <xsl:when test="@type = 'cover'">hascover</xsl:when> 
    139140            </xsl:choose> 
    140141        </xslt:variable> 
    141         <xslt:if test="(.//metadataList)[last()]/metadata[@name = $metaName]"> 
     142          <xslt:if test="./metadataList/metadata[@name = $metaName]"> 
    142143            <img> 
    143144                <xslt:attribute name='src'> 
    144145                    <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/collection/metadataList/metadata[@name = 'httpPath']"/> 
    145146                    <xsl:text>/index/assoc/</xsl:text> 
    146                     <xslt:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/> 
     147                    <xslt:value-of disable-output-escaping="yes" select="./metadataList/metadata[@name = 'assocfilepath']"/> 
    147148                    <xsl:text>/</xsl:text> 
    148                     <xslt:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $metaName]"/> 
     149                    <xslt:choose> 
     150                      <xslt:when test="$metaName = 'hascover'">cover.jpg</xslt:when> 
     151                      <xslt:otherwise> 
     152                        <xslt:value-of disable-output-escaping="yes" select="./metadataList/metadata[@name = $metaName]"/> 
     153                      </xslt:otherwise> 
     154                    </xslt:choose> 
    149155                </xslt:attribute> 
     156                <!-- copy any other attributes apart from type--> 
     157                <xsl:for-each select="@*[name() != 'type']"> 
     158                  <xslt:attribute name="{name()}"> 
     159                    <xsl:value-of select="."/> 
     160                  </xslt:attribute> 
     161                </xsl:for-each> 
     162                   
    150163            </img> 
    151164        </xslt:if>