Sep 22nd, 2012, 03:54 AM
Write Multiple Data Types to One XML file
I need to read objects from 2 different tables and write to a single XML file. I am using org.springframework.batch.item.database.HibernateC ursorItemReader to read from the database and javax.xml.stream.XMLEventWriter.StaxEventItemWrite r to write the XML. The structure I am trying to achieve looks like this.
Categories and products come from 2 different database tables. I was thinking of doing this in two steps. First write categories then write products. However, looks like the StaxEventItemWriter doesn't allow any appending. Is there a solution to this other than doing a separate merge step as suggested in
http://forum.springsource.org/showth...ting-to-1-file ? Can we have multiple readers and a single marshaller?
My search for a solution hasn't turned up anything so far.
Last edited by supdeva; Sep 22nd, 2012 at 03:58 AM.
Sep 24th, 2012, 08:42 PM
Looks like I missed something. Am I trying to do this the wrong way? or is there actually no solution for this?