Hello there,
I have an xml file that has the following structure
Aggregation Actions
Aggregation
Actions
Aggregation Actions
Aggregation
Actions
............... ....
............... .
............
I am using java library classes (jar files) to iterate through the xml file as listed below
The code works fine. The only issue is that it only iterates over the actions of one aggregation (i.e. the first record in the xml)
Aggregation Actions
Aggregation
Actions
it ignores the 2nd, 3rd, 4th......record s
I need a way to iterate over the actions of all the aggregations, and do specific calculations on each aggregation depending on its actions.. Hope this question is clear. Thanks.
I have an xml file that has the following structure
Aggregation Actions
Aggregation
Actions
Aggregation Actions
Aggregation
Actions
............... ....
............... .
............
I am using java library classes (jar files) to iterate through the xml file as listed below
The code works fine. The only issue is that it only iterates over the actions of one aggregation (i.e. the first record in the xml)
Aggregation Actions
Aggregation
Actions
it ignores the 2nd, 3rd, 4th......record s
Code:
for (Iterator aggActionsiterator = actionList.iterator(); aggActionsiterator.hasNext();)
{
AggregationActions aggregationActions = (AggregationActions) aggActionsiterator.next();
ArrayList<Action> actions = (ArrayList<Action>) aggregationActions.getActions(); // this is for aggregation actions
// This iterates over the actions of ONE aggregation
for (Iterator aggActionsIterator = actions.iterator(); aggActionsIterator.hasNext();)
{
Action action = (Action) aggActionsIterator.next();
if (action.getActionType() == ActionType.SUPPLY)
{
// do something for all the aggregation actions in the xml file that is of type supply. however it only does it for 1
}