XML : Adding Trackpoints to GPX File

I'd like to write a gpx file with linq to xml. I tried the following method:

  System.Xml.Linq.XNamespace oXNamespace0 = "http://www.topografix.com/GPX/1/1";  XDocument xmlDoc = XDocument.Load(@"U:\..\..\BODY_SampleRoute2.gpx");  xmlDoc.Element(oXNamespace0+"trk").Element(oXNamespace0+"trkseg").Add(new XElement("TEST", "TEST"));    

But with this metod a failure accures?

Thanks for your help,

Andreas

No comments:

Post a Comment