Dec 2nd, 2010, 08:38 AM
Writing complex type itens into XML File
I want to write itens with STAX writer into specific element of XML file, according to XSD. For example:
<!-- I WANT TO WRITE ITENS HERE -->
May you help me???
Dec 13th, 2010, 06:49 AM
Until now, I haven't solved this problem. I have thought if I can solve this using JAXB marshaller instead XStream. I don't know if this works, but I'll try....
Someone can help me?
Thanks a lot!
Dec 15th, 2010, 08:11 AM
I found a solution extending StaxEventItemWriter e rewriting the methods open and close. Before write itens, I called createStartElement in open method (if the job is not restarted) to write the necessary start elements where itens will be write inside. After that, I called the createEndElement in close method, before called footerCallback, to write end elements for each start element that wrote before.
Thank you very much!
Tags for this Thread