[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qexo-general] External functions

From: Ivelin Ivanov
Subject: Re: [Qexo-general] External functions
Date: Sat, 18 Jan 2003 14:20:43 -0600


I was looking for an example usage of the following function defined in the
XQuery spec, but couldn't find one.
fn:document($srcval1 as item*, $srcval2 as node*) as node*

It looks like a good candidate for linking multiple documents.

Use case:
Script /one.xql contains:
let $result = ... calculate based on input ...
let $html = document("xml2html.xql", $result)
return $html;

where xml2html.xql takes as input (via fn:input()) xml formated document
passed to it,
transforms it to html and returns it.

This is an oversimplified scenario, but if xql piping of this kind is
feasible, then real web applications are possible.

If QEXO implements document() with 2 arguments as suggested above, then
XqlServlet can optimize performance for scripts residing in the the same web
app. It can detect this fact and pass objects directly via server side
servlet forward, instead of initiating a full http request. As an effect
these document() calls will be in VM calls. Still, when the target document
URI points to a remotely hosted resource, then the implementation can
innitiate a network (e.g. http) connection and stream out the supplied
XqlServlet will be able to accept input via locat servlet call or remote
POST, massage it and make it available to the xql servlet (compiled by QEXO)
as input (again via fn:input()). Where the input comes from, whether another
local script or a remote request, will be transparent to the targeted xql

I hope these random thoughts had some order and make sense.

Let me know what you think,


----- Original Message -----
From: "Per Bothner" <address@hidden>
To: "Ivelin Ivanov" <address@hidden>
Sent: Friday, January 17, 2003 11:23 AM
Subject: Re: [Qexo-general] XqlServlet

> >>we need a way to define "eternal" Xuery functions - perhaps as
> >>suggested in issue 223 in the XQuery draft.
> >
> >
> > What is the URL to 223?
> http://www.w3.org/TR/xquery/#external-function-definition
> --
> --Per Bothner
> address@hidden   http://www.bothner.com/per/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]