Example of an asp XML code


You can easily understand how xml data is displayed in an asp page if you look at an example for that. In our case let us consider that your xml data is available in the xml file 'xmldata.xml'. Now to load the xml file to an xml object, the following is used,

Dim xmlobj
Set xmlobj = Server.CreateObject("Microsoft.XMLDOM")
xmlobj.async = False
xmlobj.load (Server.MapPath("xmldata.xml"))

And if you want to read the first child node which has the title of a book, in the xml file, you can do so by,

Dim booktitle
booktitle = xmlobj.documentElement.childNodes(0).text
Set xml = Nothing

Now you can display the title of the book within your web page, using

<% = booktitle %>

With this as an example you can try to navigate through all the elements of the xml file and then display them in the web 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.