Manipulating XML files using ASPMethods 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.
|
|
||
|
|||
“Amazon and the Amazon logo are trademarks of Amazon.com, Inc. or its affiliates.”
Copyright - © 2004 - 2019 - All Rights Reserved.