how to remove a node from an xml file using a C program? – Education Career Blog

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.


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.

Leave a Comment