This is the XML data file structure I’m going to use in this tutorial,
- List Names : Will list down all the data in Name element in the XML file
- List price + Names : This will list down all the items with name and its corresponding price value
- Edit XML source : This will opens a new windows that can Create,Delete and Update data in the XML source file.
I have used a XML file which is in the local Bin folder. If you wish to add a .XML file where ever you have, copy the full path of the XML file and then paste it to the FILE_PATH variable.
According to my program, whenever you run the program whole XML file will appear in the XML data result section of the above interface. To do that I have used the following method which i created.
Then I’m calling this method in the Page Load event, in my case it is MainWindow_Load() event.
Now lets see the how to implement List Names function. If you press the List Names Button then you can get prices of all the items which means data belongs to <price> </price> Tag. Here’s the method implementation.
For this function I’m adding a new Windows form and name it as Inser.xaml. This is it,
by Dileepa Rajapaksa