Changeset 25928


Ignore:
Timestamp:
2012-07-11T09:42:19+12:00 (12 years ago)
Author:
sjm84
Message:

Adding the type="metadata" attribute will allow users to specify collection level metadata

File:
1 edited

Legend:

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

    r25919 r25928  
    167167    <!-- if this gsf:metadata is a child of a document node then we want to get the metadata for that node -->
    168168    <xsl:template match="gsf:metadata">
    169         <xslt:if test="not(@hidden = 'true')">     
     169        <xslt:variable name="langAtt"><xsl:value-of select="@lang"/></xslt:variable>
     170        <xslt:if test="not(@hidden = 'true')">
    170171            <xslt:value-of disable-output-escaping="yes">
    171172                <xsl:attribute name="select">
     
    175176                        <xsl:text>(</xsl:text>
    176177                    </xsl:if>
    177                     <xsl:text>(.//metadataList)[last()]/metadata[@name='</xsl:text>
     178                    <xsl:choose>
     179                        <xsl:when test="@type = 'collection'">
     180                            <xsl:text>/page/pageResponse/collection/metadataList/metadata[@name='</xsl:text>
     181                        </xsl:when>
     182                        <xsl:otherwise>
     183                            <xsl:text>(.//metadataList)[last()]/metadata[@name='</xsl:text>
     184                        </xsl:otherwise>
     185                    </xsl:choose>
    178186                    <xsl:apply-templates select="." mode="get-metadata-name"/>
    179                     <xsl:text>']</xsl:text>
     187                    <xsl:text>'</xsl:text>
     188                    <xsl:if test="@lang">
     189                        <xsl:text> and @lang=$langAtt</xsl:text>
     190                    </xsl:if>
     191                    <xsl:text>]</xsl:text>
    180192                    <xsl:if test="@format">
    181193                        <xsl:text>, /page/@lang )</xsl:text>
Note: See TracChangeset for help on using the changeset viewer.