Changeset 29834


Ignore:
Timestamp:
2015-04-20T13:16:12+12:00 (9 years ago)
Author:
kjdon
Message:

allowing ex.Title in format statements, eg <gsf:metadata name='ex.Title'/>. Need to strip off the ex. before looking up the metadata nodes. But need to keep it if its like ex.dc.Title, as that ex IS kept in the database.

File:
1 edited

Legend:

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

    r29769 r29834  
    557557      <xsl:text>_</xsl:text>
    558558    </xsl:if>
    559     <xsl:value-of select="@name"/>
     559    <xsl:call-template name="stripEx"><xsl:with-param name="meta-name" select="@name"/></xsl:call-template>
     560  </xsl:template>
     561
     562  <!-- we allow ex.Title in gsf:metadata. Need to strip off the ex. as the metadata in the database will be just Title. However, metadata like ex.dc.Title does keep its ex. in the database, so don't remove ex. if there is another . in the name -->
     563  <xsl:template name="stripEx">
     564    <xsl:param name="meta-name"/>
     565    <xsl:choose><xsl:when test="starts-with($meta-name, 'ex.') and not(contains(substring($meta-name, 4), '.'))"><xsl:value-of select="substring($meta-name, 4)"/></xsl:when><xsl:otherwise><xsl:value-of select="$meta-name"/></xsl:otherwise></xsl:choose>
    560566  </xsl:template>
    561567
     
    563569  <xsl:template name="getMetadataTest">
    564570  <xsl:variable name="selectattr"><xsl:value-of select='@select'/></xsl:variable>
    565     (<xsl:for-each select="xalan:tokenize(@name, ',')"><xsl:if test="position()!=1"> or </xsl:if>@name='<xsl:if test="$selectattr != ''"><xsl:value-of select="$selectattr"/><xsl:text>_</xsl:text></xsl:if><xsl:value-of select="."/>'</xsl:for-each>)
     571    (<xsl:for-each select="xalan:tokenize(@name, ',')"><xsl:if test="position()!=1"> or </xsl:if>@name='<xsl:if test="$selectattr != ''"><xsl:value-of select="$selectattr"/><xsl:text>_</xsl:text></xsl:if><xsl:call-template name="stripEx"><xsl:with-param name="meta-name"><xsl:value-of select="."/></xsl:with-param></xsl:call-template>'</xsl:for-each>)
    566572  </xsl:template>
    567573
Note: See TracChangeset for help on using the changeset viewer.