Hi Max,
currently, the Content-Type is always set to text/plain if "wrap" is set to "no". Otherwise (depending on the evaluated query), the returned results might not always be well-formed. – We might change this in future, however, as your request sounds quite reasonable.
Best, Christian
On Fri, Jul 30, 2010 at 11:42 PM, Maximilian Gärber mgaerber@arcor.de wrote:
Hi all,
I am doing some tests with the jax-rx api - using static html files and a little jquery.
I placed the html file in the \basex-api\etc directory and wanted to use the run command to let jetty deliver the html document:
http://localhost:8984/basex/jax-rx?run=QueryTest.html&wrap=no&output...
The deliverd file will always be text/plain, however. Is there anything I am missing, or will the media-type option currently not affect the response Content-Type?
Regards, Max
For completeness, this is the ajax call:
var data1 = '<query xmlns="http://jax-rx.sourceforge.net"><text>for $f in //file return $f/type</text><parameter name="count" value="5"/><parameter name="wrap" value="yes"/></query>';
var url1 = "http://localhost:8984/basex/jax-rx/Applications";
$.ajax( { url: url1, data: data1, type: "POST", processData: false, contentType: "application/query+xml", timeout: 10000, dataType: "xml", error: function(){ alert('Error loading XML document'); }, success: function(xml){ //alert(xml); $(xml).find('type').each(function(){ var item_text = $(this).text();
$('<li></li>') .html(item_text) .appendTo('#list'); }); } } ); _______________________________________________ BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk