Back to Turicreate

Libxml Tutorial

deps/src/libxml2-2.9.1/doc/tutorial/index.html

6.4.11.9 KB
Original Source
Libxml Tutorial

Libxml Tutorial

John Fleck

Copyright 2002, 2003 John Fleck

Revision History
Revision 1
Initial draft
Revision 2
retrieving attribute value added
Revision 3
freeing memory fix
Revision 4
encoding discussion added
Revision 5
more memory freeing changes
Revision 6
add index
Revision 7
add compilation appendix
Revision 8
add XPath example
Revision 9
Fix bug in XPath example
Revision 7
Fix another bug in XPath example

Abstract

Libxml is a freely licensed C language library for handling XML, portable across a large number of platforms. This tutorial provides examples of its basic functions.

Introduction

Libxml is a C language library implementing functions for reading, creating and manipulating XML data. This tutorial provides example code and explanations of its basic functionality.

Libxml and more details about its use are available on the project home page. Included there is complete API documentation. This tutorial is not meant to substitute for that complete documentation, but to illustrate the functions needed to use the library to perform basic operations.

The tutorial is based on a simple XML application I use for articles I write. The format includes metadata and the body of the article.

The example code in this tutorial demonstrates how to:

  • Parse the document.

  • Extract the text within a specified element.

  • Add an element and its content.

  • Add an attribute.

  • Extract the value of an attribute.

Full code for the examples is included in the appendices.


| | | Next | | | | Data Types |