Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit an XML file

Status
Not open for further replies.

knuckle05

Programmer
Dec 17, 2001
247
CA
Hi All,

I have successfully created an XML file using the XMLDOM.

I just don't know how to edit the content afterwards. Is there a way to access the text property of a sprcific node?

I've heard one way to edit is by using XSL. Does anyone know of any other solutions, and if possible could someone post a partial solution to help get me started in the right direction. Thanks
 
>> I just don't know how to edit the content afterwards.
>> Is there a way to access the text property of a sprcific node?

Yes there is but you must parse in the entire file and access the Node object as part of the DOM tree. Then to save the changes you must save the entire tree not just the single Node object.

I believe that using a DOM implementation to edit an existing document needs to go something like this:

* Parse document into DOM Tree object.
* Get reference to Node object to be modified.
* Modify Node object.
* Write document to disk.

Hope this helps
-pete
 
So I guess I would need to load the XML file in its entirety onto the page.

I will be editing it via an HTML form so I will need to save the entire file all over again.

This seems tedious, but it was what I originally thought and was hoping to be able to avoid. Thanks for your response...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top