I have the following xml file and I am trying to get the attribute value which is inside two elements.
XML:
<Processing>
<Aggregation method="summation"/>
<Interpolation method="linear" />
</Processing>
C#:
XmlDocument doc = new XmlDocument();
doc.Load(xmlFile);
XmlNodeList elemNode = doc.GetElementsByTagName(Aggregation );
for (int y = 0; y < elemNode.Count; y++)
result = elemNode[y].Attributes[method].Value;
The following code return an empty string instead of summation.
Tiada ulasan:
Catat Ulasan