Hi, I'm a newbie in programming in C # and I need advice ..
I have a list of XML to Listbox but unfortunately I do not know how to do it on condition that it has called me a text from the ID
XML file :
<slovicka>
<lekce id="1">
<verb cz="Ahoj" en="Hello" />
<verb cz="Pes" en="Dog" />
</lekce>
<lekce id="2">
<verb cz="Pivo" en="Beer" />
</lekce>
</slovicka>
C# :
//--------XML----------
XmlDocument xml = new XmlDocument();
xml.Load("verbs.xml");
foreach (XmlNode n in xml.SelectNodes("/slovicka/lekce"))
{
lekceview.Items.Add("Lekce : " + n.Attributes["id"].Value);
}
foreach (XmlNode na in xml.SelectNodes("/slovicka/lekce/verb"))
{
cz.Text = na.Attributes["cz"].Value;
en.Text = na.Attributes["en"].Value;
czen.Items.Add("Cz : " + na.Attributes["cz"].Value);
czen.Items.Add("En : " + na.Attributes["en"].Value);
czen.Items.Add("---------------------------------");
}
//--------EndExtractXML--------
It lists me unfortunately everything :-(
//Sorry my English is Bad//