XPath and C#: Get data from an XML Document
I show how to query an XML document with XPath in C# in this video. I start with an overview explanation of XPath, and how it can be used. Next, I implement several examples of these XPath expressions in a C# project in Visual Studio 2019. Then, I start the application in debug mode, upload an XML file, and show the results that the XPath query generates. I use several classes and techniques from System.Xml: XmlNode, XmlNodeList, XmlDocument, and InnerText.
This video is part of a playlist on integrating JSON Data APIs in C# Visual Studio 2019: • Azure Fundamentals: Ov...
Source code is freely available on GitHub at github.com/discospiff/PlantDiary
Пікірлер: 21
This is the only video on XML that helped me. Very well demonstrated!!
@discospiff
2 жыл бұрын
I'm glad it helped! XPath is a great way to navigate XML documents.
@longbeachboy57
5 ай бұрын
Same here :)
Great introduction to Xpath, I appreciate it Brandan!
@discospiff
3 жыл бұрын
I'm glad it helped! It's great to hear from you.
Thank you! This helped a lot
@discospiff
3 жыл бұрын
Glad it helped, thanks for the comment! There's a lot you can do with xml parsing... a great way to validate interchange data.
For some reason I thought xpath was really complicated, and I tried to avoid using it. All this time (just a few days, to be fair :P), it's been exactly what I wanted.
@discospiff
2 жыл бұрын
Funny, me too! I thought XPath was complicated, until it got my hands in it and tried it... then I realized, it's quite useful, and simple! I had a similar experience with Spring Boot.
At last I've got to a video that gives me a simple way to query XML. I've been down some strange rabbit holes.
@discospiff
2 жыл бұрын
I'm glad it helped! XPATH is a great way to filter and find data.
Would you look at that. I'm still learning from you after graduation! Your videos are incredibly helpful, hope you're doing well!
@discospiff
Жыл бұрын
Ok, this is really good to hear! One big reason I put my lectures on KZread is to keep in touch with former students. How've you been???
@natedietel4968
Жыл бұрын
@@discospiff Doing well! I work at CIC and am working on a listener for XML files and this helped a lot!
Thanks!
@discospiff
2 жыл бұрын
You're welcome! Thanks for watching.
Hello, good video, a question, I get this error when trying to access a node: "CLR / System.NullReferenceException" Do you know how to solve it?
hello sir, if there is a .dds file that was linked to an XML file like that "" how can i grab that file ? ,,i was able to grab some of the files using a program but the program couldn't find the rest .
Can we use Xpath method in Winform c# ?
@discospiff
2 жыл бұрын
I've never tried it, but I imagine you can.