Jeremy Bishop wrote:[color=blue]
>
> Hi,
>
> When I open a file for the second time (sequentially) i get the error
> error: junk after document element
>
> tA one-time opening and use of the file works fine, it's the second time
> where something goes wrong. The code basically looks like this:
>[/color]
please post the exact code.
Strip all unneccessary and not related stuff. It would be ideal, if you
could come up with a small, complete, compilable program which demonstrates
your problem.
[color=blue]
> ifstream in(path.c_str());
>
> assert(in);
>
> string line;
>
> while (getline(in, line))
>
> {
>
> // do stuff
>
> };
>
> // in.clear();
>
> // in.close();
>
> I have used in.clear() and closed() with no success... If i call the loading
> routine the second time,[/color]
From this I conclude that the above is in a function, which is
called 2 times. The first time it works, the second time it doesn't?
Correct ?
[color=blue]
> i get the error.[/color]
which error?
Where is the error detected? I can't see anythting in you 'code' above.
[color=blue]
> Does anyone have any ideas what
> the trouble might be?[/color]
--
Karl Heinz Buchegger
kbuchegg@gascad.at