Changeset 13699 in josm


Ignore:
Timestamp:
2018-05-02T22:48:35+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #16248 - fix parsing of XML namespace in WMS capabilities (patch by Bartosz Firyn, modified)

Location:
trunk
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java

    r13398 r13699  
    3434
    3535import org.openstreetmap.josm.data.Bounds;
     36import org.openstreetmap.josm.data.imagery.GetCapabilitiesParseHelper;
    3637import org.openstreetmap.josm.data.imagery.ImageryInfo;
    3738import org.openstreetmap.josm.data.projection.Projections;
     
    347348            child = getChild(child, "OnlineResource");
    348349            if (child != null) {
    349                 String baseURL = child.getAttribute("xlink:href");
     350                String baseURL = child.getAttributeNS(GetCapabilitiesParseHelper.XLINK_NS_URL, "href");
    350351                if (!baseURL.equals(serviceUrlStr)) {
    351352                    URL newURL = new URL(baseURL);
  • trunk/test/unit/org/openstreetmap/josm/io/imagery/WMSImageryTest.java

    r13274 r13699  
    5656        }
    5757    }
     58
     59    /**
     60     * Non-regression test for bug #16248.
     61     * @throws IOException if any I/O error occurs
     62     * @throws WMSGetCapabilitiesException never
     63     */
     64    @Test
     65    public void testTicket16248() throws IOException, WMSGetCapabilitiesException {
     66        try (InputStream is = TestUtils.getRegressionDataStream(16248, "capabilities.xml")) {
     67            WMSImagery wms = new WMSImagery();
     68            wms.parseCapabilities(null, is);
     69            assertEquals("http://wms.hgis.cartomatic.pl/topo/3857/m25k", wms.getServiceUrl().toExternalForm());
     70        }
     71    }
    5872}
Note: See TracChangeset for help on using the changeset viewer.