【发布时间】:2012-07-30 09:49:44
【问题描述】:
我有这个 XML:
<?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>
现在我想在 app 名称中搜索并返回包含类别名称(父 cat 属性)的 XApplications 列表。
这是我的 XApplication 类:
class XApplication
{
public string Name { set; get; }
public string Category { set; get; }
public XApplication(string name, string category)
{
Name = name;
Category = category;
}
}
【问题讨论】: