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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DOM:Updating an element - different approaches?

Status
Not open for further replies.

MrPeds

Programmer
Jan 7, 2003
219
GB
Hi,

I am using DOM and VBScript to update an XML element.

My question is this, are there many approaches to updating elements?

For example, should I only use setAttribute and/or setAttributeNode functions to update the info, OR should I use cloneNode to create a new element and then replace the old element with the new one?

What are the pro's and cons of the two approaches and are there any others to consider?

Thanks,

MrPeds
 
The simpliest is the best don't you think so ?
By the way, cloning a node, updating its values, deleting old one and then replacing it with cloned one is a little bit CPU and memory wasting.
What I presonnally use is the setAttribut method that is wimple and fast. Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top