I am aware of ways of applying XSL transformation to XMLs in java using
javax.xml.transform.Transformer
This approach works well for small XML data. But when it comes to large XML data where DOM based approach is difficult to use because of memory constraints, this becomes a nightmare.
I want to know what is the best approach to apply XSL transformation to large XMLs. Is there any transformer which operates on SAX and not DOM?
There are different implementations of XSLT processors in Java that implement JAXP. Saxon 9.3 is an XSLT 2.0 processor that also implements some streaming features of the XSLT 3.0 working draft, see http://www.saxonica.com/documentation/sourcedocs/streaming.xml.
And even if you don’t use the latest experimental Saxon 9.3 features it is usually a good idea not to feed a DOMSource to your processor but let the processor use its own tree implementation by feeding a StreamSource.