etf-validator / etf-webapp

:earth_africa: :mag: ETF is an open source testing framework for spatial data and services
https://www.etf-validator.net
European Union Public License 1.2
19 stars 19 forks source link

ETF fails to properly load an XSD (cannot resolve name to a component) #181

Closed thijsbrentjens closed 2 years ago

thijsbrentjens commented 5 years ago

Prerequisites for a bug report

Description

A test for XSD validation using this schema: http://register.geostandaarden.nl/xmlschema/imgeo/1.1.1/imgeo0300/verticaal/imgeo0300_msg_verticaal.xsd can't be run, because the XSD validation step fails to load all XSDs. Error reported:

XML document 'Amersfoort_StUF_registratief.xml': http://register.geostandaarden.nl/xmlschema/imgeo/1.1.1/bg0310/entiteiten/bg0310_simpleTypes.xsd, 50:58: src-resolve: Cannot resolve the name 'StUF:NPSGroepen' to a(n) 'type definition' component.

Note that schema validation using this xsd works in (some) XML tools and in ETF v1.

Operating systems and browser

Steps to Reproduce

See the beta version of Geonovum's ETF v2 online: http://beta.validatie.geostandaarden.nl/etf-webapp-2.0.0/

  1. choose validator: "Schema validatie voor StUF-Geo IMGeo versie 1.1.1 BGT"
  2. use attached file for testing (change extension to .xml first) testfile-loading-xsd-fails.txt
  3. Start validation

Expected behavior: A working XSD validation testcase

Actual behavior: XSD validation is not perfomed, because loading the XSDs fails.

It could be related to the imports in the XSD: there are multiple imports for the same namespace. Xerces has an option to load all imports (by default only the first is loaded for a namespace): http://xerces.apache.org/xerces2-j/features.html, see option http://apache.org/xml/features/honour-all-schemaLocations

cportele commented 5 years ago

I have not looked at the import/include graph, but if the current xml parser (BaseX uses the built-in parser of Java) raises an error there is probably not much that we can do about this until we add support for other parsers, pre-defined schemas, etc again in ETF v2 (it was supported in ETF v1). This is planned for next year.

thijsbrentjens commented 5 years ago

Thanks for the quick reply @cportele . I guessed that Xerces is in use by BaseX, because it's one of the libs in the etf-webapp. That's why I suggested this.

Do you have any idea when in next year this might be done (no obligations)? We need to make an estimate now how to deal with this at Geonovum.

jonherrmann commented 2 years ago

Implemented in Version 2.1 via EIP-49