views:

118

answers:

1

Hey,

I asked the almost the same question before also, but i have not yet been able to figure out how to solve this issue of mine.

I have been assigned a project, in which I get a .xml file, which has field like, <TITLE>, <AUTHOR>,<ABSTRACT>, <COMMENT> and the <COMMENT> tag comes empty in the .xml, rest all the fields are already filled. I have to parse this xml, and generate a report of it, i have already done this. But the problem is, that i have a dropdown box for every COMMENT field in my report, and when i make change in the drop down box it shows the change on the client page but it does not update the xml file on the sever.

How can i do that. Is there anyway to insert, delete, update xml nodes?

Kindly help me with this. I am using DOM to parse the xml file.

Also i read somewhere to XMLDocument class to make changes in the xml file. But if that is possible, can you please tell me about where can i find samples of xmlDocument used to make changes in xml file.

I appreciate you help.

Best Zeeshan

A: 

The first place to start would be at w3schools. Once you can make changes to your document e.g.:-

var textNode = dom.createTextNode(myText);
dom.documentElement.selectSingleChild("COMMENT").appendChild(textNode);

You then need the servers assistance to accept the new XML document. You will need either a server script that accepts the XML document sent using a POST request or for the server to support PUT request to replace the original XML url. You will need the XmlHttpRequest object to acheive that.

XmlHttp on W3Schools can give you a beginners guide to doing that.

AnthonyWJones