Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Dhanasekar Thangavelu

Greenhorn
+ Follow
since Jul 05, 2007
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dhanasekar Thangavelu

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.

Please find the below limitations of using the attributes rather elements

attributes cannot contain multiple values (child elements can)
attributes are not easily expandable (for future changes)
attributes cannot describe structures (child elements can)
attributes are more difficult to manipulate by program code
attribute values are not easy to test against a Document Type Definition (DTD) - which is used to define the legal elements of an XML document


-Dhanasekar.T
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