Open ZhuoyueZhou-USDA opened 3 years ago
GeoNetwork use https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/schema.xsd when there is no schemaLocation defined in the XML document to validate. If it is defined, then it use it.
For me using schemaLocation="http://standards.iso.org/iso/19115/-3/mdb/2.0 https://schemas.isotc211.org/19115/-3/mdb/2.0/mdb.xsd"
seems consistent with the internal validation.
In your screenshot, errors sound more related to the GML namespace so the XSD validation in itself works ok - maybe you can check that the correct of GML version is used ? Should be GML3.2 https://github.com/geonetwork/core-geonetwork/blob/main/schemas/iso19115-3.2018/src/main/plugin/iso19115-3.2018/schema.xsd#L45. Can be an error with the map widget adding polygons ?
@fxprunayre Thank you for your reply.
In the namespace declaration, it is using gml 3.2.
I have attached a sample metadata record. Here is what I have done.
If I import this record into geonetwork, and did the validation, here is what I get: I wonder if it's because I use geonetwork 3.10.6.
If I change the xsi:schemaLocation to be xsi:schemaLocation="http://standards.iso.org/iso/19115/-3/mds/2.0 http://standards.iso.org/iso/19115/-3/mds/2.0/mds.xsd"
Here is what I get in geonetwork after I click the validate button.
If I remove the xsi:schemaLocation in line 31, and validate again in GeoNetwork. I get a valid response.
If I validate this record against the schema.xsd (in geonetwork schema plugin folder) using Oxygen, I get 'Validation successful' response.
If I validate this record in Oxygen, using 'Apply default validation' option, which means validate against the schema defined in xsi:schemaLocation. Here is the validation error I received:
Describe the bug I have imported several records (iso 19115-3.2018) into geonetwork, they are all showing valid after I have validated them. I disable the inspire validation.![image](https://user-images.githubusercontent.com/5090208/121421744-7dc1b680-c93c-11eb-9238-4dba323e7ba5.png)
However, after I have exported them, and try to validate in Oxygen using 'Apply default validation', I got several errors. In the records, the xsi:schemaLocation was defined as 'xsi:schemaLocation="http://standards.iso.org/iso/19115/-3/mds/2.0 http://standards.iso.org/iso/19115/-3/mds/2.0/mds.xsd" '![image](https://user-images.githubusercontent.com/5090208/121422286-148e7300-c93d-11eb-9569-1f20e8832eb0.png)
I also tried to update the schemaLocation to 'http://standards.iso.org/iso/19115/-3/mdb/2.0 https://schemas.isotc211.org/19115/-3/mdb/2.0/mdb.xsd' based on this commit: https://github.com/geonetwork/core-geonetwork/commit/e0c08312505c0d5d85ec67cfe055c9af7f9c3433![image](https://user-images.githubusercontent.com/5090208/121422415-3851b900-c93d-11eb-815f-a034d34cc794.png)
To Reproduce Steps to reproduce the behavior:
Expected behavior The validation results in GeoNetwork should be the same as validate against the official schema.
Screenshots If applicable, add screenshots to help explain your problem.
Log file If applicable, add the server log file to help trace your problem.
Desktop (please complete the following information):