Okay, I thought setting output to application/xml but wrap=no will mean the person writing the query is taking the responsibility that they do not want results to be wrapped but know the result is xml so forcing the output to be application/xml (so that the response mime-type is set to application/xml in this case)...what are the valid values for output parameter?
All parameters are defined in the W3 specs: http://www.w3.org/TR/xslt-xquery-serialization/
Please browse our JAX-RX docs for some usage examples: http://docs.basex.org/wiki/JAX-RX_API
An invocation like http://localhost:8984/basex/jax-rx?wrap=no&query=1+to+10&output=text... or http://localhost:8984/basex/jax-rx?wrap=yes&query=1+to+10&output=tex... (or text%2Fxml) results in:
Yes, I see that there's some need to work on the response media type. I have two solutions in mind:
a) All textual results of "query" and "run" could be returned as application/xml, no matter what value has been assigned to "wrap". This would mean that all non-XML query results (e.g., resulting from a XQuery like "1 to 10") would be handles as XML, too.
b) This is one is similar to your approach: an additional JAX-RX parameter could be introduced to explicitly overwrite the resulting media type. Example:
http://localhost:8984/basex/jax-rx?wrap=yes&query=1&media=applicatio...
What do you, and others, think?
Both changes are not BaseX-centric, but have to be made in the JAX-RX interface, so this might take some more time; but I'll definitely add this to our internal issue tracker.
Christian