I am trying to get attributes from a specific location in an xml document the xml looks contains multiple similar tagnames like this:
<Message dataItemId="Axis_01" timestamp="2018-06-25T20:20:40.4374489Z"
name="[#] Numero inversioni" sequence="85988"
nativeCode="208573">208573</Message>
<Message dataItemId="Axis_02_InvDDone" timestamp="2018-06-
25T20:20:40.4374489Z" name="Error" sequence="85998"
nativeCode="208573">208573</Message>
how do I retrieve only the value of the Message with the name of Error? Below is my attempted code where textbox1 would = Message and textbox2 would = Error:
XmlDocument xmldoc = new XmlDocument();
XmlNodeList xmlnode;
try
{
xmldoc.Load("http://127.0.0.1:5000/cur");
XmlNode node2 = xmldoc.SelectSingleNode("'"+ textBox1.Text +
"'[name='" + textBox2.Text + "']");
listBox1.Items.Add(node2.ChildNodes.Item(0).InnerText.Trim());
}