473,385 Members | 1,333 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

loop through a list of record [stored in xml] using JAR library and execute specific

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......records

Expand|Select|Wrap|Line Numbers
  1. for (Iterator aggActionsiterator = actionList.iterator(); aggActionsiterator.hasNext();)
  2. {
  3. AggregationActions aggregationActions = (AggregationActions) aggActionsiterator.next();
  4.  
  5.     ArrayList<Action> actions = (ArrayList<Action>) aggregationActions.getActions(); // this is for aggregation actions
  6.  
  7. // This iterates over the actions of ONE aggregation
  8.  
  9. for (Iterator aggActionsIterator = actions.iterator(); aggActionsIterator.hasNext();)
  10.             {
  11. Action action = (Action) aggActionsIterator.next();
  12.  
  13. if (action.getActionType() == ActionType.SUPPLY)
  14. {
  15. // do something for all the aggregation actions in the xml file that is of type supply. however it only does it for 1
  16. }
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.
Nov 19 '12 #1
0 1600

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Diodak | last post by:
**************************************** How can get RANDOM record from XML file? **************************************** for e.g. in xml files i have aprox.200 records. how get random position...
1
by: PA | last post by:
I am using .NET web aplication and MSDE 2000. I receive new record in XML format which I want to add into MSDE 2000. I am doing it as below. Private Sub InsertNew(ByVal sData1 As String) Dim SR1...
3
by: Earl Teigrob | last post by:
I am considering writing a Class that Selects, Adds, Updates and Deletes Nodes in an XML File but do not what to reinvent the wheel. (See XML file below) That data format would emulate records...
4
by: Stuart Ferguson | last post by:
I am currently writing code to execute SQL Server 2000 Stored procedured using the ODBC.NET SQL Server Driver. The particular stored procedure I am using has multiple paramaters which I have...
3
by: Klint Gore | last post by:
Does anyone know of a mailing list for application developers using postgres? It'd probably be more relevant than pgsql-general for my question. Failing that, what do people use to generate...
3
by: ml41782 | last post by:
I have a solarr grid tie system. the power data is dumped in xml. using xsl I want to change the color of the field based on the data going positive ( power from the grid ) or negative ( solar is...
0
by: Srireddy | last post by:
Hi all, I am trying to read an xml using stored procedure and upload it in to the DB. I am using DB2 v8.0. can anyone help me complete my assignment... Thanks in advance..
3
by: J055 | last post by:
Hi I'd like to get a populated datatable, create an in memory xml document (file shouldn't be more than a couple of meg), load an XSLT file, do a transform and stream it to a browser. What am I...
1
by: ssrirao | last post by:
Hi, I have a table in the database and I want to insert the values into this table by using JavaScript. Does anyone know how to execute the Sql stored procedure using Javascript. Thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.