[GeoNetwork-devel] [GeoNetwork opensource Developer website] #304: WFS Harvester XSLT bug

#304: WFS Harvester XSLT bug
----------------------------+-----------------------------------------------
Reporter: JoshVote | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.5.1
Component: General | Version: v2.5.0
Keywords: harvester xslt |
----------------------------+-----------------------------------------------
My 2.4.2 / 2.4.3 geonetwork instance is failing to harvest the
MD_Metadata/distributionInfo/MD_Distribution/ transferOptions/
MD_DigitalTransferOptions/onLine/CI_OnlineResource/linkage/URL from some
of my WFS’s (all version 1.1.0).

I did a bit of digging and it looks like it’s because the root element of
the ‘faulty’ WFS GetCapabilities response is defined with no prefix (See
below).

<WFS_Capabilities xmlns="http://www.opengis.net/wfs&quot; version="1.1.0"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
...

Whereas the WFS’s that are being harvested correctly all specify the root
element as

<wfs:WFS_Capabilities xmlns:wfs="http://www.opengis.net/wfs&quot;
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd&quot;&gt;
...

From what I can tell both are valid XML so I started to think it may be a
bug with GN. Having a look at geonetwork/xsl/conversion/import
/OGCWxSGetCapabilities-to-ISO19119_ISO19139.xsl there is a section that
tests

test="name(.)='wfs:WFS_Capabilities' or name(.)='wps:Capabilities'"

Which is only testing the Prefix name, not the actual namespace URI that
the prefix is representing. It should really read something like the
following (I’m no XSLT expert so there may be a more succinct way of doing
this...)

test="local-name(.)='WFS_Capabilities' and namespace-
uri(.)='http://www.opengis.net/wfs’ or local-name(.)='Capabilities' and
namespace-uri(.)='http://www.opengeospatial.net/wps’"

I’ve attached a patch of this change, I haven’t searched for any other
instances of this issue...

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/304&gt;
GeoNetwork opensource Developer website <http://trac.osgeo.org/geonetwork&gt;
GeoNetwork opensource is a standards based, Free and Open Source catalog application to manage spatially referenced resources through the web. It provides powerful metadata editing and search functions as well as an embedded interactive web map viewer. This website contains information related to the development of the software.