Валидатор W3C сообщает мне
Line 256, Column 12: non SGML character number 0
Обе ошибки происходят в самом конце файла.
Вот мой сокращенный код:
dim writer as XmlWriter
dim xmlSettings as new XmlWriterSettings
xmlSettings.Encoding = Encoding.UTF8
xmlSettings.CheckCharacters = true
xmlSettings.ConformanceLevel = ConformanceLevel.Document
xmlSettings.Indent = true
writer = XmlWriter.Create("D:\somedata.xml", xmlSettings)
writer.WriteStartDocument()
writer.WriteStartElement("listings")
while invReader.Read( )
writer.WriteStartElement("listing")
'a bunch of .writeElementString calls here
writer.WriteEndElement()
end while
writer.WriteEndElement()
writer.WriteEndDocument()
writer.Close()