I need to parse xml file into C# and display in html, is there any tutorials available?

Hi guy, I have product xml file which contain N number of nodes in xml element format. Is there any tutorials or code sample available which I can use to parse xml and display into html?

Any help appreciated.
Thank you

I am very surprised that it is so difficult to find tutorials for XML. Are you sure it is difficult to do that? Try looking using https://social.msdn.microsoft.com/Search/en-US?query=.net%20xml&pgArea=header&emptyWatermark=true&ac=2. And I am not being sarcastic; there are so many ways to get XML in .Net that the choice is a matter of personal preference.

Since this is .Net I will assume you are using Visual Studio. One trick that it will help to know is that you can copy the contents of a XML file into the clipboard then go to a C# (.cs) file and use Edit | Paste Special. You will have the option to paste XML as C# class(es). Then you can use the XmlSerializer class to read and write XML.

See https://github.com/SimpleSamples/PrinterResearch. It is a project I wrote for myself for creating a list of printers that I think are worth considering. The data is in my personal website but the moderators around here do not like me to use my own work to help others so I won’t say where my website is at. In that project in GitHub see https://github.com/SimpleSamples/PrinterResearch/blob/master/MainWindow.xaml.cs. It is the part that does the XML I/O. I do not expect you to be able to use that to learn from. I can help you better if you ask specific questions and after you have spent some time learning.

Hi Sam
Thank you so much for giving me right direction. I googled and found few more reference for XML https://www.w3schools.com, https://www.stoodq.com/xml and they are great for me.

Again, thanks for giving me right direction for my issue, I really appreciate your time.
Regards

Hi ,
Please check this also.
https://www.codeproject.com/Articles/169598/Parse-XML-Documents-by-XMLDocument-and-XDocument

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.