I am currently having a problem putting the results of a xmlnodelist into a normal list box with the below code.
var xmlDoc = new XmlDocument();
xmlDoc.Load(textBox1.Text);
var node = xmlDoc.SelectNodes("pdml/packet/proto/field[@name='ip.src']/@show");
list.Items.Add(node);
To my understanding the SelectNodes will take all nodes with that XPath name and put it into a list. When I add these to a standard list box I see this displayed:
System.Xml.XPathNodeList
For reference, this specific xml looks as so (it is a portion of a much larger section):
<pdml>
<packet>
<proto>
<field name="ip.src" showname="Source: 192.168.1.204 (192.168.1.204)" size="4" pos="26" show="192.168.1.204" value="c0a801cc"/>
</proto>
</packet>
</pdml>
How do I convert this into what is contained in the NodeList?
Further help: Also how could I work with the data contained in the NodeList? e.g. can I set it as a unique identifier and assign other node data to it.
Thanks, Tom