Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Reading mutilple element types with StaxEventItemReader

  1. #11
    Join Date
    Mar 2012
    Posts
    3

    Default

    thanks again!
    i'll try to implement it.

  2. #12
    Join Date
    Sep 2010
    Posts
    5

    Default

    This is enlightening. Is there anyway the StaxEvenItemReader (or its variants) can process nest items. I have to parse a large file with complex structure like below. I am wondering if Spring Batch is good fit for it. Stuck here. Any idea would be much appreciated !

    <xml...>
    <records>
    <record id="1">
    <simpleValue>1</simpleValue>
    <recordDetail>
    <name>detail1</name>
    <count>3</count>
    </recordDetail>
    <recordlinks>
    <recordlink>
    ....
    </recordlink>
    <recordlink>
    ....
    </recordlink>
    </record>
    <record id="2">
    <simpleValue>2</simpleValue>
    <recordDetail>
    <name>detail2</name>
    <count>3</count>
    </recordDetail>
    <recordlinks>
    <recordlink>
    ....
    </recordlink>
    <recordlink>
    ....
    </recordlink>
    </record>
    <records>
    </xml>

    Simon

  3. #13

    Default

    Check out the details on the xstream marshaller (org.springframework.oxm.xstream.XStreamMarshaller ). If you don't like how it handles the XML then swap it out for a different marshaller.

    Jeff

  4. #14
    Join Date
    Sep 2010
    Posts
    5

    Default

    Actually that's exactly what in my mind. Having spent too much time to make XstreamMarshaller work. Still I couldn't get the attribute correctly. Will give Jaxb a try as I red nice thing about them. Thanks.

    Quote Originally Posted by visualjeff View Post
    Check out the details on the xstream marshaller (org.springframework.oxm.xstream.XStreamMarshaller ). If you don't like how it handles the XML then swap it out for a different marshaller.

    Jeff

  5. #15
    Join Date
    Sep 2010
    Posts
    5

    Default

    Just a follow-up. I tried playing with Jaxb2 Marshaller. It works like a charm. I am new to both xstream and jaxb2. Guess I am going to say bye-bye to xstream.


    Quote Originally Posted by fwr2010 View Post
    Actually that's exactly what in my mind. Having spent too much time to make XstreamMarshaller work. Still I couldn't get the attribute correctly. Will give Jaxb a try as I red nice thing about them. Thanks.

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
  •