This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Appending elements to XML dynamically using SAX parser

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I want my data objects which is in a collection to be iterated such that i want to marshall only one object at a time and written to XML .So when i go to the second element in the collection, i wana append to the existing xml.So please let me know how to do it.I'm using Castor for XML-data binding and SAX parser


Thanks in advance !!
Dhanasekar
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Appending elements to XML dynamically using SAX parser Using SAX only you cannot append element to an XML document.

I want my data objects which is in a collection to be iterated such that i want to marshall only one object at a time and written to XML .So when i go to the second element in the collection, i wana append to the existing xml.

You can do this using castor.Castor would marshall the object graph you give as input to castor.
 
Dhanasekar Thangavelu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rahul,

If i'm correct , you wana try me with going for the collections for marshalling the objects to the XML.If so the issue is volume of data i'm facing to marshal using castor since i want to make sure whatever records written to xml till that point should'nt be lost whenever some exception breaks out...
Let me knnow your concerns...


Originally posted by Rahul Bhattacharjee:
Appending elements to XML dynamically using SAX parser Using SAX only you cannot append element to an XML document.

I want my data objects which is in a collection to be iterated such that i want to marshall only one object at a time and written to XML .So when i go to the second element in the collection, i wana append to the existing xml.

You can do this using castor.Castor would marshall the object graph you give as input to castor.

 
reply
    Bookmark Topic Watch Topic
  • New Topic