Using XML for ASP page

The content of the ASP page can be read from an xml file. This helps you in many ways. With this method you are free to alter only the xml file content which can also be done programmatically so that the end user who updates the content need not work with the page design. Hence it is wise to display the content from an xml file if you are going to keep on changing the content constantly.


_______________________________________________

The steps involved in using an xml file to display the content of a page are very simple if you are using ASP as the front end. All you have to do is to create an xml document object using the Server.CreateObject command. Once you have created the object you can use the object's Load command to load the xml file.

Use Server.MapPath to get the physical path to the xml file. Once you have loaded the xml file, now your job involves navigating through the xml file to the contents of each node and then displays it in the page. For example if xmlobj is the xml object then you can use the command like,

xmlobj.documentElement.childNodes(1).text

to get the text in the element 1 (the second node).





_______________________________________________

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

 

 

Copyright - © 2004 - 2017 - All Rights Reserved.