I am a very beginner in GIS and have the following problem I couldn't resolve yet. I have an XSD schema and an XML document I want to validate against the schema. As expected the XML isn't valid yet, the error saying
The content of the element '{http://www.bafg.de/namespace/dwd/2009}GeneralInformation' is with regard to the overarching element '{http://www.opengis.net/gml}featureMember' not valid. Expected: {http://www.opengis.net/gml}_Feature.
Here is my XSD schema:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:dwd="http://www.bafg.de/namespace/dwd/2009" xmlns:gml="http://www.opengis.net/gml" targetNamespace="http://www.bafg.de/namespace/dwd/2009" elementFormDefault="qualified" version="0.4">
<import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
<element name="GeneralInformation" type="dwd:GeneralInformationType" substitutionGroup="gml:_Feature"/>
<complexType name="GeneralInformationType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="ReportType" type="gml:CodeType"/>
<element name="CountryStateCode" type="gml:CodeType"/>
<element name="Year" type="gYear"/>
<element name="TotalPopulation" type="double"/>
<element name="NumberWSZ" type="integer"/>
<element name="Groundwater" type="double"/>
<element name="Surfacewater" type="double"/>
<element name="Inlandwater" type="double"/>
<element name="Coastalwater" type="double"/>
<element name="Bankfiltrationwater" type="double"/>
<element name="ArtificialGrondwaterRecharge" type="double"/>
<element name="Rainwater" type="double"/>
<element name="Otherwater" type="double"/>
<element name="WebsiteAddress" type="anyURI" maxOccurs="unbounded"/>
<element name="ResponsibleAuthority" type="string"/>
<element name="Name" type="string"/>
<element name="Address" type="string"/>
<element name="City" type="string" minOccurs="0"/>
<element name="Telephone" type="string"/>
<element name="Fax" type="string"/>
<element name="Email" type="string"/>
<element name="NoAnnualMonitoringReport" type="boolean"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="GeneralInformationPropertyType">
<sequence minOccurs="0">
<element ref="dwd:GeneralInformation"/>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
</complexType>
</schema>
And here the XML file showing the error (and I am supposed to modify according to the schema):
<?xml version="1.0" encoding="UTF-8"?>
<gml:FeatureCollection gml:id="Trinkwaser_NRW.xml" xsi:schemaLocation="http://www.bafg.de/namespace/dwd/2009 Schema.xsd http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/base/gml.xsd" xmlns:dwd="http://www.bafg.de/namespace/dwd/2009" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<gml:featureMember>
<dwd:GeneralInformation gml:id="GeneralInformation_1">
<dwd:ReportType>DWD_1000</dwd:ReportType>
<dwd:CountryStateCode>Nordrhein-Westfalen</dwd:CountryStateCode>
<dwd:Year>2013</dwd:Year>
<dwd:TotalPopulation>3.4</dwd:TotalPopulation>
<dwd:NumberWSZ>56</dwd:NumberWSZ>
<dwd:Groundwater>90</dwd:Groundwater>
<dwd:Surfacewater>5</dwd:Surfacewater>
<dwd:Inlandwater>5</dwd:Inlandwater>
<dwd:Coastalwater>0</dwd:Coastalwater>
<dwd:Bankfiltrationwater>3</dwd:Bankfiltrationwater>
<dwd:ArtificialGrondwaterRecharge>0</dwd:ArtificialGrondwaterRecharge>
<dwd:Rainwater>2</dwd:Rainwater>
<dwd:Otherwater>0</dwd:Otherwater>
<dwd:WebsiteAddress>http://www.trinkwasser_nrw.de</dwd:WebsiteAddress>
<dwd:ResponsibleAuthority>Landesgesundheitsamt NRW</dwd:ResponsibleAuthority>
<dwd:Address>Musterstraße 1</dwd:Address>
<dwd:City>12345 Musterstadt</dwd:City>
<dwd:Telephone>123456</dwd:Telephone>
<dwd:Fax>654321</dwd:Fax>
<dwd:Email>[email protected]</dwd:Email>
<dwd:NoAnnualMonitoringReport>true</dwd:NoAnnualMonitoringReport>
</dwd:GeneralInformation>
</gml:featureMember>
</gml:FeatureCollection>
I don't see the problem, since in the schema the substitutiongroup for "gml:_Feature" is given. What do I need to change?