BRGM / gml_application_schema_toolbox

GML Application Schema toolbox is a QGIS plugin allowing to manipulate OGC Complex Features
https://brgm.github.io/gml_application_schema_toolbox/
GNU General Public License v2.0
28 stars 18 forks source link

Identify Feature in XML Mode forcing Accept header to application/xml when Resolving external #134

Open sgrellet opened 3 years ago

sgrellet commented 3 years ago

Environment

Description

To Reproduce

Steps to reproduce the behavior: Attached file: BoreholeView_Instance.zip

  1. Load the attached file in the Load Wizard > File/URL
  2. Loading options > 'Load in XML mode'
  3. Next and Finish
  4. epos:status > Resolve external > Embedded

-> Python error "XML parsing error" : The external resource is not a well formed XML

Expected behavior


Additional context

Guts commented 3 years ago

It seems that the server use an URL query parameter format to determine which output is expected. For example for rdf/xml: https://data.geoscience.earth/ncl/BoreholeStatus/drillingCompleted?_format=rdf

@sgrellet is there a way to get this kind of information (accepted content to use) from original XML?

cURL samples:

curl -H "Accept: application/rdf+xml" -X GET https://data.geoscience.earth/ncl/BoreholeStatus/drillingCompleted

works, but:

curl -H "Accept: application/xml,application/rdf+xml" -X GET https://data.geoscience.earth/ncl/BoreholeStatus/drillingCompleted

doesn't work. It returns HTML: text/html. It should returns one of the requested ones if it supports it.

BTW, the server doesn't answer with OPTIONS.

Guts commented 3 years ago

The server doesn't answer with OPTIONS.

sgrellet commented 3 years ago

@Guts : sorry for the latency.

no need to pass a 'format' parameter, just real conneg

in a 'XML' view of the world, "application/rdf+xml" should be your choice. It makes sense the server does not know what yo do with application/xml as there is no obvious XML serialization for the linked data content available (note : I wrote XML" not "RDF/XML").

What do you mean by ' original XML' in your message above ?