using System.Collections.Generic;
using YamlDotNet.RepresentationModel;
namespace YamlDotNet.Samples
public class LoadYamlStream
var input = new StringReader(Document);
var yaml = new YamlStream();
(YamlMappingNode)yaml.Documents[0].RootNode;
foreach (var entry in mapping.Children)
Console.WriteLine(((YamlScalarNode)entry.Key).Value);
var items = (YamlSequenceNode)mapping.Children[new YamlScalarNode("items")];
foreach (YamlMappingNode item in items)
item.Children[new YamlScalarNode("part_no")],
item.Children[new YamlScalarNode("descrip")]
private const string Document = @"---
receipt: Oz-Ware Purchase Invoice
descrip: Water Bucket (Filled)
descrip: High Heeled ""Ruby"" Slippers
Road to the Emerald City.