Fixing WMS1.1.1 getcapabilities XML parsing error #4861

Closed
wants to merge 1 commit into
from

Projects

None yet

5 participants

@pmauduit
Contributor
pmauduit commented Feb 6, 2014

A xml prefix (xsi) is missing in the WMS1.1.1 getcapabilities request with INSPIRE activated, causing mapserver to generate XML which cannot pass the libxml2 validation.

Tested manually with the code compiled from master:

% xmllint insp_vanilla.xml 1> /dev/null
insp_vanilla.xml:129: namespace error : Namespace prefix xsi for type on MandatoryKeyword is not defined
on:MandatoryKeyword xsi:type='inspire_common:classificationOfSpatialDataService'
                                                                               ^

Same generated xml with patched code does not print out the previous validation
error.

This error has been reported on the mailing list, see:
http://lists.osgeo.org/pipermail/mapserver-users/2014-January/075965.html
for more details.

@pmauduit pmauduit Fixing WMS1.1.1 getcapabilities XML parsing error
A xml prefix (xsi) is missing in the WMS1.1.1 getcapabilities request
with INSPIRE activated, causing mapserver to generate XML which cannot
pass the libxml2 validation.

Tested manually with vanilla code:

% xmllint insp_vanilla.xml 1> /dev/null
insp_vanilla.xml:129: namespace error : Namespace prefix xsi for type on
MandatoryKeyword is not defined
on:MandatoryKeyword
xsi:type='inspire_common:classificationOfSpatialDataService'
                                                                               ^

Same generated xml with patched code does not print out the previous validation
error.

This error has been reported on the mailing list, see:
http://lists.osgeo.org/pipermail/mapserver-users/2014-January/075965.html
for more details.
acfda31
@tbonfort
Member
tbonfort commented Feb 7, 2014

cc/ @aeichner

@aeichner
Contributor
aeichner commented Feb 7, 2014

Should also contain xsi:type to declare the xsi:type attribute like it is done for inspire_common:Keyword in the following line? The possible values for this attribute are declared there, too.
The DTD part should probably read as:

<!ATTLIST inspire_common:MandatoryKeyword
    xmlns:inspire_common CDATA #FIXED "http://inspire.ec.europa.eu/schemas/common/1.0"
    xmlns:xsi CDATA #FIXED "http://www.w3.org/2001/XMLSchemainstance"
    xsi:type (inspire_common:classificationOfSpatialDataService) #IMPLIED
>

Other valid values (if any) should be listed also.

@Schpidi
Member
Schpidi commented Feb 7, 2014

I'm looking into this right now.

@Schpidi Schpidi self-assigned this Feb 7, 2014
@Schpidi
Member
Schpidi commented Feb 7, 2014

@pmauduit which version of libxml2 are you using? Can't reproduce using 2.8.0. Anyway, it also validates with the addition. I'll update the DTD as @aeichner suggests, also in msautotest and backport it.

@pmauduit
Contributor
pmauduit commented Feb 7, 2014

@Schpidi I'm using the one from Ubuntu 13.04:

ii  libxml2:amd64                             2.9.0+dfsg1-4ubuntu4.3                     amd64        GNOME XML library

Anyway, I was able to reproduce the xml validation error into a vagrant debian 7 with libxml 2.8.0 (from the distro)

@Schpidi
Member
Schpidi commented Feb 7, 2014

@pmauduit ok, I'm now also in a vagrant debian 7 and still get no error :( can you try to run xmllint against wms_inspire_cap_111.xml in msautotest/wxs/expected

@aeichner
Contributor
aeichner commented Feb 7, 2014

Why does MapServer actually output xsi:type="inspire_common:classificationOfSpatialDataService" as attribute to MandatoryKeyword? IMHO this is not neccassary as MandatoryKeyword already has the non-abstract type classificationOfSpatialDataService.
After diving into the INSPIRE schema I would suggest to simply ommit the xsi:type from the instance document and from the DTD. The namespace declarations should be unneccassary in this case.
BTW: What's the reason to publish a DTD in the instance document and not simply referring to the INSPIRE schema document?

@Schpidi
Member
Schpidi commented Feb 11, 2014

@aeichner I didn't find and still don't find the DTD for the INSPIRE stuff online. That's the reason why it is included directly.
@pmauduit any objections to removing the xsi:type attribute as suggested?

@pmauduit
Contributor

@Schpidi I don't have any objection as long as it can fix the validation issue

@ejn
Contributor
ejn commented Feb 11, 2014

My guess is that there is no DTD for the INSPIRE parts, only XSD. To be fair, INSPIRE is basing everything on WMS 1.3.0, which is only specified with XSD and not DTD - a WMS 1.1.0 can in any case - so far as I am aware - never be a valid INSPIRE View Service.

@Schpidi
Member
Schpidi commented Feb 11, 2014

@ejn I agree that WMS 1.3.0 is more often used but according to the INSPIRE specification WMS 1.1.1 is perfectly valid as well and there is the DTD available in the specification but not in the schemas repository.

@Schpidi Schpidi added a commit to mapserver/msautotest_DEPRECATED that referenced this pull request Feb 11, 2014
@Schpidi Schpidi Adding WMS 1.1.1 tests for INSPIRE scenario 2 (mapserver/mapserver#4861
…).
62fa7ac
@Schpidi Schpidi added a commit to mapserver/msautotest_DEPRECATED that referenced this pull request Feb 11, 2014
@Schpidi Schpidi Adding WMS 1.1.1 tests for INSPIRE scenario 2 (mapserver/mapserver#4861
…).
3d6213e
@Schpidi Schpidi closed this in b49c847 Feb 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment