My xml:
<Scenes>
<Scene Index="0" Channel="71" Name="Scene1" />
<Scene Index="1" Channel="71" Name="Scene2" />
<Scene Index="2" Channel="71" Name="Scene3" />
</Scenes>
My code:
var elements = new List<List<string>>();
var attributtes = new List<string>();
XPathExpression expr1 = nav.Compile("//Scene/@*");
XPathNodeIterator iterator1 = nav.Select(expr1);
while (iterator1.MoveNext())
{
XPathNavigator nav2 = iterator1.Current.Clone();
attributtes.Add(nav2.Value);
}
This adds all my attributes from all elements to the list "attributtes".
But how do I add only the attributes to the list "attributtes", and then add that list to "elements"? So i get a list of elements which contains lists of elements. Hope I am clear enough about what i wish to accomplish..