I have xml like the below:
<array>
<dict>
<key>Topic</key>
<string>ABC</string>
<key>Items</key>
<array>
<dict>
<key>Header</key>
<string>Data One</string>
<key>Content</key>
<array>
<string>This is how we parse the data.</string>
<string>This is how we parse the data.</string>
</array>
</dict>
<dict>
<key>Header</key>
<string>Data Two</string>
<key>Content</key>
<array>
<string>I am now able to parse the data</string>
<string>I am now able to parse the data</string>
</array>
</dict>
</array>
</dict>
<dict>
<key>Topic</key>
<string>ABC</string>
<key>Items</key>
<array>
<dict>
<key>Header</key>
<string>Data One</string>
<key>Content</key>
<array>
<string>This is how we parse the data.</string>
<string>This is how we parse the data.</string>
</array>
</dict>
<dict>
<key>Header</key>
<string>Data Two</string>
<key>Content</key>
<array>
<string>I am now able to parse the data</string>
<string>I am now able to parse the data</string>
</array>
</dict>
</array>
</dict>
</array>
I have many dict like this.
This is how i am doing it:
List<Note> NotesList = (from plist in doc.Root.Element("array").Elements("dict")
select new Note
{
MainTitle = (string)plist.Element("string"),
ListOfSubTitles = plist.Element("array").Elements("dict")
.Elements("string")
.Select(s => (string)s)
.ToList()
}).ToList();
Here MainTitle is ABC,
Subtitle is Data One and for each subtitle we have array of items which i need to parse?
How can i modify the above to add the Key Content
values as well.