I have an xml structure like below
<cr:TRFCoraxData instrumentId="8590925624" organizationId="4296241518">
<cr:Dividends>
<cr:ExDate>2017-02-27T00:00:00+00:00</cr:ExDate>
<cr:PeriodEndDate>2017-03-31T00:00:00+00:00</cr:PeriodEndDate>
<cr:PeriodDuration>P3M</cr:PeriodDuration>
</cr:Dividends>
<cr:AdjustmentFactors>
<cr:ExDate>2222-05-21T00:00:00+00:00</cr:ExDate>
<cr:AdjustmentFactor>0.50000</cr:AdjustmentFactor>
</cr:AdjustmentFactors>
</cr:TRFCoraxData>
So i have to element cr:ExDate
with same name in Kand AdjustmentFactors
tag.
Now i have pojo classes for both and then i have start and end element tag .
In my end element tag i have below condition like below
if (element.equals("cr:ExDate")) {
dividend.setExDate(tmpValue);
}else if (element.equals("cr:DividendEventId")) {
dividend.setDividendEventId(tmpValue);
}else if (element.equals("cr:AnnouncementDate")) {
dividend.setAnnouncementDate(tmpValue);
}
else if (element.equals("cr:ExDate")) {
adjustmentFactorObj.setExDate(tmpValue);
}else if (element.equals("cr:AdjustmentFactor")) {
adjustmentFactorObj.setAdjustmentFactor(tmpValue);
}
Clearly for "cr:ExDate" element if condition satisfies and i am not able to get and set in adjustmentFactorObj for "cr:ExDate" value.
Please suggest me how can i solve this problem