hi there,
i tried a lot, but it does not work correctly
it is more copied to the substr than expected,
should be only a "<tag>" but outputs "<tag>etc"
shuld parse a xml file like that:
<?xml version="1.0" encoding="iso8859-1"?>
<Hotel id="0" version="0">
<Room id=>
<number>0</number>
<Reservation id=>
<von>01/02/00</von>
<bis>05/41/12</bis>
<GuestA id=>
<vorname>Ruessel</vorname>
<nachname>Schuessel</nachname>
<strasse>AmBach</strasse>
but output is:
<?xml version="1.0" encoding="iso8859-1"?
<Hotel id="0" version="0"
<Room id=>
<number>0<
<Reservation id=>
<von>01/
<bis>05/
<GuestA id=>
<vorname>Rues
<nachname>Schu
<strasse>AmBa
source of the read function filehandle is opende elsewhere...
string xmlReadAttrib()
{
string tmpstr = "";
string data = "";
string type ="";
while(!infile.eof())
{
getline(infile, tmpstr);
type = tmpstr.substr((tmpstr.find("<",0)),(tmpstr.find("> ",0)));
cout << type << endl;
}
return type;
}