Compile libxml program
For XML programming in C, you can make use of certain libraries like libxml. To compile a libxml program, you must be aware of the libraries and their installation. xml2-config comes in bundled with libxml. With xml2-config, you can find out the various values needed to compile the libxml programs. After installing libxml, you must [...]
libxml: C program to open and close an XML file
To read an xml file, you can make use of the libxml library. The following program introduces the functions to open and close an xml file. We introduce here the following functions: xmlNewTextReaderFilename xmlTextReaderClose We also make use of the following structure xmlTextReaderPtr xmlTextReaderPtr: Let’s start with xmlTextReaderPtr. This is a pointer to the structure [...]
book.xml: A sample XML file
For explaining programming with libxml, we will make use of the following sample xml file <book> <title>Introduction to Algorithms</title> <edition>Second</edition> <authors> <author>Thomas H. Cormen</author> <author>Charles E. Leiserson</author> <author>Ronald L. Rivest</author> <author>Clifford Stein</author> </authors> </book>
XML programming in Linux
For a detailed tutorial on XML programming, check the libxml tutorial. To start XML programming in Ubuntu, you must have the following packages in your system libxml2 libxml2-dev libxml2-doc libxml2-utils To install these packages, $ sudo apt-get install libxml2 libxml2-dev libxml2-doc libxml2-utils Once you install these packages, you must check the path where the libxml2 [...]
XML: Extensible Markup Language
How do you refer a book to your friend? Take for example, you want to refer the book “Introduction to algorithms by Cormen”, you would say in the following manner Book: Introduction to Algorithms Second Edition Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, Clifford Stein This is clearly understood by anybody. But [...]