[xquery-talk] XQuery web APIs

Per Bothner per at bothner.com
Tue May 16 13:48:16 PDT 2006

Martin Probst wrote:
> I'm currently trying to add some basic functionality to use XQuery as a 
> web scripting language to X-Hive/DB. It's currently possible to use it 
> that way, but it's somewhat painful.

Simple how-to for using Qexo:

Older, more complex example:

Qexo provides a functional way of setting the response-header:
(The manual emphasises the Scheme language rather the XQuery,
but there functions are also available.)
Basically the "response-header" is pre-pended to the data.
Here is a little example:

declare boundary-space preserve;
response-header("X-Count", 6+7),
unescaped-data("<?xml version='1.0'?>
   <p>The translated path was: {request-path-translated()}</p>,
   <p>{let $query := qexo:request-query-string() return
       if ($query)
       then ("The query string was: ",$query)
       else "There was no query string."}</p>
	--Per Bothner
per at bothner.com   http://per.bothner.com/

More information about the talk mailing list