Given the attached XML file, I need to get the value for a specific child element. I can currently get a list of all of the elements, but haven't been able to extract a specific child.
I am using XElement to load the document and would like to continue with this method. Specifically, I need to get the value of the child "SpindleSpeed." and assign it to the variable sSpeed. I was able to bring in the entire list of Children, but not just one.
XElement root = XElement.Load(3axis_current.xml);
XNamespace mt = root.Name.Namespace;
IEnumerable<XElement> devices =
from dev in root.Descendants (mt + "DeviceStream")
IEnumerable<XElement> samples =
from res in cs.Descendants(mt + "Samples")
foreach (XElement ev in samples)
IEnumerable<XElement> children = ev.Elements();
foreach (XElement re in children)
results.Add(new Sample(re, dev));