How to read an XML file in ASP

Reading an XML file in ASP is very simple if you are using the xmldom object. Create an xmldom object first and then load the xml file that you want to read in this xmlobject. For loading the xml file in the xmldom object you have to use the Load method available in it.

The load method takes the physical path of the xml file. It is not easy to guess the physical path of the xml file and hence you can use the Server.MapPath method to get it.

Before loading the xml file set the async property of the xml object to False. This ensures that the xml file is loaded fast as it is read.Once you have loaded the xml file to the xml object.

You can navigate through the xml object using the documentElement.childNodes(n).text and get the value available in the nth node of the xml file. Assign these values to some variable and then display the variable in any part of the asp page.



.

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.