Each time you create and pass back a DOM element, we have to wrap a DTM
around it so the rest of Xalan can manipulate it. I believe all DTMs are
currently being logged in the DTMManager, and there are a strictly limited
number of bits available to for that addressing; when that runs out, we'll
fail, probaby not elegantly. "About 500 invocations" looks suspiciously
like 512 minus the source-document DTMs... I'd be surprised if we were
running out that quickly, but maybe there's something else also consuming
this resource.
I'd have to work this through in the debugger, but I suspect it's our code
rather than yours.
Questions to investigate: When can/should we be releasing these fragment
DTMs so their addresses can be reused? Are we really running out, or just
not reusing successfuly? Is this a common enough usage that it'll come back
to haunt us?
(I'd proposed making the DTM node handle be a Long -- 32 bits of addressing
each for DTMs and for nodes within a DTM -- but we've been reluctant to
grovel through all of Xalan yet again and change the type, and it hasn't
seemed to be necessary. This may help motivate that change.)