Search for an XML Node using libxml2 in C

XML is widely used format to store or transmit data over internet. Here we’ll see how to search for an XML node in a file. We’ll use this XML file as an example. Search XML Node by its Name First we’ll see how to search a node based on its name. In the above example … Continue reading “Search for an XML Node using libxml2 in C”

Delete an XML Node using libxml2 in C

In the previous article we saw how to add a new XML node. Here we’ll see how to delete an an XML node from a file. We’ll use the same example XML file. In this example, we have 3 ‘book‘ nodes under ‘catalog‘. We’ll write a C program to delete one of them. Program to … Continue reading “Delete an XML Node using libxml2 in C”

Add New Node to XML File Using libxml2 in C

In the previous article, we saw how to parse an XML file. Here we’ll see how to add new node to XML file using C programming language. Here also we’ll use libxml2 parser. We’ll use this XML file as an example. Here we have 3 book nodes under the catalog node. We’ll add one more … Continue reading “Add New Node to XML File Using libxml2 in C”

Parse and Print XML File in Tree Form using libxml2 in C

XML file is widely used format to store and transport data over internet. Parsing XML file is a very basic programming requirement. Here we’ll see how to parse and print the content of an XML file in C programming language. XML File Format Before jumping into the code, we should understand basic format of an … Continue reading “Parse and Print XML File in Tree Form using libxml2 in C”

5
5
0
6
11
12