[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

java.lang.OutOfMemory Error When Transforming a Flat X

Subject: java.lang.OutOfMemory Error When Transforming a Flat XML Document into Detailed XML Document via XSL
From: "David Haines" <david.f.haines@xxxxxxxx>
Date: Tue, 13 Nov 2001 16:08:22 -0600
java.lang.outofmemory
We are developing a process that converts a fixed-length flat file into XML.
As of this point, I have performed the following steps via Java and XSL:

1. Created a Java class to take a flat file and create a flat XML file. For
instance, the flat XML file would look like:

<ROWSET>
<ROW>flat file record 1</ROW>
<ROW>flat file record 2</ROW>
...
</ROWSET>

2. Created an XSL stylesheet that would create a detailed XML document (see
below) based on the flat XML file.

<ROWSET>
<ROW>
<RECORD_ID>0342323</RECORD_ID>
<SUBMISSION_DATE>03/22/2001</SUBMISSION_DATE>
</ROW>
<ROW>
<RECORD_ID>0342324</RECORD_ID>
<SUBMISSION_DATE>03/23/2001</SUBMISSION_DATE>
</ROW>
</ROWSET>

3. Created a Java class to take the Flat XML file in (1) and transform it to
full XML based on the XSL document in (2).

public void convert() {
try {
javax.xml.transform.TransformerFactory tFactory =
javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.Transformer transformer = tFactory.newTransformer(new
javax.xml.transform.stream.StreamSource(xslDoc));
transformer.transform(new javax.xml.transform.stream.StreamSource(inXML),
new javax.xml.transform.stream.StreamResult(
new java.io.FileOutputStream(outXML)));
}
catch (Exception ex) {
ex.printStackTrace();
}
}

4. When I run execute this Java class using a large file (e.g., 22 Mb), it
will process until it hits a java.lang.OutOfMemory error. Mind you that it
creates approximately half its task of creating of the full XML document
before hitting the OutOfMemory error.

Any thoughts on how to process large files using XSL transformation?


David Haines
david.f.haines@xxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.