I am working under java application which uses XSLT transformation. I have a lot of document() calls in it, so it is possible to have java.lang.OutOfMemory exception (which I actually have), because after each call of document() function the document is cached.
At http://xml.apache.org/xalan-j/faq.html#faq-N102F9 I read that it is possible to
increase heap memory size which is not the solution in my case. I also tried to use incremental transform which seems to be not supported.
So, is there any possibility to turn off document caching in jaxp while working with document() function?
Like user1066037’s answer, hopefully you can switch to Saxon. Saxon has an extension called
saxon:discard-document. It’s available in either the PE or EE editions or Saxon-B. Search for “Saxon-B” here: http://saxon.sourceforge.net/From the Saxon documentation:
If you need an example of how to use
saxon:discard-document, let me know and I can post one.