I have an XML document looking similar to this:
<items> <item cat='1' owner='14'>bla</item> <item cat='1' owner='9'>bla</item> <item cat='1' owner='14'>bla</item> <item cat='2' owner='12'>bla</item> <item cat='2' owner='12'>bla</item> </items>
Now I’d like to get all unique owners (I actually only need the attribute value of the owner) belonging to a specified category using a linq query. In my example, the query for cat 1 would return a list containing 9 and 14. How can I do that? Linq syntax would be preferred over Lambdas. Thanks in advance 😉
Presuming the fragment is in itemsElement:
Apologies for formatting and indentation!