~ubuntu-branches/ubuntu/natty/libxml++2.6/natty

« back to all changes in this revision

Viewing changes to docs/manual/html/index.html

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-09-18 11:32:24 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20070918113224-7x031mzf1shoozxx
Tags: 2.20.0-0ubuntu1
* New upstream release:
  - Element: Added get_attribute_value(), to get a simple text value for an
    attribute.
  - Added an experimental --enable-api-exceptions configure option, to allow
    libxml++ to build without exceptions.
* debian/libxml++2.6-doc.docs: 2.18 -> 2.20.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>libxml++ - An XML Parser for C++</title><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="libxml++ - An XML Parser for C++"><link rel="next" href="ar01s02.html" title="Parsers"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">libxml++ - An XML Parser for C++</th></tr><tr><td width="20%" align="left">�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="ar01s02.html">Next</a></td></tr></table><hr></div><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2532235"></a>libxml++ - An XML Parser for C++</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Murray</span> <span class="surname">Cumming</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a href="mailto:murrayc@murrayc.com">murrayc@murrayc.com</a>&gt;</code></p></div></div></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>This is an introduction to libxml's C++ binding, with simple examples.</p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="index.html#section-introduction">libxml++</a></span></dt><dd><dl><dt><span class="sect2"><a href="index.html#id2532345">Installation</a></span></dt><dt><span class="sect2"><a href="index.html#id2496013">UTF-8 and Glib::ustring</a></span></dt><dt><span class="sect2"><a href="index.html#id2496055">Compilation and Linking</a></span></dt></dl></dd><dt><span class="sect1"><a href="ar01s02.html">Parsers</a></span></dt><dd><dl><dt><span class="sect2"><a href="ar01s02.html#id2496123">DOM Parser</a></span></dt><dt><span class="sect2"><a href="ar01s02.html#id2496429">SAX Parser</a></span></dt><dt><span class="sect2"><a href="ar01s02.html#id2496858">TextReader Parser</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section-introduction"></a>libxml++</h2></div></div></div><p>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>libxml++ - An XML Parser for C++</title><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="index.html" title="libxml++ - An XML Parser for C++"><link rel="next" href="ar01s02.html" title="Parsers"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">libxml++ - An XML Parser for C++</th></tr><tr><td width="20%" align="left">�</td><th width="60%" align="center">�</th><td width="20%" align="right">�<a accesskey="n" href="ar01s02.html">Next</a></td></tr></table><hr></div><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="id2433976"></a>libxml++ - An XML Parser for C++</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Murray</span> <span class="surname">Cumming</span></h3><div class="affiliation"><div class="address"><p><code class="email">&lt;<a href="mailto:murrayc@murrayc.com">murrayc@murrayc.com</a>&gt;</code></p></div></div></div></div><div><div class="abstract"><p class="title"><b>Abstract</b></p><p>This is an introduction to libxml's C++ binding, with simple examples.</p></div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="index.html#section-introduction">libxml++</a></span></dt><dd><dl><dt><span class="sect2"><a href="index.html#id2540799">Installation</a></span></dt><dt><span class="sect2"><a href="index.html#id2504470">UTF-8 and Glib::ustring</a></span></dt><dt><span class="sect2"><a href="index.html#id2504511">Compilation and Linking</a></span></dt></dl></dd><dt><span class="sect1"><a href="ar01s02.html">Parsers</a></span></dt><dd><dl><dt><span class="sect2"><a href="ar01s02.html#id2504579">DOM Parser</a></span></dt><dt><span class="sect2"><a href="ar01s02.html#id2504878">SAX Parser</a></span></dt><dt><span class="sect2"><a href="ar01s02.html#id2506063">TextReader Parser</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="section-introduction"></a>libxml++</h2></div></div></div><p>
2
2
      libxml++ is a C++ API for the popular libxml XML parser, written in C. libxml is famous for its high performance and compliance to standard specifications, but its C API is quite difficult even for common tasks. 
3
3
    </p><p>
4
4
      libxml++ presents a simple C++-like API that can achieve common tasks with less code. Unlike some other C++ parsers, it does not try to avoid the advantages of standard C++ features such as namespaces, STL containers or runtime type identification, and it does not try to conform to standard API specifications meant for Java. Therefore libxml++ requires a fairly modern C++ compiler such as g++ 3. 
5
 
    </p><p>But libxml++ was created mainly to fill the need for an API-stable and ABI-stable C++ XML parser which could be used as a shared library dependency by C++ applications that are distributed widely in binary form. That means that installed applications will not break when new versions of libxml++ are installed on a user's computer. Gradual improvement of the libxml++ API is still possible via non-breaking API additions, and new independent versions of the ABI that can be installed in parallel with older versions. These are the general techniques and principles followed by the <a href="http://www.gnome.org" target="_top">GNOME</a> project, of which libxml++ is a part.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2532345"></a>Installation</h3></div></div></div><p>libxml++ is packaged by major Linux and *BSD distributions and can be installed from source on Linux and Windows, using any modern compiler, such as g++, SUN Forte, or MSVC++.</p><p>For instance, to install libxml++ and its documentation on debian, use apt-get or synaptic like so:
 
5
    </p><p>But libxml++ was created mainly to fill the need for an API-stable and ABI-stable C++ XML parser which could be used as a shared library dependency by C++ applications that are distributed widely in binary form. That means that installed applications will not break when new versions of libxml++ are installed on a user's computer. Gradual improvement of the libxml++ API is still possible via non-breaking API additions, and new independent versions of the ABI that can be installed in parallel with older versions. These are the general techniques and principles followed by the <a href="http://www.gnome.org" target="_top">GNOME</a> project, of which libxml++ is a part.</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2540799"></a>Installation</h3></div></div></div><p>libxml++ is packaged by major Linux and *BSD distributions and can be installed from source on Linux and Windows, using any modern compiler, such as g++, SUN Forte, or MSVC++.</p><p>For instance, to install libxml++ and its documentation on debian, use apt-get or synaptic like so:
6
6
    </p><pre class="programlisting">
7
7
    # apt-get install libxml++2.6-dev libxml++2.6-doc
8
8
    </pre><p>
9
9
    </p><p>To check that you have the libxml++ development packages installed, and that your environment is working properly, try <span><strong class="command">pkg-config libxml++-2.6 --modversion</strong></span>.</p><p>The source code may be downloaded from <a href="http://libxmlplusplus.sourceforge.net" target="_top">libxmlplusplus.sourceforge.net</a>
10
 
. libxml++ is licensed under the LGPL, which allows its use via dynamic linking in both open source and closed-source software. The underlying libxml library uses the even more generous MIT licence.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2496013"></a>UTF-8 and Glib::ustring</h3></div></div></div><p>The libxml++ API takes, and gives, strings in the UTF-8 Unicode encoding, which can support all known languages and locales. This choice was made because, of the encodings that have this capability, UTF-8 is the most commonly accepted choice. UTF-8 is a multi-byte encoding, meaning that some characters use more than 1 byte. But for compatibility, old-fashioned 7-bit ASCII strings are unchanged when encoded as UTF-8, and UTF-8 strings do not contain null bytes which would cause old code to misjudge the number of bytes. For these reasons, you can store a UTF-8 string in a std::string object. However, the std::string API will operate on that string in terms of bytes, instead of characters.</p><p>Because Standard C++ has no string class that can fully handle UTF-8, libxml++ uses the Glib::ustring class from the glibmm library. Glib::ustring has almost exactly the same API as std::string, but methods such as length() and operator[] deal with whole UTF-8 characters rather than raw bytes.</p><p>There are implicit conversions between std::string and Glib::ustring, so you can use std::string wherever you see a Glib::ustring in the API, if you really don't care about any locale other than English. However, that is unlikely in today's connected world.</p><p>glibmm also provides useful API to convert between encodings and locales.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2496055"></a>Compilation and Linking</h3></div></div></div><p>To use libxml++ in your application, you must tell the compiler where to find the include headers and where to find the libxml++ library. libxml++ provides a pkg-config .pc file to make this easy. For instance, the following command will provide the necessary compiler options:
 
10
. libxml++ is licensed under the LGPL, which allows its use via dynamic linking in both open source and closed-source software. The underlying libxml library uses the even more generous MIT licence.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2504470"></a>UTF-8 and Glib::ustring</h3></div></div></div><p>The libxml++ API takes, and gives, strings in the UTF-8 Unicode encoding, which can support all known languages and locales. This choice was made because, of the encodings that have this capability, UTF-8 is the most commonly accepted choice. UTF-8 is a multi-byte encoding, meaning that some characters use more than 1 byte. But for compatibility, old-fashioned 7-bit ASCII strings are unchanged when encoded as UTF-8, and UTF-8 strings do not contain null bytes which would cause old code to misjudge the number of bytes. For these reasons, you can store a UTF-8 string in a std::string object. However, the std::string API will operate on that string in terms of bytes, instead of characters.</p><p>Because Standard C++ has no string class that can fully handle UTF-8, libxml++ uses the Glib::ustring class from the glibmm library. Glib::ustring has almost exactly the same API as std::string, but methods such as length() and operator[] deal with whole UTF-8 characters rather than raw bytes.</p><p>There are implicit conversions between std::string and Glib::ustring, so you can use std::string wherever you see a Glib::ustring in the API, if you really don't care about any locale other than English. However, that is unlikely in today's connected world.</p><p>glibmm also provides useful API to convert between encodings and locales.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2504511"></a>Compilation and Linking</h3></div></div></div><p>To use libxml++ in your application, you must tell the compiler where to find the include headers and where to find the libxml++ library. libxml++ provides a pkg-config .pc file to make this easy. For instance, the following command will provide the necessary compiler options:
11
11
    <span><strong class="command">pkg-config libxml++-2.6 --cflags --libs</strong></span>
12
12
    </p><p>When using autoconf and automake, this is even easier with the PKG_CHECK_MODULES macro in your configure.ac file. For instance:
13
13
    </p><pre class="programlisting">