[xquery-talk] flowrrr - how to structure a function?
wolfgang at exist-db.org
Wed Oct 18 01:32:57 PDT 2006
> I can see that it's tempting in this situation to use extension functions to
> set the HTTP headers, but I would resist that. Better to do this from the
> application (written in Java or whatever) that invokes the query.
This assumes that the XQuery is invoked by some Java code you have
written yourself. But what if you don't know any Java and your
application is actually an XQuery? I think this is quite common among
our users. It is so easy to write all the web stuff in XQuery (with
the help of some XSLT to post-process the output) and I would just be
too lazy to go back to writing servlets or JSP pages (even our test
runner for the XQTS is itself a web application written in XQuery).
I agree that Robert's example, using a sequence of HTTP extension
functions with unknown side effects, does call for a redesign. Most of
those functions were added by users just as they needed them, so the
package has to be cleaned up sometimes, maybe taking into account
Martin's proposal. I like the idea of just returning an XML fragment
to represent the HTTP response, then process that fragment after the
More information about the talk