1
我有这样的XML:Linq到XML:在XML查询的XElement的名字,并得到母公司属性
<?xml version='1.0' encoding='UTF-8'?>
<applications>
<category cat="Player">
<app>
<name>4Media Blu Ray Creator</name>
</app>
</category>
<category cat="Burning">
<app>
<name>Nero Micro</name>
</app>
</category>
</applications>
现在我想在应用名称进行搜索,并返回XApplications的列表,其中包含类别名称(父猫属性)。
这是我XApplication类:
class XApplication
{
public string Name { set; get; }
public string Category { set; get; }
public XApplication(string name, string category)
{
Name = name;
Category = category;
}
}