Hello,

I've a question to the response-header() function of the web module.

In my RESTXQ function I try to return a response with HTTP Status 404:

module namespace basex ='basex';

declare %rest:GET %rest:path("/db/{$db}/doc/{$doc}")
  %rest:produces("application/xml")
  %output:method("xml")
function basex:doc($dbas xs:string, $docas xs:string)as item()*
{
   web:response-header(map {},map {},map {"status" :404}),<notfound/> };


When I call this function I get the error:

[basex:restxq] Unexpected node: status="404".


If I call the function outside of the RESTXQ context the following response is generated:

<rest:response xmlns:rest="http://exquery.org/ns/restxq"; *status="404"*>
  <http:response xmlns:http="http://expath.org/ns/http-client"/>
<output:serialization-parameters xmlns:output="http://www.w3.org/2010/xslt-xquery-serialization"/>
</rest:response>
<notfound/>

Shouldn't the status attribute be put on the http:response element instead?

Best regards
Johannes

Reply via email to