public void SaveToNode(XmlElement e) { XH.SetXmlInt(e, "ID", GeonameID); XH.SetXmlString(e, "Name", CityName); XH.SetXmlString(e, "AS", ASCIIName); if (AlternativeNames.Length > 0) { XH.SetXmlString(e, "Alt", AlternativeNames); } XH.SetXmlDouble(e, "Y", Latitude); XH.SetXmlDouble(e, "X", Longitude); if (Elevation > 0.1) { XH.SetXmlDouble(e, "Z", Elevation); } XH.SetXmlString(e, "Cnt", CountryISOCode); if (Population > 0) { XH.SetXmlInt(e, "P", Population); } XH.SetXmlString(e, "TZ", TimeZoneName); }
public static void SaveStringsFile(string filePath) { XmlDocument doc = new XmlDocument(); XmlElement e = doc.CreateElement("Strings"); doc.AppendChild(e); for (int i = 0; i < gstr.Count; i++) { if (gstr[i].Length > 0) { XmlElement e2 = doc.CreateElement("Item"); e.AppendChild(e2); XH.SetXmlInt(e2, "idx", i); XH.SetXmlString(e2, "val", getString(i)); } } doc.Save(filePath); }