Uploaded image for project: 'GeoTools'
  1. GeoTools
  2. GEOT-5538

Preceding space in schemalocation declaration breaks parsing

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 15.2, 16-M0
    • Fix Version/s: 16.2
    • Component/s: xml
    • Labels:
      None

      Description

      When trying to parse the GetFeature response from a server, we get the
      error: "Bad Schema location attribute: you must have an even number of
      terms". Upon inspecting the response we find:

      <gml:FeatureCollection
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation=" http://www.risicokaart.nl/schemas/isor
      http://servicespub.risicokaart.nl/rk_services_pub/services/WFS-risicokaart?SERVICE=WFS&amp;VERSION=1.0.0&amp;REQUEST=DescribeFeatureType&amp;OUTPUTFORMAT=XMLSCHEMA&amp;TYPENAME=isor:kwetsbaarobject_ziekenhuis">

      It's a bit hard to spot, but there is a space before the first element
      in the xsi:schemaLocation. I guess that this is not correct, but real
      life implementations rarely are . The fix is quite easy: a trim of
      the value would fix this.

      I've created the fix (including a testcase) on:
      https://github.com/mtoonen/geotools/tree/extraSpaceBreaksParsing, and it
      fixes the problem for me.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mtoonen Meine Toonen
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: