Hi Christian,

Thanks for the answer. There is one thing I want to point out: My problem is not the quality measure. I have problems because my client lacks them. It sends 'application/xml,*/*' which is interpreted as: any function that either satisfies application/xml or any other mime type. Of course any othe mime type alone weill select more than one function if there is more than one function specified for a path only differentiated by mime/type in %rest:produces. The BaseX answer to this is a BASX0003 error and therefore no meaningful result.

Although it is correct to assume */* does not really select any funtion in particular I find that bahavior not helpful. I should be able to specify what should be executed on */*.

Furthermore when some mime type is specified alongside */* I think that */* should be ignored and that mime type used instead.

Another solution would be to automatically assign a mime type more to the left in the list a slightly higher quality measure so the problem of a equal mime types can be solved. I even think there is some standard about processing the Accept header in this manner but I may be wrong.

Best Regars

Omar


Am 04.07.2017 um 19:36 schrieb Christian Grün:
Hi Omar,

Thanks for the reminder. Yes, we still plan to improve support for
quality factors in our RESTXQ implementation. We’ll probably need to
find out how this has been resolved in JAX-RS, and define an
equivalent solution for RESTXQ. I have updated the initial comment in
Issue 1220 [1].

I am also passing this on to Adam Retter, the initiator of RESTXQ:
Adam, did you think about adding support for quality factors in the
RESTXQ implementation of eXist-db?

And, Omar, I assume you would like to have chosen the function that
matches the first content types given in the Accept header?

Thanks everyone,
Christian

[1] https://github.com/BaseXdb/basex/issues/1220



On Tue, Jul 4, 2017 at 1:17 PM, Omar Siam <omar.s...@oeaw.ac.at> wrote:
Hi list!

I like my oXygen editor to request raw XML data from my RESTxq endpoints to
test XSL stylesheets. When I do this with RESTxq paths that have different
%rest:produces it fails with the BASX0003 multiple functions error.

Turns out oXygen sends application/xml, */* as Accept header without any
quality.

I understand that as documented in
https://github.com/BaseXdb/basex/issues/1220 this is known not to work.

My/our workaround is to branch in a single XQuery function using sth. like:
if (some $a in tokenize(request:header("ACCEPT"), ',') satisfies $a =
('text/xml', 'application/xml')) then $xml else $xhtml

I hope this is still on the agenda for 8.7.

Best regards

Omar Siam



Reply via email to