943,600 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Marked Solved
  • Views: 1974
  • VB.NET RSS
Nov 20th, 2008
0

xml to text using vb.net

Expand Post »
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()
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
harrybern is offline Offline
6 posts
since Nov 2008
Nov 21st, 2008
0

Re: xml to text using vb.net

Reputation Points: 10
Solved Threads: 9
Junior Poster
sierrainfo is offline Offline
144 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: printing the jpg file using vb.net
Next Thread in VB.NET Forum Timeline: Convert HTML file to PDF file through code





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC