Changeset 26467


Ignore:
Timestamp:
2012-11-15T15:37:19+13:00 (11 years ago)
Author:
kjdon
Message:

added a few new gsf templates, foreach-metadata and supporting templates

File:
1 edited

Legend:

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

    r26460 r26467  
    108108    </xsl:template>
    109109
     110  <xsl:template match="params"></xsl:template>
    110111    <xsl:template match="gsf:link">
     112
    111113        <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
    112114        <xsl:variable name="opt-title">                 
     
    124126            </xsl:choose>
    125127        </xsl:variable>
     128
    126129        <xsl:choose>
    127130            <xsl:when test="@type='query'">
     
    140143                            </xsl:otherwise>
    141144                        </xsl:choose>
     145        <xsl:if test="params">?rt=rd&amp;<xsl:copy-of select="params/node()"/></xsl:if>
    142146                    </xslt:attribute>
    143147                    <xsl:copy-of select="$opt-title"/>
     
    448452    </xsl:template>
    449453
     454
     455  <xsl:template match="gsf:foreach-metadata">
     456    <xsl:variable name="meta_name"><xsl:call-template name="getMetadataName"/></xsl:variable>
     457    <xslt:for-each>
     458      <xsl:attribute name="select">
     459    <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>
     460      </xsl:attribute><xsl:if test='@separator'><xslt:if test='position()>1'><xsl:value-of select='@separator'/></xslt:if></xsl:if>
     461      <xsl:apply-templates/>
     462    </xslt:for-each>
     463  </xsl:template>
     464
     465  <xsl:template match="gsf:meta-value">
     466    <xslt:value-of select="."/>
     467  </xsl:template>
    450468    <xsl:template name="getMetadataName">
    451469        <xsl:if test='@select'>
     
    455473        <xsl:value-of select="@name"/>
    456474    </xsl:template>
     475
    457476
    458477    <xsl:template match="gsf:text">
Note: See TracChangeset for help on using the changeset viewer.