Here's a sample xml file that my program writes:
When the user press a button called Remove, the program should find the movie the user has marked in a listview (the name of the movie is the item name column 1) and delete it from the xml file.Code:<?xml version="1.0" encoding="utf-8"?> <Movies> <MovieName xmlns="National Lampoons Barely Legal.avi"> <Directory>C:\Downloads\Movies\National Lampoons Barely Legal By Digitaljace.avi</Directory> </MovieName> <MovieName xmlns="Robin.Hood.S03E12.HDTV.XviD-BiA.avi"> <Directory>C:\Downloads\Movies\Robin.Hood.S03E12.HDTV.XviD-BiA.avi</Directory> </MovieName> <MovieName xmlns="American.Pie.Beta.House DVDRIP.avi"> <Directory>C:\Downloads\Movies\American Pie 1,2,3,4,5,6 DVDRIP\American.Pie.Beta.House DVDRIP.avi</Directory> </MovieName> </Movies>
Say i wanna remove robin hood. I mark the item in the listview, clicks remove, it removes it from the listview (i already know how) and then removes this node : <MovieName xmlns="Robin.Hood.S03E12.HDTV.XviD-BiA.avi">
and everything in it.
I saw some code related to XPath, but i don't understand directly.
It would be nice with an example.![]()




Reply With Quote
