ISO-TC211 / XML

XML schema, transforms, schematron rules, and examples for ISO TC211 Metadata Standards
46 stars 26 forks source link

Media type of XML schemas available at https://schemas.isotc211.org/ #226

Closed heidivanparys closed 2 weeks ago

heidivanparys commented 1 year ago

The media type of the XML schemas available at https://schemas.isotc211.org/ is currently binary/octet-stream (e.g. for https://schemas.isotc211.org/19139/-/gmx/1.0/gmx.xsd), whereas the media type of the XML schemas available at the OGC schema service is application/xml (e.g. http://schemas.opengis.net/iso/19139/20070417/gmx/gmx.xsd). This has implications on how clients handles those file: for binary/octet-stream, a browser would typically offer to download the file, whereas for application/xml, a browser would typically display the file in the browser, without having to download it first.

Would it be possible to set up https://schemas.isotc211.org/ so the XML schemas have media type application/xml?

E.g.

curl -i -I -k "https://schemas.isotc211.org/19139/-/gmx/1.0/gmx.xsd"
HTTP/1.1 200 OK
Content-Type: binary/octet-stream
Content-Length: 1171
Connection: keep-alive
Last-Modified: Wed, 21 Dec 2022 03:32:37 GMT
Server: AmazonS3
Date: Tue, 03 Jan 2023 13:42:02 GMT
ETag: "19f65f312a4ed74ac83512cc6536c995"
Vary: Accept-Encoding
X-Cache: Hit from cloudfront
Via: 1.1 d416eacc69c0b6128e667f5d1baab6fa.cloudfront.net (CloudFront)
X-Amz-Cf-Pop: CPH50-P1
X-Amz-Cf-Id: xsSqQ3u5n06W9gakHun4NWoWmKLU-Yo6kfrHrQ76nzB8oxdvthk4_Q==
Age: 221
curl -i -I "http://schemas.opengis.net/iso/19139/20070417/gmx/gmx.xsd"
HTTP/1.1 200 OK
Date: Tue, 03 Jan 2023 13:43:53 GMT
Server: Apache
Content-Security-Policy: upgrade-insecure-requests
Vary: upgrade-insecure-requests,Accept-Encoding
Last-Modified: Sun, 22 Jul 2012 01:53:24 GMT
ETag: "477-4c56165026d00"
Accept-Ranges: bytes
Content-Length: 1143
X-Hostname: (null)
Content-Type: application/xml

Background

I created a new version of a set of XML schema files for a certain project. One change is the schema location for http://www.isotc211.org/2005/gmx, I changed that to the official schema location, using the official ISO schemas instead of the unofficial (I think?) OGC schemas.

<import namespace="http://www.isotc211.org/2005/gmx" schemaLocation="http://schemas.opengis.net/iso/19139/20070417/gmx/gmx.xsd"/>
<import namespace="http://www.isotc211.org/2005/gmx" schemaLocation="https://schemas.isotc211.org/19139/-/gmx/1.0/gmx.xsd"/>

According to the supplier that has to implement the schemas, this results in the following error: “The global element 'http://www.isotc211.org/2005/gmd:EX_TemporalExtent' has already been declared.” The supplier asked whether this difference in behaviour between http://schemas.opengis.net/iso/19139/20070417/gmx/gmx.xsd and https://schemas.isotc211.org/19139/-/gmx/1.0/gmx.xsd as explained above, could be the reason behind this error.

I cannot reproduce the error locally… (tested in a Java environment, using Xerces for Java, but the supplier uses .NET, so there is a difference there as well).

I cannot see any changes between the gmx.xsd at OGC and the gmx.xsd at the TC 211 schema server, so the issue does not seem to be there.

Any clues on other causes of this error than the change of media type would be welcome!