I have xml from I want get some data
XDocument loaded = XDocument.Load(@"c:\TERC.xml");
var query = (from c in loaded.Descendants("catalog")
from r in c.Descendants("row")
select (string)r.Element("Name"));
this returns me collection of null
How can I fix it ?
Here is this xml:
<?xml version="1.0" encoding="UTF-8" ?>
<teryt>
<catalog name="Compix">
<row>
<col name="NAME">Name1</col>
<col name="ID">12</col>
</row>
<row>
<col name="NAME">Name2</col>
<col name="ID">13</col>
</row>
<row>
<col name="NAME">Name3</col>
<col name="ID">14</col>
</row>
</catalog>
</teryt>