metadata101 / iso19139.rndt

1 stars 7 forks source link

Metadata editor creates an empty topicCategory tag (dataset - rndt) #25

Closed silvia-starnini closed 2 years ago

silvia-starnini commented 2 years ago

Using metadata editor on rndt dataset, the metadata XML is filled with empty topicCategory tag like the following:

<gmd:topicCategory>        
    <gmd:MD_TopicCategoryCode>farming</gmd:MD_TopicCategoryCode>
</gmd:topicCategory>
<gmd:topicCategory/>      <!-- this empty tag is a problem for RNDT validation-->

The wrong empty tag seems to be added :

procino commented 2 years ago

Dear support, I've the same problem on geonetwork v.3.10.4 May I have feedback on this Issue?

nancyva commented 2 years ago

I also have the same problem, has anyone solved it?

etj commented 2 years ago

It seems that the element is internally added, here the relevant log

Log ``` 2022-07-15 18:55:24,280 DEBUG [geonetwork.editoraddelement] - Inserting at location gmd:identificationInfo/*/gmd:topicCategory th e snippet or value org.fao.geonet.kernel.AddElemValue@50e407cc 2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - 1 element matching XPath found. 2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - Inserting at location gmd:identificationInfo/*/gmd:topicCategory th e snippet or value org.fao.geonet.kernel.AddElemValue@3675cef1 2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - 0 element matching XPath found. 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - Check if gmd:topicCategory exists in MD_DataIdentification 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - > add new node gmd:topicCategory inserted in MD_DataIdentification 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### in addElement() 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parent = MD_DataIdentification 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child name = topicCategory 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child namespace = http://www.isotc211.org/2005/gmd 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child prefix = gmd 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parents first child = Optional[[Element: ]] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child qname = gmd:topicCategory 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parent name for type retrieval = root 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - type name = gmd:MD_DataIdentification_Type 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - metadata type = IsOrType = FALSE gmd:citation/1-1 gmd:abstra ct/1-1 gmd:purpose/0-1 gmd:credit/0-n gmd:status/0-n gmd:pointOfContact/0-n gmd:resourceMaintenance/0-n gmd:graphicOverview/0-n g md:resourceFormat/0-n gmd:descriptiveKeywords/0-n gmd:resourceSpecificUsage/0-n gmd:resourceConstraints/0-n gmd:aggregationInfo/0 -n gmd:spatialRepresentationType/0-n gmd:spatialResolution/0-n gmd:language/1-n gmd:characterSet/0-n gmd:topicCategory/0-n gmd:en vironmentDescription/0-1 gmd:extent/0-n gmd:supplementalInformation/0-1 Attributes: Attribute (0) id: Default Value: nullAttribu te (1) uuid: Default Value: null 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:citation, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:abstract, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:purpose, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:credit, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:status, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:pointOfContact, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:resourceMaintenance, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:graphicOverview, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:resourceFormat, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:descriptiveKeywords, list size = 2 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:resourceSpecificUsage, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:resourceConstraints, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:aggregationInfo, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:spatialRepresentationType, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:spatialResolution, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:language, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:characterSet, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:topicCategory, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:environmentDescription, list size = 0 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:extent, list size = 2 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child of type gmd:supplementalInformation, list size = 1 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - add child [Element: ] 2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - > add boundaries ```

This also happens on plain 19139 schema plugin, where this extra element is being taken care of in the update-fixed-info.xsl,

  <xsl:template
    match="gmd:topicCategory[not(gmd:MD_TopicCategoryCode)]"
    priority="10" />

We're going to solve this in the same way.

fxprunayre commented 2 years ago

See also https://github.com/geonetwork/core-geonetwork/pull/6239 "Editing fix" section (but the update-fixed-info.xsl works fine too).

etj commented 2 years ago