Announcement Announcement Module
Collapse
No announcement yet.
Writing complex type itens into XML File Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Writing complex type itens into XML File

    Hello,

    I want to write itens with STAX writer into specific element of XML file, according to XSD. For example:

    <root>
    <header></header>
    <itens>
    <!-- I WANT TO WRITE ITENS HERE -->
    <item></item>
    ...
    </itens>
    <footer></footer>
    </root>

    May you help me???

    Thanks
    Fabiano Suet

  • #2
    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!

    Comment


    • #3
      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!

      Comment

      Working...
      X