子が具体的なattribute.valueを持つXelementattribute.valueを見つけたい。
string fatherName = xmlNX.Descendants("Assembly")
.Where(child => child.Descendants("Component")
.Where(name => name.Attribute("name").Value==item))
.Select(el => (string)el.Attribute("name").Value);
attribute.valueを取得するにはどうすればよいですか?それはブール値だとはどういう意味ですか?
もともと編集済み 私は次のXMLを持っています:
<Assembly name="1">
<Assembly name="44" />
<Assembly name="3">
<Component name="2" />
</Assembly>
</Assembly>
その子(XElement)がexpecific attribute.valueを持つattribute.valueを取得する必要があります。この例では、attribute.value == "2"の子の親を検索しているため、文字列"3"を取得します。