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

Fixing WMS1.1.1 getcapabilities XML parsing error #4861

Closed
wants to merge 1 commit into from

Conversation

pmauduit
Copy link
Contributor

@pmauduit 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.

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.
@tbonfort
Copy link
Member

tbonfort commented Feb 7, 2014

cc/ @aeichner

@aeichner
Copy link
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
Copy link
Member

Schpidi commented Feb 7, 2014

I'm looking into this right now.

@Schpidi Schpidi self-assigned this Feb 7, 2014
@Schpidi
Copy link
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
Copy link
Contributor Author

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
Copy link
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
Copy link
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
Copy link
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
Copy link
Contributor Author

pmauduit commented Feb 11, 2014

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

@ejn
Copy link
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
Copy link
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 added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Feb 11, 2014
Schpidi added a commit to MapServer/msautotest_DEPRECATED that referenced this pull request Feb 11, 2014
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants