Quantcast
Channel: XML, System.Xml, MSXML and XmlLite forum
Viewing all articles
Browse latest Browse all 935

Deserialize -> Serialize produces invalid XML file

$
0
0

Hi,

I'm trying to read and write .gpx file produced by an Garmin handheld device. Everything is working fine except the output file is invalid according to http://www.validome.org/xml/validate/ -validator.

Even if I just read the file into a dataset and write it immediately to another file without making any changes to data, I get invalid output. Data itself is valid but something gets wrong with header (schema definitions etc.)

Public Sub TryXmlDocument()
     Dim xmlFile As XmlReader
     Dim ds as New DataSet
     xmlFile = XmlReader.Create("filename.gpx", New XmlReaderSettings())
     ds.ReadXml(xmlFile, XmlReadMode.Auto)
     ds.WriteXml("filename_new.gpx")
End Sub

Anyone out there with solution?


Viewing all articles
Browse latest Browse all 935

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>