Meaningless Drivel is fun!*
The moose likes XML and Related Technologies and the fly likes How to aoid overwrite while marshal inside of the for loop Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply locked New topic
Author

How to aoid overwrite while marshal inside of the for loop

Srinivasan Chinnaraj
Greenhorn

Joined: Mar 18, 2013
Posts: 6

I am trying to marshal java object into XML. i want to marshal java object into XML while it inside the for loop.

for(i=0;i<=2;i++){

........................
...........................
...........................

jaxbMarshaller.marshal(details, xmlFile);

}

for the above code it's overwriting in the XML file after completion of each loop . but i want to write in new line after completion of each loop. Please let me know , how to do?
Ranganathan Kaliyur Mannar
Bartender

Joined: Oct 16, 2003
Posts: 1076
    
  10

Hi,
I have moved this post to our XML forum where I think you will get better replies.


Ranga.
SCJP 1.4, OCMJEA/SCEA 5.0.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10167
    
    8

Like I had requested before please do take some efforts to CarefullyChooseOneForum
Also, do not post the same question multiple times. Let us continue the discussion in your original topic http://www.coderanch.com/t/613980/XML/avoid-overwrite-XML-marshal-mentioned
Did you follow Bill's suggestion?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
wood burning stoves
 
subject: How to aoid overwrite while marshal inside of the for loop
 
Similar Threads
Java JDBC jtable only displaying one record
Castor trouble
readObject from Stream till EOF
how to get XML from javaobject using JAXB
How to avoid overwrite in the XML while marshal mentioned inside of for loop