RE: [xsl] Re: Re: Re: Unbounded element grouping/concatenation

Subject: RE: [xsl] Re: Re: Re: Unbounded element grouping/concatenation
From: "Gupta, Raman K [CI]" <raman.k.gupta@xxxxxxxxxxxxx>
Date: Thu, 11 Dec 2003 15:46:24 -0500
> The recursive algorithm works very well for me with 
> XalanJ2.4.1. It is also
> much faster than the variant with generate-id().
> 
> I tested it with a record (type="normal"), which has 200 
> following siblings
> record (type="continuation").

True, but when you raise the number of continuation records,
it will eventually fail (for me, somewhere between 1000 and 1200
records, but this may vary somewhat depending on your java 
environment and stack memory. I need to support at least four
or five thousand.

> With this source xml the recursive transformationtakes 781 ms 
> to run. The
> transformation with generate-id() takes 18687 ms.

Yes, the recursion is very much faster... that is why I wished
Xalan did tail recursion optimization. If there is no other
option, I will use the generate-id() method. Also note that
the generate-id() exhibits O(n^2) behavior, while the recursive
method should exhibit O(n). That was why I am still hoping 
there is a way to do it recursively (for a significant number
of continuation records).

Cheers,
Raman Gupta

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread