Looks like a clever soluiton, Peter. Maybe too clever. Recursion in XSLT will do the job, but performance is not likely to be very good; the amount of recopying of data required is fairly obscene. When you find yourself trying to force a nonprocedural language like XSLT to operate as it was a procedural language, that's generally an indication that it's time to look for another way of approaching the problem.
I'd recommend that you seriously consider calling an extension function instead. The downside is that extensions are generally not very portable from one implementation of XSLT to another. But they're often _FAR_ faster for this sort of string manipulation, and considerably easier to understand and to write. You may not even have to write your own, if an existing Java class can be made to do what you need. ______________________________________ Joe Kesselman / IBM Research
