2 Replies Latest reply on Nov 16, 2009 8:11 AM by Richard Opalka

    JAXB - elements unmarshalled to other parent

    Ondrej Zizka Master

      Hi all,

      I have a problem with JAXB unmarshalling. First I marshall to a XML:

       <reservationCalendars>
       <resource name="jawa02">
       <reservations>
       <reservation to="2009-11-23T17:13:20.576+01:00" from="2009-11-13T17:13:20.576+01:00" forUser="ozizka"/>
       </reservations>
       </resource>
       <resource name="jawa01">
       <reservations>
       <reservation to="2009-11-18T17:13:20.576+01:00" from="2009-11-13T17:13:20.576+01:00" forUser="ozizka"/>
       <reservation to="2009-11-23T17:13:20.576+01:00" from="2009-11-19T17:13:20.576+01:00" forUser="oskutka"/>
       </reservations>
       </resource>
       </reservationCalendars>
      


      Then I unmarshall it, but JAXB reads this:

       <reservationCalendars>
       <resource name="jawa02">
       <reservations>
       <reservation to="2009-11-23T17:13:20.576+01:00" from="2009-11-13T17:13:20.576+01:00" forUser="ozizka"/>
       <reservation to="2009-11-18T17:13:20.576+01:00" from="2009-11-13T17:13:20.576+01:00" forUser="ozizka"/>
       <reservation to="2009-11-23T17:13:20.576+01:00" from="2009-11-19T17:13:20.576+01:00" forUser="oskutka"/>
       </reservations>
       </resource>
       <resource name="jawa01">
       <reservations/>
       </resource>
       </reservationCalendars>
      


      It's most likely an error in my JAXB annotations.
      Anyone has ever seen this? Any idea what could cause this? I can post the code if necessary.