0

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()

2
Contributors
1
Reply
4
Views
8 Years
Discussion Span
Last Post by sierrainfo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.