use XML::LibXML; use CGI ':standard'; use warnings; use strict; #Variables my $newval; my $categor = 'Coffee'; my $oldval; my $prod = '801.55.01'; my $cats; my $success; print header; if ($categor eq 'Coffee') { $cats = 'C:\Program Files\Apache Group\Apache2\htdocs\legastronome\XML\admin\coffee.xml'; } else { print "Sorry the category that you wanted to edited doesn't exist. Please contact your administrator. \n Thanks"; exit 1; } my $cat = $cats; my $parser = XML::LibXML->new(); my $d = $parser->parse_file(join "", $cat); for my $dead ($d->findnodes(q{/category/subcategory/product[product_id = $prod]})) { $dead->unbindNode; $success = 1; } if ($success eq 1) { print "\n"; print "\n"; print "

Test

\n"; print "

Done for

\n"; print "\n"; print "

Close this window \n"; #$d->toFile($cat); print $d->toString; print"

All done!

"; print "\n"; exit 1; } else { print "\n"; print "\n"; print "

Fail!!

\n"; print "\n"; print "

Close this window \n"; print ""; } __DATA__ 150 years of know how at the service of a same strategy: Taste images/bag_legal.jpg images/prestige.jpg Coffee Legal D A 250 Legal Prestige 12 800.55.01 /recipes/coffee1.html Coffee Legal D A 500 Legal Prestige Boite Arôme 6 801.55.01