Opened 14 years ago

Closed 14 years ago

#304 closed defect (fixed)

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 (2)

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

Download all attachments as: .zip

Change History (4)

by JoshVote, 14 years ago

Attachment: gn-xslt-fix.patch added

comment:1 by Fxp, 14 years ago

Milestone: v2.5.1v2.6.0 RC2
Owner: changed from geonetwork-devel@… to Fxp
Status: newassigned

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.

by Fxp, 14 years ago

Attachment: wfs-local-name.patch added

comment:2 by Fxp, 14 years ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.