Hello, in this video, we are going to look at looping through the XML. So what we've got right here, literally just pumps out this, not very useful to use pumping out literally all of the content. And imagine if you had other loads of, you know, notes, for example in this, it's just not, you just can't do much with it. So what we want to do is get rid of this, we still want to load it, that's fine. I'm going to say dollar. And then I'm gonna say element equals dollar XML document.
Document element. And say for each dollar element, and then we're going to get all the child node. So this is basically on a cornice the dollar value to know nothing better names. No, technically, there's no But you won't always be a note as a copy that paste that here, trial node. US dollar. No.
I'm all gonna say he's in here, he's going to print out as I was doing Echo, a couple upon echo dollar node, the node name. Obviously this is the way I'm going to format it we can do however you want dash dot dollar node, no run, you know find them do not depend on a new line tab and get a bit of nice formatting. Now, if we go back, there we go. We have, what do we want text where the text is coming from. It's the white space. So if there's whitespace, he will literally compound the text.
So that's what that is. But there you go. That's how you pass for it use in the, you know the built in Dom parser. Not very good. To be fair boss wanted to show you all the different methods for manipulating XML or recommend either simple XML that's my first go to one. If you need something more advanced use the XML expert, Partha Nepal.
A parser and I've got videos covering all the nuances of both of those that I just mentioned. And that's it any questions, feel free to drop me a message. And as usual, I look forward to seeing you in the next great video.