[CITE-Forum] Validation problems with Discovery Service Schema

Lorenzo Bigagli lorenzo.bigagli at pin.unifi.it
Mon Sep 26 09:02:38 EDT 2011

Hi Janis,

I can reproduce the reported behavior in my XML validator (Oxygen), and I confirm that the gmd:MD_Metadata element declaration is not provided by the imported schema (CSW-discovery.xsd).

Note that, as per XML Schema specification (http://www.w3.org/TR/xmlschema-1/, §4), "processors are responsible for providing the schema components (definitions and declarations) needed for assessment".
In our case, this means that it is on us to appropriately configure our validation engines, so that all the schema components are available.

A way to do that is to _add_ the following to the xsl:schemaLocation attribute in the csw:GetRecordsResponse:
	http://www.isotc211.org/2005/gmd  http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd

If you do this, your validator should not complain about the missing elements anymore (you should have other validation errors, though).

The specification also says that "On the other hand, in case a document author (human or not) created a document with a particular schema in view, and warrants that some or all of the document conforms to that schema, the schemaLocation and noNamespaceSchemaLocation [attributes] [...] are provided".
Hence, you may want to suggest to the provider of the data to add the following to the xsl:schemaLocation attribute:
	http://www.isotc211.org/2005/gmd  http://schemas.opengis.net/csw/2.0.2/profiles/apiso/1.0.0/apiso.xsd

Hope this helps,

Il giorno 23/set/2011, alle ore 09.14, Janis Blank ha scritto:

> Hi all,
> I have a most perculiar problem with the CSW Discovery Service schema at http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd
> Everytime, I try to validate a getRecords response against it, the following validation error occurs:
> Altova XMLSpy:
> While validating against complex type 'csw:SearchResultsType', element <gmd:MD_Metadata> matched wildcard {any except http://www.opengis.net/cat/csw/2.0.2} but no element declaration was found.
> Error location: env:Envelope / env:Body / csw:GetRecordsResponse / csw:SearchResults / gmd:MD_Metadata
> Details
> cvc-wildcard.2: While validating against complex type 'csw:SearchResultsType', element <gmd:MD_Metadata> matched wildcard {any except http://www.opengis.net/cat/csw/2.0.2} but no element declaration was found.
> cvc-elt.5.2.1: The element <csw:SearchResults> is not valid with respect to the actual type definition 'csw:SearchResultsType'.
> Apache Xalan 2.6.0:
> cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'gmd:MD_Metadata'.
> They are seemingly right, I can't find this element either, but the schemaLocation of the response only gives the above reference. See below for an example query (this applies to many other services as well):
> URL: http://ims7.bkg.bund.de:80/geonetwork/srv/en/csw
> Request: (Content-Type=application/soap+xml)
> <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
> <soap:Header/>
> <soap:Body>
> <csw2:GetRecords xmlns:apiso="http://www.opengis.net/cat/csw/apiso/1.0" xmlns:csw2="http://www.opengis.net/cat/csw/2.0.2" xmlns:gmd2="http://www.isotc211.org/2005/gmd" xmlns:ogc2="http://www.opengis.net/ogc" maxRecords="10" outputFormat="application/xml" outputSchema="http://www.isotc211.org/2005/gmd" resultType="results" service="CSW" version="2.0.2">
> <csw2:Query typeNames="gmd2:MD_Metadata">
> <csw2:ElementSetName>summary</csw2:ElementSetName>
> <csw2:Constraint version="1.1.0">
> <ogc2:Filter>
> <ogc2:PropertyIsLike escapeChar="\" singleChar="_" wildCard="%">
> <ogc2:PropertyName>AnyText</ogc2:PropertyName>
> <ogc2:Literal>%</ogc2:Literal>
> </ogc2:PropertyIsLike>
> </ogc2:Filter>
> </csw2:Constraint>
> </csw2:Query>
> </csw2:GetRecords>
> </soap:Body>
> </soap:Envelope>
> Response: (see attachments)
> Regards
> Janis Blank
> -- 
> --------------------------------------
> MSc. in CS Janis Blank
> blank at supportgis.de
> --------------------------------------
> CPA Systems GmbH
> Grantham-Allee 2-8
> D-53757 Sankt Augustin
> Tel.: +49 (0) 2241 / 25 94 – 26
> Fax.: +49 (0) 2241 / 25 94 - 29
> www.cpa-systems.de
> --------------------------------------
> Handelsregister:
> HRB 9706, Amtsgericht Siegburg
> Geschäftsführer:
> Dr.-Ing. habil. Christoph Averdung
> Dr.-Ing. René Thiele
> Dr.-Ing. Matthias Ellsiepen
> <response.xml>_______________________________________________
> CITE-Forum mailing list
> CITE-Forum at lists.opengeospatial.org
> https://lists.opengeospatial.org/mailman/listinfo/cite-forum

Dott. Lorenzo Bigagli
Consiglio Nazionale delle Ricerche
Istituto di Metodologie per l'Analisi Ambientale (CNR-IMAA)

i: Area della Ricerca di Potenza, Contrada Santa Loja
   Zona Industriale, 85050 Tito Scalo (PZ), Italia
t: +39 0971 427221
f: +39 0971 427222
m: lorenzo.bigagli at cnr.it

More information about the CITE-Forum mailing list