Hi All,
I am writing a
servlet code which is supposed to retrieve data from a hashmap, then create an XML file and send it to a javascript that has AJAX functions.
I am using DOM to achieve this. My problem is when I convert the DOM file back into the
string to be sent to the javascript, it is not getting formatted properly.
e.g. if i have created a DOM file like <customer><fname>abc</fname><lname>xyz</lname></customer>, the corresponding string turns into:
<customer><fname>abcxyz</fname></lname></customer>.
I am sure I am missing out something very basic here, but I am not sure what.
Would be glad if anybody can help !
Here's my code for the same: