-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathParseKml.cs
More file actions
28 lines (24 loc) · 751 Bytes
/
ParseKml.cs
File metadata and controls
28 lines (24 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
using System;
using SharpKml.Base;
using SharpKml.Dom;
namespace Examples
{
/// <summary>
/// Parses a string (using the default Kml namespace) and converts it to Kml objects.
/// </summary>
public static class ParseKml
{
const string InputKml =
"<Placemark>" +
"<name>hi</name>" +
"</Placemark>";
public static void Run()
{
Console.WriteLine("Parsing '{0}'...", InputKml);
Parser parser = new Parser();
parser.ParseString(InputKml, false);
Placemark placemark = (Placemark)parser.Root;
Console.WriteLine("The placemark name is '{0}'.", placemark.Name);
}
}
}