Announcement Announcement Module
Collapse
No announcement yet.
StaxEventItemReader & Unmarshalling complex xml Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • StaxEventItemReader & Unmarshalling complex xml

    Hello,

    I'm developing a Job which has to read a xml source to store it in another format. I'm trying to use the StaxEventItemReader class to read the xml with XStreamMarshaller to map the xml to java objects.

    I'm trying to map a xml structure like this one:

    HTML Code:
    <items>
        <item>
          <data>
            <datagroup1>
              <atribute1>0001</atribute1>
              <atribute2>value1</atribute2>
            </datagroup1>
            <datagroup2>
              <atribute3>value1</atribute3>
              <atribute4>value1</atribute4>
              <datasubgroup1>
                <atribute5>value1</atribute5>
                <atribute6>value1</atribute6>
              </datasubgroup2>
            </datagroup2>
            <datagroup3>
              <atribute7>value1</atribute7>
              <atribute8>value1</atribute8>
            </datagroup3>
          </data>
        </item>
        <item>
          <data>
            <datagroup1>
              <atribute1>0001</atribute1>
              <atribute2>value2</atribute2>
            </datagroup1>
            <datagroup2>
              <atribute3>value2</atribute3>
              <atribute4>value2</atribute4>
              <datasubgroup1>
                <atribute5>value2</atribute5>
                <atribute6>value2</atribute6>
              </datasubgroup1>
            </datagroup2>
            <datagroup3>
              <atribute7>value2</atribute7>
              <atribute8>value2</atribute8>
            </datagroup3>
          </data>
        </item>
    </items>
    Each atribute should be mapped to a propertie of our bean. The only example of StaxEventItemReader I have found, uses XStream and that reads a simple xml structure. Is there any way to map a complex xml like the one above using XStreamMarshaler?

    Where could I find more examples of StaxEventItemReader using other xml marshallers?

    thanks in advance,

    regards,

    Jon Mikel
    Last edited by jonmikelm; Sep 14th, 2010, 02:50 AM.

  • #2
    The marshalling framework comes from Spring WS. So see here: http://static.springsource.org/sprin.../html/oxm.html

    Comment

    Working...
    X