However, I still think there are even better ways of doing this,
because in the above template there is still a lot of wasted
iteration. Recursion works quickly without wasting iteration, but tail
recursion optimization doesn't seem to be supported by Xalan-J 2.4.0,
because I get stack overflows for large numbers of continuation
records.
Perhaps the DVC approach that I've read a little about would help
here?
Yes. One of the goals of DVC is to minimize the possibility of stack oveflow
caused by recursion depth.
=====
Cheers,
Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list