[CITE-Forum] Response validation issues with CTL

Michael Schulz mandschulz at googlemail.com
Mon Dec 9 09:39:27 EST 2013


Dear list,

we're using the CTL XMLValidatingParser to validate CSW GetRecord soap
requests against the CSW discovery schema. I now have the problem that the
namespaces defined in the response that is returned from the remote server,
are modified after receiving /parsing the response and prior submitting it
to the validation function:

Below are the first lines of the (raw) response and value of $doc for the
validation:

raw response:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
  <env:Body>
    <csw:GetRecordsResponse
        xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
        <csw:SearchStatus timestamp="2013-12-09T15:00:23" />
        <csw:SearchResults numberOfRecordsMatched="5"
numberOfRecordsReturned="2" elementSet="full" nextRecord="3">
            <gmd:MD_Metadata
                xmlns:gmd="http://www.isotc211.org/2005/gmd"
                xmlns:gco="http://www.isotc211.org/2005/gco"
                xmlns:gml="http://www.opengis.net/gml"
                xmlns:xlink="http://www.w3.org/1999/xlink"
                xmlns:geonet="http://www.fao.org/geonetwork"
                xsi:schemaLocation="http://www.isotc211.org/2005/gmd
http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd">
                [...]


value of $doc from XMLValidatingParser:

<csw:GetRecordsResponse
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:env="http://www.w3.org/2003/05/soap-envelope"
    xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2
http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
        <csw:SearchStatus timestamp="2013-12-09T15:00:25"/>
        <csw:SearchResults elementSet="summary" nextRecord="3"
numberOfRecordsMatched="5" numberOfRecordsReturned="2">
            <gmd:MD_Metadata
                xmlns:geonet="http://www.fao.org/geonetwork"
                xmlns:gml="http://www.opengis.net/gml">
                [...]

I have tried various ways to extract the content from the soap envelope,
all leading to the same results, this example was done with the following
code, using the sample usage in parser.ctl:

      <call-test name="ctl:XMLValidatingParser">
        <with-param name="doc"><xsl:copy-of
select="$response//soap:Envelope/soap:Body/*"/></with-param>
        <with-param name="instruction">
          <parsers:schemas>
            <parsers:schema
type="resource">csw/2.0.2/CSW-discovery.xsd</parsers:schema>
          </parsers:schemas>
        </with-param>
      </call-test>

As you can from the value of $doc, the gmd namespace is dropped and so the
validation is always failing. Could someone explain why this would happen
and what could be the correct solution to keep these namespaces?

Thanks. Michael

-- 
-----------------------------------------------------------
Michael Schulz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opengeospatial.org/pipermail/cite-forum/attachments/20131209/108d86aa/attachment-0001.html>


More information about the CITE-Forum mailing list