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.

Query the XML file

Query the XML file

- [Narrator] In this query, I want to retrieve the value for this element. So let's see what we know about this. It's under the root node, it's in all the elements. There's 12 of these robot elements. And so what I want to do is drill down in, and pull out the data from this child element. So I'm doing that, is I'm using a query expression here. And I'm saying from all elements in the elements, then select out all elements dot element. So see how I'm drilling down one level deep. So I'm starting here at robot, and then going to its child elements, and finding the one named, robot name. Now, when I dump this, I get 12 rows, and I'm getting, almost getting the data I want. Unfortunately, at this moment, I still have the beginning and end tags, for the XML data. What I really want is just the robot names. So, the way you solve that is to go to the element, and say, I want the value. I don't want the XML, I want the…

Contents