Project

Profile

Help

Patch #1419

closed

add user:closure, other special extension functions

Added by Anonymous almost 21 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Legacy ID:
sf-867258
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

SourceForge user: gschadow

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.

  1. 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.

  1. 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

ExpressionTool.eagerEvaluate.

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

regards,

-Gunther


Files

closure.zip (9.56 KB) closure.zip Anonymous, 2003-12-29 18:58
closure.zip (9.56 KB) closure.zip Anonymous, 2003-12-29 19:55
closure.zip (9.56 KB) closure.zip Anonymous, 2004-01-05 19:51

Please register to edit this issue

Also available in: Atom PDF