[GeoNetwork-devel] [GeoNetwork opensource Developer website] #724: CSW / ElementName

#724: CSW / ElementName
--------------------------------------------------+-------------------------
Reporter: heikki | Owner: geonetwork-devel@…
     Type: defect | Status: new
Priority: major | Milestone: v2.7.0
Component: General | Version: v2.6.4
Keywords: csw getrecords elementname typenames |
--------------------------------------------------+-------------------------
This CSW query does not work in trunk (was working in 2.6 series):

<?xml version="1.0"?>
<csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2&quot;
service="CSW" version="2.0.2" resultType="results" maxRecords="100"
outputSchema="csw:IsoRecord">
    <csw:Query typeNames="gmd:MD_Metadata">
<csw:ElementName>/gmd:MD_Metadata/gmd:fileIdentifier</csw:ElementName>
<csw:ElementName>/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code</csw:ElementName>
<csw:ElementName>/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:title</csw:ElementName>
<csw:ElementName>/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:date/gmd:CI_Date/gmd:dateType/gmd:CI_DateTypeCode/@codeListValue="publication"</csw:ElementName>
<csw:ElementName>/gmd:MD_Metadata/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions</csw:ElementName>
    </csw:Query>
</csw:GetRecords>

Discussed with FXP and the spec (OGC 07-006) is inconsistent with the
ISO19139 XSD, and otherwise incomplete. According to the XSD, ElementName
is a QName, so cannot be an XPATH; but according to OGC 07-006 it must be
XPATH.. Also the spec is not clear about what to do with typeNames in all
situations.

Agreed with FXP that we

* allow for XPATH in !ElementName (even if this violates the XSD)

* handle typeNames as follows :

a) if !ElementName starts with "/", do a XPATH against the root of the
document -- typeNames is ignored in this case

b) if not, and there is one typeName, do a XPATH against the typeName, ie
//typeName/elementName

c) if not, and there are more than one typeName, do a XPATH against the
typeNames, ie //typeName1/elementName||//typeName2/elementName

--
Ticket URL: <http://trac.osgeo.org/geonetwork/ticket/724&gt;
GeoNetwork opensource Developer website <http://sourceforge.net/projects/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.