#5 add user:closure, other special extension functions


This patch adds special extension function capabilities to
saxon7.8 and the ability to return a closure from such
extension function and truly delay the evaluation of
anything in that closure sequence (even the first item)
up until it is really needed.

This is against saxon7.8 sources and supercedes my
earlier patch to add a saxon:closure function.

1) FunctionProxy now handles "special forms" i.e. where
argument is an Expression in which case the argument is
not evaluated. This is an improvement independent from
the closure that I want.

2) Closure now delays evaluation of even the first item
in the sequence. This is done by leaving inputIterator
uninitialized until the first time
ProgressiveIterator.hasNext() or .next() is called. This is
important for me to use closures of singleton expressions.

3) ExpressionTool.eagerEvaluate now returns the Closure
if the exp.iterate() has returned a ProgressiveIterator.
This may be somewhat of a cludge because it seems like
this produces one ProgressiveIterator for the garbage.
But it seems to work. Ideally a Closure would itself be a
SequenceIterator then it could be returned from
FunctionProxy.iterate and from

Attached zip file has patches and an example closure
extension function plus a test case consisting of
closure.xsl and another extension function. Run test
case as:

saxon closure.xsl closure.xsl

or to test the effect of not using a closure:

saxon closure.xsl closure.xsl noclosure=bla



  • Gunther Schadow

    Gunther Schadow - 2003-12-29

    Logged In: YES

    oops, squished a bug in the argument list adjustment, zip file
    is updated.

  • Gunther Schadow

    Gunther Schadow - 2004-01-05

    patch and test case

  • Gunther Schadow

    Gunther Schadow - 2004-01-05

    Logged In: YES

    squished another bug. The hack in eagerEvaluate needs to
    check if the expr is a closure and if so not to return the
    closure again. What I learned is that there is a way for saxon
    to create a Closure expression for what used to be the
    ToplevelExpression. It probably only does that if the static
    analysis shows that the expression is a sequence. I think it
    should just always do the closure for toplevel expressions ...
    but that's just me.

  • Gunther Schadow

    Gunther Schadow - 2004-11-12

    Logged In: YES

    I closed this because of the re-submission of this and better
    functionality for 8.1.1

  • Nobody/Anonymous

    VhyCMO jgkddlmuvibm, [url=http://xqsyvpjllvfj.com/]xqsyvpjllvfj[/url], [link=http://hlskubvkmzyv.com/]hlskubvkmzyv[/link], http://huyuljzpspcb.com/



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks