[xquery-talk] flowrrr - how to structure a function?

Michael Kay mhk at mhk.me.uk
Wed Oct 18 11:32:19 PDT 2006


> I think Wolfgang's function library in eXist (http://demo.exist-
> db.org/xquery/functions.xq) also includes functions to create 
> user sessions, this might be more difficult to make 
> side-effect free. I.e.  
> if session:create(), session:set-current-user() and session:invalidate
...


I'm inclined to thing that the best way to handle such things is to define
an XML representation of the object (for example, a session) and allow the
user to construct the XML representation any way they like. Similarly an
HttpHeader. Then if the response from the query includes one of these
elements (which can be detected from its namespace) the calling code can
translate it into the native representation.

I do something along these lines to allow DTDs to be constructed: see
http://www.saxonica.com/documentation/extensions/instructions/doctype.html

Michael Kay
http://www.saxonica.com/



More information about the talk mailing list