Hi,

Is it possible to get the value of "output:media-type" through QueryProcessor? 

I am currently trying to use BaseX as a view renderer for a Spring MVC application. The view is rendering fine using embedded BaseX. However, I can't figure out how to get the "output:media-type" value from the XQuery so that I can set the response header during runtime. I can set the content-type through the controller in Spring. But I would rather not have to do it in two separate places. Below is the relevant code snippet from the view renderer.

try(QueryProcessor proc = new QueryProcessor(query, context)) {
    Iter iter = proc.iter();

    //response is HTTPServletResponse
    response.setContentType(????);

    try(Serializer ser = proc.getSerializer(response.getOutputStream())) {
        for(Item item; (item = iter.next()) != null;) {
            ser.serialize(item);
        }
    }
}

Any suggestion?


Thanks
Andrew