I have the following XML:
<XMLDictionary>
<a>b</a>
<c>d</c>
<e>f</e>
</XMLDictionary>
I'm trying to get the mappings a: b, c: d, e: f, and I can't quite find how to do it simply.
My current code looks like this:
Do While reader.Read()
If reader.NodeType = Xml.XmlNodeType.Element Then
Me.Add(reader.Name, reader.ReadElementString)
End If
Loop
The problem is that I don't know how to read the contents of the element without calling ReadElementString, and ReadElementString advances the "pointer" to the next node (so reader.Name already has the next value). When in the loop I call Read() again, i'm skipping nodes.
I've tried several variations on this theme, and none works perfectly, which indicates that i'm missing something important here.
Any pointers?
Thanks