Ticket #304 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

WFS Harvester XSLT bug

Reported by: JoshVote Owned by: Fxp
Priority: major Milestone: v2.6.0
Component: General Version: v2.5.0
Keywords: harvester xslt Cc:

Description

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" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs  http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"> ...

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" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs  http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"> ...

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

Attachments

gn-xslt-fix.patch Download (1.7 KB) - added by JoshVote 3 years ago.
wfs-local-name.patch Download (2.5 KB) - added by Fxp 3 years ago.

Change History

Changed 3 years ago by JoshVote

Changed 3 years ago by Fxp

  • owner changed from geonetwork-devel@… to Fxp
  • status changed from new to assigned
  • milestone changed from v2.5.1 to v2.6.0 RC2

Issue is that namespace for WFS 1.0.0 and 1.1.0 are equal. So a check on version is required.

Do you have WFS public URL to test ? If not could you try the patch attached.

I've been testing against GeoServer? and Mapserver using 1.0.0 and 1.1.0 version.

Thanks.

Changed 3 years ago by Fxp

Changed 3 years ago by Fxp

  • status changed from assigned to closed
  • resolution set to fixed

r6576

Note: See TracTickets for help on using tickets.