Opened 12 years ago

Closed 12 years ago

#1247 closed enhancement (fixed)

Indexing / iso19139 / add XSL mode to easily add new field in a profile

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

Description (last modified by fxp)

When making a profile, indexing could be quite easily delegated to iso19139 in schema/index-fields.xsl 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/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.

Attachments (1)

1247.patch (4.3 KB ) - added by fxp 12 years ago.

Download all attachments as: .zip

Change History (3)

by fxp, 12 years ago

Attachment: 1247.patch added

comment:1 by fxp, 12 years ago

Description: modified (diff)

comment:2 by fxp, 12 years ago

Resolution: fixed
Status: newclosed

master commit 8028ebde1f310b1c4c05aa0091db1ff015bb9fb9

Note: See TracTickets for help on using tickets.