I want to grab one specific value within an XML document at a url, I have managed to get a list of all values, but I'm not sure how to choose the specific value. The XML document is as follows;
<evec_api version="2.0" method="marketstat_xml">
<marketstat>
<type id="37">
<buy>
<volume>291092912</volume>
<avg>137.11</avg>
<max>156.06</max>
<min>53.46</min>
<stddev>31.00</stddev>
<median>140.28</median>
<percentile>156.05</percentile>
</buy>
<sell>
<volume>273042044</volume>
<avg>177.43</avg>
<max>339.00</max>
<min>166.22</min>
<stddev>30.83</stddev>
<median>170.38</median>
<percentile>166.26</percentile>
</sell>
<all>
<volume>574134956</volume>
<avg>154.64</avg>
<max>339.00</max>
<min>43.00</min>
<stddev>42.21</stddev>
<median>156.05</median>
<percentile>69.98</percentile>
</all>
</type>
</marketstat>
</evec_api>
The specific value I want is the min sell value, being 166.22. My code at current, which just retrieves all values in the document is
private void Form1_Load(object sender, EventArgs e)
{
string xmlDocPath = "http://api.eve-central.com/api/marketstat?typeid=37®ionlimit=10000002&usesystem=30000142";
XmlTextReader xmlReader = new XmlTextReader(xmlDocPath);
while (xmlReader.Read())
{
if (xmlReader.NodeType == XmlNodeType.Text)
{
textBox1.AppendText(xmlReader.Value + "\n");
}
}
}
I've tried a few different methods, like just throwing it all in a text box and taking the specific line, but that seems like a really silly solution. Most of the tutorials use console however that doesn't work for me. I feel it's probably a simple solution, but I'm yet to find one that works. Also, being fairly new to this, if there is anything terribly inefficient about this code, feel free to point it out.