I\'m trying to import the kml xml Google earth file into an application, but i can\'t seem to get the xDocument syntax right in order to do what i want, i\'m wondering if anyone
My guess is that you've forgotten to use the namespace in your LINQ to XML queries. It's easy enough to extract the data from this:
XNamespace ns = "http://earth.google.com/kml/2.2";
var doc = XDocument.Load("file.xml");
var query = doc.Root
.Element(ns + "Document")
.Elements(ns + "Placemark")
.Select(x => new PlaceMark // I assume you've already got this
{
Name = x.Element(ns + "name").Value,
Description = x.Element(ns + "description").Value,
// etc
});
If that doesn't help, please post a complete example of what you've tried, and what went wrong.