My input YAML looks like
menu:
- 'key one': 'first'
- 'key two': 'second'
so quite simple. The sub-keys for menu
are arbitrary values so there can be anykey
:anyvalue
.
Now I'm using YamlReader
to get hold of these menu entries in a way that I can deal with key and value one after the other.
In this loop
var yaml = new YamlStream();
yaml.Load(reader);
foreach (var child in ((YamlMappingNode)yaml.Documents[0].RootNode).Children)
{
string cName = child.Key.ToString();
I can access menu
. But how can I loop through the kv-pairs in child.value
?
(Probably it's something obvious but I really got stuck here.)