[xquery-talk] modules and context

Dave Pawson dave.pawson at gmail.com
Fri Nov 18 17:43:14 PST 2005

On 18/11/05, Howard Katz <howardk at fatdog.com> wrote:
> What processor are you using?
Currently saxon 8.

 Some let you preset the top-level context so
> that "anonymous" xpaths like "//rng:define" will work. Saxon for example
> lets you optionally assign the context to a named document.
thanks Howard. I'll need to find out how.

> It seems a bit wasteful to have to reload the top-level document node via a
> second call to doc( ). Why don't you just pass in the top-level context as
> an argument to the function you're calling, as in:
> declare function dp:gatts($attributes as xs:string, $top-level as
> element()+)

Sounds good.

So... the call would be

$retval = dp:gatts('year', //rng:doc)

Makes sense.

Thanks Howard
(Also Mike/Martin)

Dave Pawson

More information about the talk mailing list