Hi Brent,
 
Castor's Marshaller and Unmarshaller classes support SAX API so you can implement your streaming idea through these.
 
As you say a good idea to known the scope (boundries) of your data, only you can answer this because its your XML schema.
 
Once you know the scopes you can simply monitor for these in your SAX handlers.

You have two options,
 
A) Invoke the Unmarshaller once with a chuck aware SAX handler.
 
B) Invoke your SAX parser with a chunk aware SAX handler that delegates to the Unmarshaller.
 
Option B) sometimes works bes as you have more control over the scope of the Unmarshaller instance your using.
 
Cheers,
 
Andy.


From: Brent Picasso [mailto:[EMAIL PROTECTED]
Sent: 13 May 2005 16:00
To: [email protected]
Subject: [castor-dev] streaming version of castor for huge XML structures?

Hi all,
 
We have a need for processing huge XML files, sizes that would exeeced what the VM could hold in memory.
 
I'm envisioning a streaming form of castor, similar to how SAX parsing works, but conceptually at a higher level. For example, as Castor processes the XML stream, it fires off object unmarshalling notifications (with the freshly unmarshalled object available). This is in constrast to building up the object in memory and sending it all back at once.
 
There would be some things to resolve in terms of deep object graphs- where would the marshalling boundaries be?
 
From my experience with Castor, I'm pretty sure there's no advertised support for this. However, are there any hooks in the codebase that I could leverage? Any multi-cast listeners I could create and hook into castor, so I could receive unmarshalling notifications?
 
Thanks for the ear.
 
Brent
 
 
 




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.

Reply via email to