If you have an XmlObject already, the easiest way I know to write a file is via the save() method on the XmlObject. So in your source above, if docXml is an XmlObject, rather than getting the string and writing the string out to a file, why not do it directly via docXml.save(new File(some/File/name.xml);
If this works will you let us know the size of the file you wrote. To clarify, you are trying to go from: String -> XmlObject -> String -> File I/O If this String is really large like you say, this might be your problem. As you will have ~ 3 instances of the data since XMLBeans is similar to DOM in how it keeps its information. -Jacob Danner On 4/24/07, inandjo <[EMAIL PROTECTED]> wrote:
Hi Jacob, The size of the JVM is already increased to 2048kb, but the thing is that I can't even evaluate the size of the String I'm trying to write to a file; that's because I get the String from and XMLObject child with the method toString() or even xmlText(). Now the crash occurs when I write the following code: String s = docXML.toString(); In fact what I need to do is to write the object content progressively, but even that way, I can't even get a String representation of the XMLObject, although I can manipulate the docXML object. Do you have any idea as to how I can write that object to a file?? Jacob Danner-2 wrote: > > Have you tried increasing the memory space of the JVM? > What is the current size? How big is the String you are parsing? > Thanks, > -Jacob Danner > > > On 4/24/07, inandjo <[EMAIL PROTECTED]> wrote: >> Hi, I have an app that generated XML file using xmlBeans, and to do so, >> I >> have to feed the xmlobject with data that can be huge sometimes. Before i >> create the file from the xmlobject, i get the xmlobject in the form of a >> String with the method xmlText() or even toString(). In both case, I get >> an >> OutOffMemory error, because the String representation just seems to be >> too >> big . Does anybody have an idea on how I can progressively write the >> string >> representation of that xmlobject, without running out of memory?? ..... >> ..... ..... docXML.setOperationsl(operation); return docXML.toString(); >> // >> exception at this point when I return the String. > -- View this message in context: http://www.nabble.com/OutOffMemory-error-while-transforming-and-xmlobjet-to-a-String%21%21-tf3638662.html#a10162935 Sent from the Xml Beans - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

