-
Dec 6th, 2012, 06:09 AM
#1
StaxEventItemWriter of Spring Batch
Hi,
My spring batch admin application generates XML as output via itemwriter. The problem is that if any tag in the generated in XML is empty, it gets discarded in the xml implicitly. Any help on the same.
My expectation is if any tag is empty it should appear as <tagname></tagname> in the XML.
Brief code snippet :
StaxEventItemWriter<TransactionRecord> staxItemWriter = new StaxEventItemWriter<TransactionRecord>();
Map<String, String> aliases = new HashMap<String, String>();
aliases.put("TransactionRecord","com.thomascook.bb mm.bean.TransactionRecord");
aliases.put("segmentId","java.lang.String");
aliases.put("recordUse","java.lang.String");
Marshaller marshaller = new XStreamMarshaller();
((XStreamMarshaller) marshaller).setAliases(aliases);
staxItemWriter.setResource(resource);
staxItemWriter.setMarshaller(marshaller);
Please let me know if more information is required.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules