我正在尝试编辑一个 xml 文件。
XmlDocument myXmlDocument = new XmlDocument();
myXmlDocument.Load(@"C:\\Users\\Vahid\\Desktop\\HG\\HG\\HG\\singleM.kml");
XmlNode myNode = myXmlDocument.SelectSingleNode(
"/kml/Document/Placemark/Point/coordinates");
myNode.Value = coordinates;
myXmlDocument.Save(@"C:\\Users\\Vahid\\Desktop\\HG\\HG\\HG\\singleM.kml");
这是我的 xml (.kml) 文件:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>change.kml</name>
<Style id="sn_ylw-pushpin"></Style>
<Placemark>
<Point>
<coordinates>0, 0,0</coordinates>
</Point>
<name>12</name>
</Placemark>
</Document>
</kml>