I have this XML file. There is only one row. I need to read the file from its path and add the information to separate strings (dateJoined, totals, partials, status and counter).
For the moment I read the XML file like this:
var xml = System.Xml.Linq.XDocument.Load(@pathXML);
I am very noob at C# but I need to solve this problem.
XML file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DATAPACKET Version="2.0">
<METADATA>
<FIELDS>
<FIELD attrname="dateJoined" fieldtype="dateTime"/>
<FIELD attrname="totals" fieldtype="r8"/>
<FIELD attrname="partials" fieldtype="r8"/>
<FIELD attrname="status" fieldtype="r8"/>
<FIELD attrname="counter" fieldtype="r8"/>
</FIELDS>
<PARAMS/>
</METADATA>
<ROWDATA>
<ROW dateJoined="20201027" totals="41314.91" partials="134.55" status="2" counter="126"/>
</ROWDATA>
</DATAPACKET>
How can I get all the attributes of the row in separate variables?