Changeset 29093

Show
Ignore:
Timestamp:
09.06.2014 14:37:59 (5 years ago)
Author:
kjdon
Message:

allow comma separated metadata names in gsf:metadata name attribute. Then we can do something like <gsf:metadata name='dc.Date,Date' pos='classifiedBy'/> to output the value is a classifier list that the current document was classified By

Files:
1 modified

Legend:

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

    r29091 r29093  
    55    xmlns:java="http://xml.apache.org/xslt/java" 
    66    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 
     7    xmlns:xalan="http://xml.apache.org/xalan" 
    78    xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 
    8     extension-element-prefixes="java"> 
     9    extension-element-prefixes="java xalan"> 
    910    <xsl:param name="interface_name"/> 
    1011    <xsl:param name="library_name"/> 
     
    441442        <xsl:if test="not(@hidden = 'true')"> 
    442443            <!-- set hidden=true on a gsf:metadata so that it gets retrieved from the server but not displayed --> 
    443             <xsl:variable name="meta_name"> 
    444                 <xsl:call-template name="getMetadataName"/> 
    445             </xsl:variable> 
     444            <xsl:variable name="meta_test"><xsl:call-template name="getMetadataTest"/></xsl:variable>              
    446445            <xsl:variable name="separator"> 
    447446                <xsl:choose> 
     
    495494            <xslt:for-each> 
    496495                <xsl:attribute name="select"> 
    497                     (<xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>.//metadataList)[last()]/metadata[@name='<xsl:value-of select="$meta_name"/>'<xsl:if test="@lang"> 
     496                  (<xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>.//metadataList)[last()]/metadata[<xsl:value-of select="$meta_test"/><xsl:if test="@lang"> 
    498497                        <xsl:text> and @lang=</xsl:text> 
    499498                        <xsl:value-of select="@lang"/> 
     
    542541  </xsl:template> 
    543542 
     543  <!-- if we have metadata name="dc.Date,Date" will make a test like @name = 'dc.Date' or @name = 'Date' --> 
     544  <xsl:template name="getMetadataTest"> 
     545    <xsl:for-each select="xalan:tokenize(@name, ',')"><xsl:if test="position()!=1"> or </xsl:if>@name='<xsl:if test='@select'><xsl:value-of select='@select'/><xsl:text>_</xsl:text></xsl:if><xsl:value-of select="."/>'</xsl:for-each> 
     546  </xsl:template> 
    544547 
    545548    <xsl:template match="gsf:text">