suspicious_mind
02-14-2004, 06:50 AM
Hi,
I'm working on a small database using Javascript and XML.
The problem is, when I add a new node to my XML file using Javascript, it is not formatted in the XML-tree kindof style, but it's put in one long line. How can I preserve the tree style in my XML document when adding nodes?
Example of tree:
<XML>
<BOOK REF="0">
<TITLE>Blah</TITLE>
<AUTHOR>Blah</AUTHOR>
</BOOK>
</XML>
When adding node it looks like this:
<XML>
<BOOK REF="0">
<TITLE>Blah</TITLE>
<AUTHOR>Blah</AUTHOR>
</BOOK>
<BOOK REF="1"><TITLE>blah</TITLE><AUTHOR>blah</AUTHOR></BOOK></XML>
I'm working on a small database using Javascript and XML.
The problem is, when I add a new node to my XML file using Javascript, it is not formatted in the XML-tree kindof style, but it's put in one long line. How can I preserve the tree style in my XML document when adding nodes?
Example of tree:
<XML>
<BOOK REF="0">
<TITLE>Blah</TITLE>
<AUTHOR>Blah</AUTHOR>
</BOOK>
</XML>
When adding node it looks like this:
<XML>
<BOOK REF="0">
<TITLE>Blah</TITLE>
<AUTHOR>Blah</AUTHOR>
</BOOK>
<BOOK REF="1"><TITLE>blah</TITLE><AUTHOR>blah</AUTHOR></BOOK></XML>