Here is the link to my "XML"
<script src='http://pastie.org/10946087.js'>
</script>
My code could use some work I know, it's kind of messy right now, but I am going to clean it up and find out how to shorten it some.
internal void ReadEDKeyBindings()
{
string edKB = GetEDBindingsPath();
List<string> list = new List<string>();
List<string> parent = new List<string>();
List<string> child = new List<string>();
XDocument doc = XDocument.Load(edKB);
var allElements = doc.Descendants();
var matchingElements = doc.Descendants()
.Where(x => x.Attribute("Key") != null);
foreach (var a in allElements)
{
string str = a.ToString();
string[] pPart = str.Split(new[] { '\r' });
foreach (string p in pPart)
{
list.Add(p);
}
}
foreach (string l in list)
{
if (!l.Contains("Buggy"))
{
if (l.Contains("Key"))
{
try
{
string[] parts = l.Split(new[] { ' ' });
string sub = parts[6].Substring(5);
int last = sub.Length - 1;
sub = sub.Substring(0, last);
if (sub != "")
{
int index = list.IndexOf(l);
string tmp1 = list[index - 1];
string tmp2 = tmp1.Substring(4);
int iTmp = tmp2.Length - 1;
string p = tmp2.Substring(0, iTmp);
parent.Add(p);
child.Add(sub);
}
}
catch
{
}
}
}
}
for (int i = 0; i < parent.Count(); i++)
{
Console.WriteLine("Index = " + i + " : Parent : " + parent[i] + " : Child : " + child[i]);
}
}