Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation of the document against schemas specified in xsi:schemaLocation fails #55

Closed
MichalMed opened this issue May 12, 2017 · 3 comments

Comments

@MichalMed
Copy link

Validation of the data of addresses (http://services.cuzk.cz/gml/inspire/ad/epsg-4258/547981.zip) raises error on gmlas.b.2 - validate XML documents:

The dataset has 1 file(s) with errors for this assertion.
XML document '547981.xml': The file has 1 schema validation error(s).
XML document '547981.xml': 1:636: cvc-elt.1.a: Cannot find the declaration of element 'base:SpatialDataSet'.

Element is declared in baseTypes present in xsi:schemaLocation:

<base:SpatialDataSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml/3.2"
  xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ad="http://inspire.ec.europa.eu/schemas/ad/4.0"
  xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0" xmlns:gco="http://www.isotc211.org/2005/gco"
  gml:id="AD.SD.547981"
  xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd  
  http://inspire.ec.europa.eu/schemas/ad/4.0 http://inspire.ec.europa.eu/schemas/ad/4.0/Addresses.xsd"
  xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3">

What is wrong?

@jonherrmann
Copy link
Collaborator

Thank you for reporting this issue. We will check it.

Internal notes:
Libxml reports an error:

System ID: 547981.xml
Main validation file: 547981.xml
Schema: http://schemas.opengis.net/wfs/2.0/wfs.xsd
Engine name: LIBXML
Severity: error
Description: element SpatialDataSet: Schemas validity error : Element '{http://inspire.ec.europa.eu/schemas/base/3.3}SpatialDataSet': No matching global declaration available for the validation root.
Start location: 2:0

Saxon-EE does not report an error.

Ref Report
http:// ETF SNAPSHOT VERSION /etf-webapp/v2/TestRuns/EID50fb0db1-31a0-4300-b34e-e267118f9d9e.html#EID0eaac0f2-9ab3-44ab-9f02-4ee0a1587d14

@cportele
Copy link
Collaborator

The cause is likely a result of the XML Schema rules for accessing XML Schema documents (https://www.w3.org/TR/xmlschema-1/#schema_reference). The namespace of the root element must be one of the namespaces in the xsi:schemaLocation attribute, if xsi:schemaLocation is used to locate the XML Schema documents.

In your case, only the namespaces http://www.opengis.net/wfs/2.0 and http://inspire.ec.europa.eu/schemas/ad/4.0 are listed, but not http://inspire.ec.europa.eu/schemas/base/3.3.

Either changing the root element to wfs:FeatureCollection or adding the http://inspire.ec.europa.eu/schemas/base/3.3 namespace to the xsi:schemaLocation attribute should work.

@MichalMed
Copy link
Author

Thanks, it worked. Problem is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants