C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






How to Read XML File


Posted Date: 12 Sep 2008    Resource Type: Code Snippets    Category: XML

Posted By: Prafulla S Shimpi       Member Level: Gold
Rating:     Points: 10



There are some standard methods available to read xml files.

Dim m_xmldoc As New XmlDocument 'XML Document
Dim m_nodelist As XmlNodeList 'XML Node List
Dim m_nodeOA As XmlNode 'XML Node



1. either by loading xml file

m_xmldoc.LoadXml(strFilePath)

Try to avoid this method as this method throws an error while reading.
'The data at the root level is invalid'


2. by using path of xml file.

m_xmldoc.Load(strFilePath)

it actually populates the xml contents into xml document,and allows smooth reading of the same.

Read XML Nodes from Node list

'Populate Node list
m_nodelist = m_xmldoc.SelectNodes(NodePath)

Read Nodes
For Each m_nodeOA In m_nodelist
m_nodeOA.ChildNodes.Item(0).FirstChild.Attributes.GetNamedItem (NamedAttribute)

Next


This way you can retrieve all the values required.




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Reading XML File  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Reading a XML File using C#
Previous Resource: How to insert data in XML using dot net
Return to Discussion Resource Index
Post New Resource
Category: XML


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

fax server

Contact Us    Privacy Policy    Terms Of Use