geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
416 stars 487 forks source link

INSPIRE view errors if multiple gmd:transferOptions or gmd:dataQualityInfo #1925

Closed josegar74 closed 7 years ago

josegar74 commented 7 years ago

Metadata with the these elements:

      <gmd:transferOptions>
        <gmd:MD_DigitalTransferOptions>
          <gmd:unitsOfDistribution gco:nilReason="missing">
            <gco:CharacterString />
          </gmd:unitsOfDistribution>
          <gmd:transferSize>
            <gco:Real>2000</gco:Real>
          </gmd:transferSize>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>http://www.maanmittauslaitos.fi/digituotteet/korkeusmalli-2-m</gmd:URL>
              </gmd:linkage>
            </gmd:CI_OnlineResource>
          </gmd:onLine>
        </gmd:MD_DigitalTransferOptions>
      </gmd:transferOptions>
      <gmd:transferOptions>
        <gmd:MD_DigitalTransferOptions />
      </gmd:transferOptions>

Causes this error:

Error on line 669 of form-configurator.xsl:
  XTTE0790: A sequence of more than one item is not allowed as the second argument of
  gn-fn-metadata:getLabel() ("gmd:onLine", "gmd:onLine") 
2017-03-06 21:13:24,348 ERROR [jeeves] - Error occurred within a transaction
; SystemID: file:///XXXXX/xslt/ui-metadata/edit/../form-configurator.xsl; Line#: 669; Column#: -1
net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the second argument of gn-fn-metadata:getLabel() ("gmd:onLine", "gmd:onLine") 

Related to this add action in config-editor.xml: https://github.com/geonetwork/core-geonetwork/blob/3.2.x/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml#L430


For several gmd:dataQualityinfo sections with gmd:report, the following error happens:

2017-03-06 21:03:16,196 ERROR [jeeves] - Error occurred within a transaction
; SystemID: file:///XXXXX/xslt/ui-metadata/edit/../form-configurator.xsl; Line#: 669; Column#: -1
net.sf.saxon.trans.XPathException: A sequence of more than one item is not allowed as the second argument of gn-fn-metadata:getLabel() ("gmd:report", "gmd:report") 
        at net.sf.saxon.expr.Expression.typeError(Expression.java:981)

Related to this add action in config-editor.xml: https://github.com/geonetwork/core-geonetwork/blob/3.2.x/schemas/iso19139/src/main/plugin/iso19139/layout/config-editor.xml#L1009-L1012


Tested in 3.2.1, in previous versions seemed fine. But the actions seem not changed, so probably some difference in form-configurator.xsl or any xsl from iso19139 used in the metadata editor.

josegar74 commented 7 years ago

Seem related to this commit: https://github.com/geonetwork/core-geonetwork/commit/a525d12667903d5d0ba847167891a4a8a299bb1d#diff-848d59be6dc3b410961b45a27f0fe071 where was added some extra stuff for button labels, but seem not dealing well with previous cases described.

Reverting previous form-configurator.xsl fixes the issue. To check for a fix that manages the changes properly.