[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] SAX for XSL Transformation
Hello All,
I just joined the group. I'm not exactly sure how to post is a specific topic. I have a question regarding the use of SAX parser for XSL transformation. I'm not very familliar with XML technologies. I'm trying to transform a 80M file using an XSL stylesheet to an output stream. I was able to do all this when the file was only about 40Meg. Now I am having problems with out of memory errors from the JVM ,I'm assuming that the JAXP API uses a DOM object to do this transformation. Here is the code (Which again I found on the internet) Package com.ual.amis.frmfim; import java.io.*; import javax.xml.transform.*; import javax.xml.transform.stream.*; public class Transform { public Transform() { } public static void main(String[] args) { // If not enough args, print usage. if (args.length < 3) { System.out.println( "Usage: XML-File Stylesheet Output-File"); System.exit(5); } // Get command-line args. File xmlFile = new File(args[0]); File xslFile = new File(args[1]); File outFile = new File(args[2]); // Create xsl source, input source, and result streams. StreamSource xslSource = new StreamSource(xslFile); StreamSource xmlSource = new StreamSource(xmlFile); StreamResult outResult = new StreamResult(outFile); try { // Get transformer factory and transformer. TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(xslSource); // Do transformation. transformer.transform(xmlSource, outResult); } catch(Exception ex) { System.out.println(ex); System.exit(16); } } } Is there a way to instruct the Transformer to use a SAX parser explicitly. Thanks
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|