Please review xml kml file attachment below for details.
SelectSingleNode is returning null from the path below. Review xml kml file to see what I am doing wrong below.
XmlNode n = kmlDoc.DocumentElement.SelectSingleNode("/kml/Document/Placemark/MultiGeometry/Polygon/outerBoundaryIs/LinearRing/coordinates");
Midhun TpRank #388 · 6.5K reputationPosted Sep 29, 2016, 10:59 PM EDT
In your kml file, remove the portion marked in red from kml node.
David SmithRank #999 · 2K reputationPosted Sep 30, 2016, 3:07 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 30, 2016, 3:23 AM EDT
David SmithRank #999 · 2K reputationPosted Sep 30, 2016, 3:40 AM EDT
var xmlNode = kmlDoc.SelectSingleNode("kml/Document/Placemark/MultiGeometry/Polygon/outerBoundaryIs/LinearRing/coordinates");
if (xmlNode != null)
{
xmlNode.InnerText = KmlObjectString.ToString();
string[] nameArray = browseFile.SafeFileName.Split('.');
kmlDoc.Save(@"C:\temp\KML\" + nameArray[0] + ".kml");
}
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts