Skip to content

Commit

Permalink
Remove empty extent sections and don't display the container element …
Browse files Browse the repository at this point in the history
…in the metadata editor (#358)
  • Loading branch information
josegar74 authored Sep 25, 2023
1 parent 43ee77c commit 1a56fb7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/plugin/iso19139.ca.HNAP/layout/config-editor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@
if="count(gmd:MD_Metadata/gmd:identificationInfo/srv:SV_ServiceIdentification) > 0">
</field>

<section name="gmd:EX_Extent">
<section name="gmd:EX_Extent" displayIfRecord="(count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent[gmd:EX_Extent/gmd:description]) +
count(gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent[gmd:EX_Extent/gmd:geographicElement])) > 0">
<field xpath="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:description"/>
<field xpath="/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:extent/gmd:EX_Extent/gmd:geographicElement"/>
</section>
Expand Down
5 changes: 5 additions & 0 deletions src/main/plugin/iso19139.ca.HNAP/update-fixed-info.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,11 @@
</xsl:copy>
</xsl:template>


<!-- Remove empty extent sections -->
<xsl:template match="gmd:MD_DataIdentification/gmd:extent[count(gmd:EX_Extent/*) = 0]" />


<xsl:template match="@xsi:schemaLocation">
<xsl:if test="XslUtil:getSettingValue('system/metadata/validation/removeSchemaLocation') = 'false'">
<xsl:copy-of select="."/>
Expand Down

0 comments on commit 1a56fb7

Please sign in to comment.