Manipulating XML files using ASP

Methods and properties of the XMLDOM can be used to manipulate the xml file using ASP. For example if you want to add an element with some text to an already existing xml file, the first step in asp is to create an xmldom object and load the xml file to it. You can check the outcome of the load method to find out if the xml file is properly loaded or else you can display some error message.

Once the xml file is loaded properly you can use the createElement method to create the element needed and the createTextNode method to create the text that is to be added to the element you have created.

The new element object's appendChild method can be used to add the text to the element. Now navigate to the root element of the document using xml documents documentElement and now append the new element to the document.

After doing any manipulation to the xml file the changes have to be incorporated to the physical file by using the xml document's save method. This method takes the path of the file as its argument.



SetApp - 100 Apps for everything you ever wanted to do on Mac

FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

_______________________________________



 

 

FREE Subscription

Stay Current With the Latest Technology Developments Realted to XML. Signup for Our Newsletter and Receive New Articles Through Email.

Name:

Email:

Note : We never rent, trade, or sell our email lists to anyone. We assure that your privacy is respected and protected.

 

 

Add to My Yahoo!

Visit XML Training Material Guide Homepage

 

 

“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”

Copyright - © 2004 - 2019 - All Rights Reserved.