Changeset 26165


Ignore:
Timestamp:
2012-09-11T13:54:04+12:00 (12 years ago)
Author:
kjdon
Message:

added some more functionality to gsf:metadata. now has prefix and suffix atts, get output before and after each metadata element. separator, prefix and suffix can alternatively be written as subelements of gsf:metadata. This allows writing HTML tags, eg <br/>. Can't, however, open a tag in prefix and close it in suffix. end up with invalid xml in the format statement.

File:
1 edited

Legend:

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

    r26127 r26165  
    243243      <!-- set hidden=true on a gsf:metadata so that it gets retrieved from the server but not displayed -->
    244244      <xsl:variable name="meta_name"><xsl:call-template name="getMetadataName"/></xsl:variable>
    245       <xsl:variable name="separator"><xsl:choose><xsl:when test="@separator"><xsl:value-of disable-output-escaping='yes' select="@separator"/></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose></xsl:variable>
     245      <xsl:variable name="separator"><xsl:choose><xsl:when test="@separator"><xsl:value-of disable-output-escaping='yes' select="@separator"/></xsl:when><xsl:when test="separator"><xsl:copy-of select="separator/node()"/></xsl:when><xsl:otherwise><xsl:text>, </xsl:text></xsl:otherwise></xsl:choose></xsl:variable>
     246      <xsl:variable name="prefix"><xsl:choose><xsl:when test="@prefix"><xsl:value-of disable-output-escaping='yes' select="@prefix"/></xsl:when><xsl:when test="prefix"><xsl:copy-of select="prefix/node()"/></xsl:when></xsl:choose></xsl:variable>
     247      <xsl:variable name="suffix"><xsl:choose><xsl:when test="@suffix"><xsl:value-of disable-output-escaping='yes' select="@suffix"/></xsl:when><xsl:when test="suffix"><xsl:copy-of select="suffix/node()"/></xsl:when></xsl:choose></xsl:variable>
    246248      <xsl:variable name="postest">
    247249    <xsl:choose><xsl:when test="@pos = 'first'">position()=1</xsl:when><xsl:when test="@pos = 'last'">position() = last()</xsl:when><xsl:when test="@pos">position() = <xsl:value-of select="@pos"/></xsl:when><xsl:otherwise>true()</xsl:otherwise></xsl:choose>
     
    251253    <xsl:if test="@type='collection'">/page/pageResponse/collection/</xsl:if>metadataList/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></xsl:attribute>
    252254      <xslt:if test="{$postest}">
    253       <xslt:if test="{$multiple} and position()>1"><xsl:value-of select="$separator"/></xslt:if>
     255      <xslt:if test="{$multiple} and position()>1"><xsl:copy-of select="$separator"/></xslt:if>
     256      <xsl:copy-of select="$prefix"/>
    254257      <xsl:choose>
    255258        <xsl:when test="@format">
     
    261264      </xsl:choose>
    262265    </xslt:if>
     266    <xsl:copy-of select="$suffix"/>
    263267    </xslt:for-each>
    264268  </xsl:if>
Note: See TracChangeset for help on using the changeset viewer.