INSPIRE-MIF / helpdesk-validator

Community discussion forum for INSPIRE validation issues
41 stars 22 forks source link

FeatureCollection for INSPIRE Theme AM #1054

Closed HelmoetOrdina closed 3 months ago

HelmoetOrdina commented 3 months ago

Hi, I am struggeling validating my INSPIRE AMGWBG gml document.

First, validation tells me:

XML document 'inspire-pv-am.nlam-gwbg.gml': 1:1219: cvc-elt.1.a: Cannot find the declaration of element 'gml:FeatureCollection'.

The input file uses as xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/am/4.0 http://inspire.ec.europa.eu/schemas/am/4.0/AreaManagementRestrictionRegulationZone.xsd"

I tried to fix it by appending http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/deprecatedTypes.xsd to xsi:schemaLocation, as suggested in this post.

However, the INSPIRE Reference Validator now complains:

XML document 'inspire-pv-am.nlam-gwbg.gml': 9:103: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://inspire.ec.europa.eu/schemas/am/4.0":ManagementRestrictionOrRegulationZone}'. One of '{"http://www.opengis.net/gml/3.2":AbstractFeature}' is expected.

I suspect that I’m using an old and deprecated FeatureCollection, but where to find the current XSD? Is this indeed about the FeatureCollection?

Really a lot of thanks for responding. 20240321_0921_validation_result.zip

fabiovinci commented 3 months ago

Dear @HelmoetOrdina,

I confirm that you need to add the gml schema in the schemaLocation attribute to avoid the error "'Cannot find the declaration of element 'gml:FeatureCollection'."

Please consider that in your second gml file (20240326_0757_inspire-pv-am.nlam-gwbg.gml) there is an error in the namespace:

image

so the rigth nameSpace value should be:

xsi:schemaLocation="http://inspire.ec.europa.eu/schemas/am/4.0 http://inspire.ec.europa.eu/schemas/am/4.0/AreaManagementRestrictionRegulationZone.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd">

In this way, all the mentioned errors are no longer present: https://inspire.ec.europa.eu/validator/test-run/details.html?id=EID79373994-fe5c-4468-934a-d8c8fb65b821

HelmoetOrdina commented 3 months ago

I feel astonishing embarrassed, such a simple mistake, taking so long time for me to fix. 🫢 Thank you very much.