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


My code:

Dim Doc As New XmlDocument
Dim NodeList As XmlNodeList

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


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.