Opened 11 years ago

Last modified 11 years ago

#1247 closed enhancement

Indexing / iso19139 / add XSL mode to easily add new field in a profile — at Initial Version

Reported by: fxp Owned by: geonetwork-devel@…
Priority: minor Milestone: v2.10.0 RC0
Component: General Version: v2.9.0
Keywords: PIGMA Cc:

Description

When making a profile, indexing could be quite easily delegated to iso19139 using:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
    <xsl:import href="../iso19139.fra/index-fields.xsl"/>
</xsl:stylesheet>  

but there is no easy way to add one field (without duplicating the mode="metadata" template).

This task adds an "index" mode template in order to easily add new field. For example, index some keywords from a specific thesaurus in a new field adding the following to the previous XSL:

        <xsl:template mode="index"
            match="gmd:MD_Keywords[gmd:thesaurusName/gmd:CI_Citation/
                        gmd:title/gco:CharacterString='My thesaurus']/
                        gmd:keyword[normalize-space(gco:CharacterString) != '']">
            <Field name="myThesaurusKeyword" string="{string(.)}" store="true" index="true"/>
        </xsl:template>

If matching a upper level element, apply mode to its child to further index deeper level if required:

        <xsl:template mode="index" match="gmd:EX_Extent">
            ... do something
            ... and continue indexing
            <xsl:apply-templates mode="index" select="*"/>
        </xsl:template>

No changes made to mode="metadata" for compatibility with existing profiles.

Change History (1)

by fxp, 11 years ago

Attachment: 1247.patch added
Note: See TracTickets for help on using tickets.