|
Posted by PTM on 08/18/06 12:39
I have created an xml file using normal file write (was less code than DOM),
the layout of which is nice and easy to view both in a text editor (eg,
wordpad) and in a browser.
eg:
<xml header blah.....>
<books>
<book>
<title>Contents</title>
<author>Contents</author>
</book>
</books>
When I use DOM to update the file with new items, they ALL end up written to
the file as a continuous line that starts before the closing </books> tag.
So the file ends up looking like this:
<xml header blah.....>
<books>
<book>
<title>Contents</title>
<author>Contents</author>
</book>
<book><title>Contents</title><author>Contents</author></book><book><title>Contents</title><author>Contents</author></book></books>
I have tried a number of things, and am having no luck. I either get it
correctly formatted with only the new entries (loosing all the existing
content), or I get the above result.
Is there anyway to get DOM to correctly format the new items? If so, how do
I do it?
Cheers,
Phil
[Back to original message]
|