This is what i'm trying to Unmarshall. It's part of the output of a Microsoft Project file saved as an XML file. I have class which represents a WeekDay Element and I want a collection of WeekDay elements. However I want to add to every one of those elements the UID (Unique ID i think it means) of the Calendar element and the BaseCalendarUID value. I don't want to have a Calendar class with a collection of WeekDays. I want the root element (<Project/>) to have the collection of WeekDays.
<Calendar> <UID>1</UID> <Name>Estándar</Name> <IsBaseCalendar>1</IsBaseCalendar> <BaseCalendarUID>-1</BaseCalendarUID> - <WeekDays> - <WeekDay> <DayType>1</DayType> <DayWorking>0</DayWorking> </WeekDay> - <WeekDay> <DayType>2</DayType> <DayWorking>1</DayWorking> - <WorkingTimes> - <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> - <WorkingTime> <FromTime>15:00:00</FromTime> <ToTime>19:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> - <WeekDay> <DayType>3</DayType> <DayWorking>1</DayWorking> - <WorkingTimes> - <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> - <WorkingTime> <FromTime>15:00:00</FromTime> <ToTime>19:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> - <WeekDay> <DayType>4</DayType> <DayWorking>1</DayWorking> - <WorkingTimes> - <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> - <WorkingTime> <FromTime>15:00:00</FromTime> <ToTime>19:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> - <WeekDay> <DayType>5</DayType> <DayWorking>1</DayWorking> - <WorkingTimes> - <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> - <WorkingTime> <FromTime>15:00:00</FromTime> <ToTime>19:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> - <WeekDay> <DayType>6</DayType> <DayWorking>1</DayWorking> - <WorkingTimes> - <WorkingTime> <FromTime>09:00:00</FromTime> <ToTime>13:00:00</ToTime> </WorkingTime> - <WorkingTime> <FromTime>15:00:00</FromTime> <ToTime>19:00:00</ToTime> </WorkingTime> </WorkingTimes> </WeekDay> - <WeekDay> <DayType>7</DayType> <DayWorking>0</DayWorking> </WeekDay> </WeekDays> </Calendar> Joachim Grüneis wrote: > > Hello, > > Sorry but I do not understand what your example should express. Can > you please provide some information about the classes involved and put > more information into the XML sample... > > You're writing that you want to have ID and Name in all Elements but > your sample doesn't reflect it?? > > Regards > > Joachim > > On 17/04/2008, joni.loky <[EMAIL PROTECTED]> wrote: >> >> How can i map a collection so that all of its elements will have the >> same >> attribute taken from the level which contains them. For example: >> >> <root> >> <ID>id</ID> >> <Name>name</Name> >> <Elements> >> <element1><attr1></attr1><attr2></attr2><attr3></attr3></element1> >> <element2><attr1></attr1><attr2></attr2><attr3></attr3></element2> >> <element3><attr1></attr1><attr2></attr2><attr3></attr3></element3> >> </Elements> >> </root> >> >> I want all of my elements to have the ID and Name of the root. >> >> Thnx. >> Joni. >> -- >> View this message in context: >> http://www.nabble.com/Castor-%2B-Unmarshalling-diff-levels-%2B-Collection-tp16749241p16749241.html >> Sent from the Castor - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe from this list, please visit: >> >> http://xircles.codehaus.org/manage_email >> >> >> > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > > -- View this message in context: http://www.nabble.com/Castor-%2B-Unmarshalling-diff-levels-%2B-Collection-tp16749241p16763374.html Sent from the Castor - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email

