Hi,
 
Hope you don't mind but I've copied the Castor user group into this response.
 
You need to implement a SAX DocumentHandler that knows about the elements in your XML that represent each of your aggregates. This handler will manage instances of Castor's UnmarshallHandler class (see Unmarshaller.createHandler method). Note that using this approach you must invoke the SAX parser and begin the parsing process with your own DocumentHandler.
 
Your handler should forward SAX events to the above Castor handler as appropriate. Typically in your handlers startElement and endElement code you will also have some logic to look for the start and end of your aggregate. Either creating the Castor handler as above, or calling its getObject method to obtain the object it has been unmarshalling.
 
Thanks,
 
Andrew Fawcett.
 


From: Mohamed Basha [mailto:[EMAIL PROTECTED]
Sent: 10 January 2005 08:29
To: Andrew Fawcett
Subject: Re: [castor-user] XML - Performance with castor binding framework

Hi,

 

I am facing the same problem that is been discussed in this thread. I need to handle large XML files using castor probably up to 100 megabytes or even more.

Certainly, I don't want to create all the objects in memory as it causes performance and memory issues. So, I want to stream the repeating aggregate one by one and handle the objects. Can you please suggest a way to do this? I was looking through StAX but I am not sure how I can use that along with Castor.

 

Thanks,

Md. Ibrahim Basha

 





The information in this message is confidential and may be legally privileged. It may not be disclosed to, or used by, anyone other than the addressee. If you receive this message in error, please advise us immediately.

Internet emails are not necessarily secure. CODA does not accept responsibility for changes to any email which occur after the email has been sent. Attachments to this email may contain software viruses, which could damage your systems. CODA has checked the attachments for viruses before sending, but you should virus-check them before opening.
----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

Reply via email to