AJAX and edit XML

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

AJAX and edit XML

Post by sarris »

Hi there, i was wondering if its possible to add elements onto an existing XML file and how that would happen.
I am trying to find how to do that with AJAX but didnt find anything really. Only how to retrieve and read an XML.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If you're talking about altering the file itself, Ajax does not have that power. If you're talking about inserting an element temporarily (in the browser) Ajax can do that.

The former would require interacting with the server to get the file changed.
sarris
Forum Contributor
Posts: 137
Joined: Mon Dec 04, 2006 2:44 pm

Post by sarris »

i see...so the solution would be to retrieve the XML document using AJAX and the http_request.XMLresponse, alter the XML document topically and write it on a new file which overwrites the existing...Right?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

javascript doesn't have file-write permissions in a browser - you should look at using PHP and it's XML functions instead.
Post Reply