<div dir="ltr">Dear list, <div><br></div><div>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:</div>
<div><br></div><div>Below are the first lines of the (raw) response and value of $doc for the validation:</div><div><br></div><div>raw response:</div><div><br></div><div><div><?xml version="1.0" encoding="UTF-8"?></div>
<div><env:Envelope xmlns:env="<a href="http://www.w3.org/2003/05/soap-envelope">http://www.w3.org/2003/05/soap-envelope</a>"></div><div>  <env:Body></div><div>    <csw:GetRecordsResponse </div><div>
        xmlns:csw="<a href="http://www.opengis.net/cat/csw/2.0.2">http://www.opengis.net/cat/csw/2.0.2</a>" </div><div>        xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>" </div>
<div>        xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2">http://www.opengis.net/cat/csw/2.0.2</a> <a href="http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd</a>"></div>
<div>        <csw:SearchStatus timestamp="2013-12-09T15:00:23" /></div><div>        <csw:SearchResults numberOfRecordsMatched="5" numberOfRecordsReturned="2" elementSet="full" nextRecord="3"></div>
<div>            <gmd:MD_Metadata </div><div>                xmlns:gmd="<a href="http://www.isotc211.org/2005/gmd">http://www.isotc211.org/2005/gmd</a>" </div><div>                xmlns:gco="<a href="http://www.isotc211.org/2005/gco">http://www.isotc211.org/2005/gco</a>" </div>
<div>                xmlns:gml="<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>" </div><div>                xmlns:xlink="<a href="http://www.w3.org/1999/xlink">http://www.w3.org/1999/xlink</a>" </div>
<div>                xmlns:geonet="<a href="http://www.fao.org/geonetwork">http://www.fao.org/geonetwork</a>" </div><div>                xsi:schemaLocation="<a href="http://www.isotc211.org/2005/gmd">http://www.isotc211.org/2005/gmd</a> <a href="http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd">http://schemas.opengis.net/iso/19139/20060504/gmd/gmd.xsd</a>"></div>
<div>                [...]</div><div><br></div><div><br></div><div>value of $doc from XMLValidatingParser:</div><div><br></div><div><csw:GetRecordsResponse </div><div>    xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"</div>
<div>    xmlns:env="<a href="http://www.w3.org/2003/05/soap-envelope">http://www.w3.org/2003/05/soap-envelope</a>"</div><div>    xsi:schemaLocation="<a href="http://www.opengis.net/cat/csw/2.0.2">http://www.opengis.net/cat/csw/2.0.2</a> <a href="http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd</a>"></div>
<div>        <csw:SearchStatus timestamp="2013-12-09T15:00:25"/></div><div>        <csw:SearchResults elementSet="summary" nextRecord="3" numberOfRecordsMatched="5" numberOfRecordsReturned="2"></div>
<div>            <gmd:MD_Metadata </div><div>                xmlns:geonet="<a href="http://www.fao.org/geonetwork">http://www.fao.org/geonetwork</a>" </div><div>                xmlns:gml="<a href="http://www.opengis.net/gml">http://www.opengis.net/gml</a>"></div>
<div>                [...]</div></div><div><br></div><div>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: </div>
<div><br></div><div><div>      <call-test name="ctl:XMLValidatingParser"></div><div>        <with-param name="doc"><xsl:copy-of select="$response//soap:Envelope/soap:Body/*"/></with-param></div>
<div>        <with-param name="instruction"></div><div>          <parsers:schemas></div><div>            <parsers:schema type="resource">csw/2.0.2/CSW-discovery.xsd</parsers:schema></div>
<div>          </parsers:schemas></div><div>        </with-param></div><div>      </call-test></div></div><div><br></div><div><div>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?</div>
<div><br></div><div>Thanks. Michael</div><div> </div>-- <br><div dir="ltr">-----------------------------------------------------------<br>Michael Schulz<br><br><div><br><br></div></div>
</div></div>