None
Monday, 27 January 2025 · 1 message
U
unknown27 Jan 2025 13:58 #
parameter applies only where wrap=3Dyes (it is ignored when wrap=3Dno)
output does allow media-type to be specified...interestingly, the spec you refer to says the media-type can contain a value in line with RFC2046, that RFC happens to include textual media-types as well (e.g., text/plain) as XM= L
media-types.
So, I would propose to use a) the situation as it is today (wrap=3Dno, wrap=3Dyes dictating whether jax-rx:result and jax-rx:results are used to wrap) but also b) to be able to override the media-type independently of wrap parameter's value using output=3Dmedia-type=3Dtext%2Fplain or output=3Dmedia-type=3Dapplication%2fxml for example. Whether to use text/p= lain
for wrap=3Dno becomes non-critical then (because of the ability to override it) and leaving it at text/plain as default is probably fine.
Thanks.
On Mon, Jan 31, 2011 at 11:01 AM, Christian Gr=FCn
<christian.gruen at gmail.com>wrote:
Quoted text · 21 lines
> > Okay, I thought setting output to application/xml but wrap=3Dno will me= an > the > > person writing the query is taking the responsibility that they do not > want > > results to be wrapped but know the result is xml so forcing the output = to > be > > application/xml (so that the response mime-type is set to application/x= ml > in > > this case)...what are the valid values for output parameter? > > All parameters are defined in the W3 specs: > http://www.w3.org/TR/xslt-xquery-serialization/ > > Please browse our JAX-RX docs for some usage examples: > http://docs.basex.org/wiki/JAX-RX_API > > > An invocation like > > http://localhost:8984/basex/jax-rx?wrap=3Dno&query=3D1+to+10&output=3Dt=
ext/xmlor
Quoted text · 2 lines
> > > http://localhost:8984/basex/jax-rx?wrap=3Dyes&query=3D1+to+10&output=3Dte=
xt/xml
Quoted text · 15 lines
> > (or text%2Fxml) results in: > > Yes, I see that there's some need to work on the response media type. > I have two solutions in mind: > > a) All textual results of "query" and "run" could be returned as > application/xml, no matter what value has been assigned to "wrap". > This would mean that all non-XML query results (e.g., resulting from a > XQuery like "1 to 10") would be handles as XML, too. > > b) This is one is similar to your approach: an additional JAX-RX > parameter could be introduced to explicitly overwrite the resulting > media type. Example: > > http://localhost:8984/basex/jax-rx?wrap=3Dyes&query=3D1&media=3Dapplicat=
ion/xml
Quoted text · 9 lines
> > What do you, and others, think? > > Both changes are not BaseX-centric, but have to be made in the JAX-RX > interface, so this might take some more time; but I'll definitely add > this to our internal issue tracker. > > Christian >
--0016e64c2a1a56ee16049b22f778
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
The scope of this posting is only xquery.<br><br>From your discussion on ou= tput parameter, it appears to me that that parameter applies only where wra= p=3Dyes (it is ignored when wrap=3Dno)<br><br>output does allow media-type = to be specified...interestingly, the spec you refer to says the media-type = can contain a value in line with RFC2046, that RFC happens to include textu= al media-types as well (e.g., text/plain) as XML media-types.<br> So, I would propose to use a) the situation as it is today (wrap=3Dno, wrap= =3Dyes dictating whether jax-rx:result and jax-rx:results are used to wrap)= but also b) to be able to override the media-type independently of wrap pa= rameter's value using output=3Dmedia-type=3Dtext%2Fplain or output=3Dme= dia-type=3Dapplication%2fxml for example.=A0 Whether to use text/plain for = wrap=3Dno becomes non-critical then (because of the ability to override it)= and leaving it at text/plain as default is probably fine.<br> <br>Thanks.<br><br><br><br><div class=3D"gmail_quote">On Mon, Jan 31, 2011 = at 11:01 AM, Christian Gr=FCn <span dir=3D"ltr"><<a href=3D"mailto:chris= tian.gruen at gmail.com">christian.gruen at gmail.com</a>></span> wrote:<br><b= lockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-= left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class=3D"im">> Okay, I thought setting output to application/xml bu= t wrap=3Dno will mean the<br>
> person writing the query is taking the responsibility that they do not= want<br>
> results to be wrapped but know the result is xml so forcing the output= to be<br>
> application/xml (so that the response mime-type is set to application/= xml in<br>
> this case)...what are the valid values for output parameter?<br> <br>
</div>All parameters are defined in the W3 specs:<br>
=A0<a href=3D"http://www.w3.org/TR/xslt-xquery-serialization/" target=3D"_= blank">http://www.w3.org/TR/xslt-xquery-serialization/</a><br> <br>
Please browse our JAX-RX docs for some usage examples:<br>
=A0<a href=3D"http://docs.basex.org/wiki/JAX-RX_API" target=3D"_blank">htt= p://docs.basex.org/wiki/JAX-RX_API</a><br>
<div class=3D"im"><br>
> An invocation like<br>
> <a href=3D"http://localhost:8984/basex/jax-rx?wrap=3Dno&query=3D1+= to+10&output=3Dtext/xml" target=3D"_blank">http://localhost:8984/basex/= jax-rx?wrap=3Dno&query=3D1+to+10&output=3Dtext/xml</a> or<br> > <a href=3D"http://localhost:8984/basex/jax-rx?wrap=3Dyes&query=3D1= +to+10&output=3Dtext/xml" target=3D"_blank">http://localhost:8984/basex= /jax-rx?wrap=3Dyes&query=3D1+to+10&output=3Dtext/xml</a><br> > (or text%2Fxml) results in:<br>
<br>
</div>Yes, I see that there's some need to work on the response media t= ype.<br>
I have two solutions in mind:<br>
<br>
a) All textual results of "query" and "run" could be re= turned as<br>
application/xml, no matter what value has been assigned to "wrap"= .<br>
This would mean that all non-XML query results (e.g., resulting from a<br> XQuery like "1 to 10") would be handles as XML, too.<br> <br>
b) This is one is similar to your approach: an additional JAX-RX<br> parameter could be introduced to explicitly overwrite the resulting<br> media type. Example:<br>
<br>
=A0<a href=3D"http://localhost:8984/basex/jax-rx?wrap=3Dyes&query=3D1&= amp;media=3Dapplication/xml" target=3D"_blank">http://localhost:8984/basex/= jax-rx?wrap=3Dyes&query=3D1&media=3Dapplication/xml</a><br> <br>
What do you, and others, think?<br>
<br>
Both changes are not BaseX-centric, but have to be made in the JAX-RX<br> interface, so this might take some more time; but I'll definitely add<b= r>
this to our internal issue tracker.<br>
<font color=3D"#888888"><br>
Christian<br>
</font></blockquote></div><br>
--0016e64c2a1a56ee16049b22f778--
⚡Generated with XQuery