Changeset 26387


Ignore:
Timestamp:
10/25/12 13:27:01 (8 years ago)
Author:
kjdon
Message:

use node() instead of * as * seems only to get named nodes, not text nodes. added new gsf:if-metadata-exists as a simpler version of gsf:switch when the test is only for existence of metadata

File:
1 edited

Legend:

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

    r26347 r26387  
    293293    <xsl:template match="gsf:collectionText" name="gsf:collectionText">
    294294    <xslt:variable name="collName" select="/page/pageResponse/collection/@name"/>
    295         <xslt:value-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')/*"/>
     295        <xslt:copy-of select="util:getCollectionText($collName, $site_name, /page/@lang, '{@name}', '{@args}')/node()"/>
    296296    </xsl:template>
    297297
     
    367367    </xsl:template>
    368368 
     369  <xsl:template match="gsf:if-metadata-exists">
     370    <xsl:variable name="meta-path"><xsl:for-each select="gsf:metadata">(.//metadataList)[last()]/metadata[@name='<xsl:call-template name="getMetadataName"/>']</xsl:for-each></xsl:variable>
     371    <xslt:choose>
     372    <xslt:when test="{$meta-path}">
     373      <xsl:apply-templates select="gsf:if/node()"/>
     374    </xslt:when>
     375      <xsl:if test="gsf:else">
     376    <xslt:otherwise><xsl:apply-templates select="gsf:else/node()"/>
     377    </xslt:otherwise>
     378      </xsl:if>
     379    </xslt:choose>
     380  </xsl:template>
     381
    369382    <xsl:template match="gsf:choose-metadata">
    370383        <xslt:choose>
Note: See TracChangeset for help on using the changeset viewer.