From the course: LINQPad Essential Training

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Filter by attributes

Filter by attributes

- [instructor] For this query, I want to get the value that's associated with this attribute. So instead of getting this element value, I want to get this attribute value. So the code is nearly identical to what we saw in the last example. I started out by saying from all elements and XML tree elements. So this gets me all 12 of the child elements. And then I do another from here, or I say, get all the attributes that are part of this elements. I mean, getting all the attributes and then I'm selecting out the attributes. So now when I run this, I get the attribute value, blue, blue, blue, and so on. And I also get the attribute name here. So just like in the last query, I don't want to see that. I want to see the value only. So I'll type in .value and now re-execute, and now I'm getting the values from all of the attributes.

Contents