I have been steadily building an XML output doc from an existing .NET web app. However, I just started getting the error "Token StartElement in state Epilog would result in an invalid XML document". From what I have read, it sounds like this means I am trying to append to an existing document - however, that document has been deleted.
Here's what I've stripped it down to, and it still gives the error.
Code:
Dim writer As New XmlTextWriter(path, Nothing)
writer.Formatting = Formatting.Indented
writer.WriteStartDocument()
writer.WriteStartElement("CounselingInformation")
writer.WriteEndElement()
For i = 0 To ds.Tables(0).Rows.Count - 1
writer.WriteStartElement("CounselingRecord")
writer.WriteEndElement()
Next
writer.WriteEndDocument()
writer.Close()
Any ideas on why this would throw the error?
Thanks in advance for your comments.