Reputation: 13
I received a bunch of xsd files from the government, but using them to communicate to their servers, we receive an empty answer. There is no feedback, so we do not know what we are doing wrong.
When I validate their xsd files, they produce following error: Line 17: Can not find declaration of element 'xsd:schema'.
Does anyone of the smart guys here see what is wrong?
The xsd file: http://dimoweb.com/4aps/xsd/ehealth-kmehr/XSD/kmehr-1_8.xsd
The validation outcome: http://www.validome.org/xml/validate/?lang=en&viewSourceCode=1&url=http://dimoweb.com/4aps/xsd/ehealth-kmehr/XSD/kmehr-1_8.xsd
First 18 lines of the xsd file:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- edited with XMLSpy v2009 (http://www.altova.com) by Smals-MVM ASBL/VZW (Smals-MVM ASBL/VZW) -->
<!--
Kmehr-Bis Message: types
XSchema
-->
<xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:DT="http://www.ehealth.fgov.be/standards/kmehr/dt/v1"
xmlns:CD="http://www.ehealth.fgov.be/standards/kmehr/cd/v1"
xmlns:ID="http://www.ehealth.fgov.be/standards/kmehr/id/v1"
xmlns:sig="http://www.w3.org/2000/09/xmldsig#"
xmlns:enc="http://www.w3.org/2001/04/xmlenc#"
xmlns="http://www.ehealth.fgov.be/standards/kmehr/schema/v1"
targetNamespace="http://www.ehealth.fgov.be/standards/kmehr/schema/v1"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.8">
<xsd:import namespace="http://www.ehealth.fgov.be/standards/kmehr/cd/v1" schemaLocation="cd-1_8.xsd"/>
Many thanks in advance!
Upvotes: 1
Views: 303
Reputation: 111541
Can not find declaration of element 'xsd:schema'
This error indicates that you're trying to validate the XSDs themselves. There's nothing wrong with being defensive, of course, but your first suspicion should probably be about the validity of your XML request against these XSDs, not the XSDs themselves. See How to validate a xml schema if you really want to validate the XSDs themselves. The error message above only indicates that the meta XSD (Schema for Schemas) was never found; your XSD validation never got started.
If the XSDs truly aren't valid, have a conversation with their owners and request corrections.
Assuming that the XSDs themselves are valid, and this is really where you should start as a novice, validate your request against those XSDs. The error messages you receive should be sufficient to repair your request. (If not, search the error message and receive clues from other posts. Only if this too doesn't help should you ask for help about about your validation error.)
BTW, the service should have replied with an error response indicating the failure reason, but you can't always count on this, which makes client-side validation of the request all the more important.
Upvotes: 1