Reply to xml file layout

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация