Hello,
I tried to use basex 6.7.1 as a web application server through the jax-rx API: If you put the following file in the jax-rx directory of basex, then you have a simple web application:
[c:\Programme\BaseX\jax-rx\index.html] declare option output:method "xhtml"; declare option output:media-type "text/html"; <html> <head><title>Testserver</title></head> <body> <p><a href="http://127.0.0.1:8984/basex/jax-rx/DBNAME?run=index.html">Testme!< /a></p> </body> </html>
(DBNAME is you context for the xquery) Here comes the problem: the declare option output:media-type "text/html"; does not seem to work :-( But if you specify the serialization option directly in the URI:
<html> <head><title>Testserver</title></head> <body> <p><a href="http://127.0.0.1:8984/basex/jax-rx/DBNAME?run=index.html&outpu t=media-type=text/html">Testme!</a></p> </body> </html>
Then this works and is a very simple example of using BaseX as a web application server.
Is it me or basex? Can anybody tell me, why the media-type=text/html output option did not work, when declared in the XQuery?
Regards, Sebastian