Omar Siam
2017-07-04 11:17:46 UTC
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
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