Using XML DOM to parse in ASP

Parsing an xml file using asp can be done using the xmldom object. The xmldom object has a lot of methods to work with an xml file. You can use these methods to iterate through the nodes of an xml file and display the data you get from it. You can also use an xsl file to display the data in a formatted manner according to your requirement.

Once you have created an xmldoc object you can use the selectNodes method to select all the nodes that you want from the root node. For example an xmlQuery like "//employees" that is passed to the selectNodes method will get all the nodes of the employees. Assign the result that you get out of the selectNodes command to a variable and find the length of this variable.

This gives the number of nodes you have in the xml file. Now iterate through the nodes using a 'for' loop and use Response.Write to display the result. Use the transformNode method to transform the data you get using an xsl file to get formatted data.



.

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.