views:

215

answers:

1

Hello Guys,

I am using libxml/xmlparser.h library in my program to parse the xml file. Is there any function in that library that can remove a node from the xml file?

I want to completely remove the node, i.e. its attributes and properties also.

+2  A: 

The only way to do this is to parse the file in memory into a tree (either explicitly or implicitly), remove the node an question and then overwrite the file contents with the new tree. XML is NOT a database with the concept of records you can delete from permananet storage at will.

anon