This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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 OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA 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: 1077
    
  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: 10268
    
    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!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to aoid overwrite while marshal inside of the for loop