I have an XML as shown below where i want to read one node named 1526726702.So this particular node collection snippet ,i have data structure in form of Columns and rows structure.ie columns are represented by <measTypes> tag and rows are represented by <measResults> coming under <measValue>.So i have many cells like 'Local Cell ID=10','Local Cell ID=11','Local Cell ID=12' etc. Now my aim is to read column named 1526726740 and 1526728300 under section <measTypes> to get values as 43.596 and 390824 for first cell 'Local Cell ID=10'.Like this we have many rows for particular column.How can i read and get this values.
XML SNIPPET
<?xml version="1.0" encoding="UTF-8"?>
<measCollecFile xmlns="measCollec" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Schedule.xsd">
<fileHeader fileFormatVersion="V7.2" testername="tea">
<fileSender elementType="SBT900"/>
<measCollec beginTime="2021-01-24T00:00:00+04:00"/>
</fileHeader>
<measData>
<managedElement userLabel="eelaBldg_474"/>
<measInfo measInfoId="726702">
</measInfo>
<measInfo measInfoId="1526">
</measInfo>
<measInfo measInfoId="1526726702">
<granPeriod duration="PT3600S" endTime="2021-01-24T01:00:00+04:00"/>
<repPeriod duration="PT3600S"/>
<measTypes>1526726737 1526726740 1526727483 1526728299 1526728300 1526728301 1526728302 1526728303 1526728304 1526728305 </measTypes>
<measValue measObjLdn="eelaBldg_474/Cell:eNodeB Function Name=eelaBldg_474, Local Cell ID=10, Cell Name=GhaleelaBldg_A_F1U, eNodeB ID=956474, Cell FDD TDD indication=CELL_TDD">
<measResults>41.699 43.596 9.241 2461846 390824 27358 0 1263996 5282350 7509028 </measResults>
</measValue>
<measValue measObjLdn="eelaBldg_474/Cell:eNodeB Function Name=eelaBldg_474, Local Cell ID=11, Cell Name=GhaleelaBldg_A_F1U, eNodeB ID=956474, Cell FDD TDD indication=CELL_TDD">
<measResults>42.699 46.596 9.241 2461846 390829 27358 0 1263996 5282350 7509028 </measResults>
</measValue>
<measValue measObjLdn="eelaBldg_474/Cell:eNodeB Function Name=eelaBldg_474, Local Cell ID=12, Cell Name=GhaleelaBldg_A_F1U, eNodeB ID=956474, Cell FDD TDD indication=CELL_TDD">
<measResults>43.699 49.596 9.241 2461846 390826 27358 0 1263996 5282350 7509028 </measResults>
</measValue>
</measInfo>
</measData>
</measCollecFile>
code i tried is as below
using (XmlReader xr = XmlReader.Create(path))
{
xr.MoveToContent();
while (xr.Read())
{
while (xr.NodeType == XmlNodeType.Element && xr.LocalName == "measInfo" && xr.GetAttribute("measInfoId") == "1526726702")
{
try
{
XElement pin = (XElement)XNode.ReadFrom(xr);
string earfcndl = Getvalue(pin, "measTypes");
// string t = pin.Element("measTypes").Value;
var data = from atts in pin.Elements("measInfo")
select new
{
meas = (string)atts.Element("measTypes")
};
string measTypes = data.First().meas;
}
catch (Exception ex)
{
}
}
}
}