xml to text using vb.net

Please support our VB.NET advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Nov 2008
Posts: 6
Reputation: harrybern is an unknown quantity at this point 
Solved Threads: 0
harrybern harrybern is offline Offline
Newbie Poster

xml to text using vb.net

 
0
  #1
Nov 20th, 2008
Hi All

I am trying to convert xml file to a text file. But my program creates an empty text file and does not copy any text from the xml file. Please help

Thanks

My code:

Dim Doc As New XmlDocument
Dim NodeList As XmlNodeList

Doc.Load("C:\Temp\MyXml.xml")
NodeList = Doc.SelectNodes("/response/TAG")
Dim sw As New StreamWriter("C:\Temp\MyXmlContents.txt", False)

For Each Node As XmlNode In NodeList
For i As Integer = 0 To Node.ChildNodes.Count - 1
With Node.ChildNodes.Item(i)
sw.WriteLine(.Name & ": " & .InnerText)
End With
Next
Next

sw.Close()
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 144
Reputation: sierrainfo is an unknown quantity at this point 
Solved Threads: 9
sierrainfo sierrainfo is offline Offline
Junior Poster

Re: xml to text using vb.net

 
0
  #2
Nov 21st, 2008
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 733 | Replies: 1
Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC