I have an xml document in the following format.
<?xml version="1.0" encoding="UTF-8" ?>
<Rows>
<Row>
<Field Name='PhysicalLocation'>11;#West</Field>
<Field Name='ID'>3327</Field>
</Row>
</Rows>
And am attempting to do a linq selection with it.
I have tried the following.
XDocument xmlDoc = XDocument.Load("C:\\manifest.xml");
var query = from item in xmlDoc.Descendants("Rows").Elements()
select new { ID = item.Attribute("ID").Value, Value = item.Attribute("PhysicalLocation").Value };
And also
XDocument xmlDoc = XDocument.Load("C:\\manifest.xml");
var query = from item in xmlDoc.Descendants("Rows").Elements()
select new { ID = item.Element("ID"), Value = item.Element("PhysicalLocation") };
And in both cases I seem to be coming up short. It is generating the expected amount of rows but the values are not being filled.
Could anyone point me in the right direction? What am I missing?