I am trying to use the EPSG Registry API to export a release of the registry for offline use but am receiving a registry error.
After following the Developer Guide I am HTTP POSTing the following XML request to the API URL:
<?xml version="1.0" encoding="UTF-8"?>
<GetRecords
xmlns="http://www.opengis.net/cat/csw"
xmlns:ogc="http://www.opengis.net/ogc"
startPosition="1" maxRecords="100"
outputFormat="application/xml; charset=UTF-8"
resultType="results">
<!--
Retrieve the ReleaseObject releated to the current Version History record.
Then use the ReleaseObject identifier to obtain the actual compressed
GML Dictionary file containing the EPSG Dataset via a getRepositoryItem
request.
-->
<Query typeNames="Association=a RegistryObject=release">
<ElementSetName typeNames="release">full</ElementSetName>
<Constraint version="1.1.0">
<ogc:Filter>
<ogc:And>
<!-- find the correct association -->
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>$a/targetObject</ogc:PropertyName>
<ogc:Literal>urn:ogc:def:version-history:EPSG::6.15</ogc:Literal>
</ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>$a/associationType</ogc:PropertyName>
<ogc:Literal>
urn:x-ogp:def:AssociationType:EPSG:ReleaseFor</ogc:Literal>
</ogc:PropertyIsEqualTo>
<!-- now relate it to the ReleaseObject -->
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>$a/sourceObject</ogc:PropertyName>
<ogc:PropertyName>$release/id</ogc:PropertyName>
</ogc:PropertyIsEqualTo>
</ogc:And>
</ogc:Filter>
</Constraint>
</Query>
</GetRecords>
The XML is copied from section 5.3 'How To... Export a Release' of the guide, and the URL to send GetRecords requests to is suggested by section 4.1.1 'GetRecordById'. The XML error response I get is as follows:
<?xml version="1.0"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" version="2.0">
<ows:Exception exceptionCode="InvalidRequest">
<ows:ExceptionText>XML Schema validation error</ows:ExceptionText>
<ows:ExceptionText>
Error:Error
Line: 2
Column: 193
Message: cvc-elt.1: Cannot find the declaration of element 'GetRecords'.
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>
I am using the curl command line program to run the query as follows:
curl -H 'Content-Type: appliation/xml' --data @request.xml 'http://www.epsg-registry.org/indicio/query'
Can you see where I'm going wrong? If not is there any other way to automatically download the registry? I am aware that I can login to the Registry HTML interface and download the registry from there but I would like to automate the process.