reading from xml file need HELP

i am trying to read some data in from an xml file, the data is stored like this:
1
2
3
4
5
6
7
8
9
10
11
12
<publisher>BantamBooks</publisher>
<ISBN>9780553825480</ISBN>
<Title>WorthDyingFor</Title>
<Editor></Editor>
<ConferenceDate></ConferenceDate>
<Author>LeeChild</Author>	
<publisher>Doubleday</publisher>
<ISBN>9780385619264</ISBN>
<Title>Snuff</Title>
<Editor></Editor>
<ConferenceDate></ConferenceDate>
<Author>TerryPratchett</Author>


one whole set of data starts with publisher and ends at author, the xml file has around 20 pieces of data in it.

My function to read the file in is this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
while (!ifile.eof()){
	dataToAdd = new proceedingsBook;
	ifile>>line;
	dataToAdd->setPublisher(removeTags(line, "publisher"));
	ifile>>line;
	dataToAdd->setIsbn(atoi(removeTags(line, "ISBN").c_str()));
	ifile>>line;
	dataToAdd->setTitle(removeTags(line, "Title"));
	ifile>>line;
	dataToAdd->setEditor(removeTags(line, "Editor"));
	ifile>>line;
	dataToAdd->setDate(removeTags(line, "ConferenceDate"));
	ifile>>line;
	dataToAdd->setAuthor(removeTags(line, "Author"));
	
	list.addToList(dataToAdd);

	list.find(*dataToAdd);				//locate the data that has just been input into list
	odata = list.getCurrent();		//write data from the list into output data

	cout<<"**********************************NEW PUBLICATION ADDED******************** "<<endl;

	cout<<"Publisher: "<<odata->getPublisher()<<endl;
	cout<<"ISBN:      "<<odata->getIsbn()<<endl;
	cout<<"Title:     "<<odata->getTitle()<<endl;
	cout<<"Editor:    "<<odata->getEditor()<<endl;
	cout<<"Date:      "<<odata->getDate()<<endl;
	cout<<"Author:    "<<odata->getAuthor()<<endl;	
}


However it appears that the same first record is being read in again and again as the output printing the added publication prints the same one over and over again.
How can i make it go through the file properly and read i all the data?
Topic archived. No new replies allowed.