• Stars
    star
    479
  • Rank 88,319 (Top 2 %)
  • Language
    C
  • License
    Other
  • Created almost 12 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Read-only mirror of https://gitlab.gnome.org/GNOME/libxml2

libxml2

libxml2 is an XML toolkit implemented in C, originally developed for the GNOME Project.

Official releases can be downloaded from https://download.gnome.org/sources/libxml2/

The git repository is hosted on GNOME's GitLab server: https://gitlab.gnome.org/GNOME/libxml2

Bugs should be reported at https://gitlab.gnome.org/GNOME/libxml2/-/issues

Documentation is available at https://gitlab.gnome.org/GNOME/libxml2/-/wikis

License

This code is released under the MIT License, see the Copyright file.

Build instructions

libxml2 can be built with GNU Autotools, CMake, meson or several other build systems in platform-specific subdirectories.

Autotools (for POSIX systems like Linux, BSD, macOS)

If you build from a Git tree, you have to install Autotools and start by generating the configuration files with:

./autogen.sh [configuration options]

If you build from a source tarball, extract the archive with:

tar xf libxml2-xxx.tar.gz
cd libxml2-xxx

Then you can configure and build the library:

./configure [configuration options]
make

The following options disable or enable code modules and relevant symbols:

--with-c14n             Canonical XML 1.0 support (on)
--with-catalog          XML Catalogs support (on)
--with-debug            debugging module and shell (on)
--with-history          history support for shell (off)
--with-readline[=DIR]   use readline in DIR (for shell history)
--with-html             HTML parser (on)
--with-http             HTTP support (on)
--with-iconv[=DIR]      iconv support (on)
--with-icu              ICU support (off)
--with-iso8859x         ISO-8859-X support if no iconv (on)
--with-lzma[=DIR]       use liblzma in DIR (off)
--with-mem-debug        memory debugging module (off)
--with-modules          dynamic modules support (on)
--with-output           serialization support (on)
--with-pattern          xmlPattern selection interface (on)
--with-push             push parser interfaces (on)
--with-python           Python bindings (on)
--with-reader           xmlReader parsing interface (on)
--with-regexps          regular expressions support (on)
--with-run-debug        runtime debugging module (off)
--with-sax1             older SAX1 interface (on)
--with-schemas          XML Schemas 1.0 and RELAX NG support (on)
--with-schematron       Schematron support (on)
--with-threads          multithreading support (on)
--with-thread-alloc     per-thread malloc hooks (off)
--with-tree             DOM like tree manipulation APIs (on)
--with-valid            DTD validation support (on)
--with-writer           xmlWriter serialization interface (on)
--with-xinclude         XInclude 1.0 support (on)
--with-xpath            XPath 1.0 support (on)
--with-xptr             XPointer support (on)
--with-zlib[=DIR]       use libz in DIR (off)

Other options:

--with-minimum          build a minimally sized library (off)
--with-legacy           maximum ABI compatibility (off)

Note that by default, no optimization options are used. You have to enable them manually, for example with:

CFLAGS='-O2 -fno-semantic-interposition' ./configure

Now you can run the test suite with:

make check

Please report test failures to the mailing list or bug tracker.

Then you can install the library:

make install

At that point you may have to rerun ldconfig or a similar utility to update your list of installed shared libs.

CMake (mainly for Windows)

Another option for compiling libxml is using CMake:

cmake -E tar xf libxml2-xxx.tar.gz
cmake -S libxml2-xxx -B libxml2-xxx-build [possible options]
cmake --build libxml2-xxx-build
cmake --install libxml2-xxx-build

Common CMake options include:

-D BUILD_SHARED_LIBS=OFF            # build static libraries
-D CMAKE_BUILD_TYPE=Release         # specify build type
-D CMAKE_INSTALL_PREFIX=/usr/local  # specify the install path
-D LIBXML2_WITH_ICONV=OFF           # disable iconv
-D LIBXML2_WITH_LZMA=OFF            # disable liblzma
-D LIBXML2_WITH_PYTHON=OFF          # disable Python
-D LIBXML2_WITH_ZLIB=OFF            # disable libz

You can also open the libxml source directory with its CMakeLists.txt directly in various IDEs such as CLion, QtCreator, or Visual Studio.

Meson

Libxml can also be built with meson. Without option, simply call

meson setup builddir ninja -C builddir

To add options, see the meson_options.txt file. For example:

meson setup -Dprefix=$prefix -Dftp=true -Dhistory=true -Dicu=true -Dhttp=true builddir

To install libxml:

ninja -C builddir install

To launch tests:

meson test -C builddir

Dependencies

Libxml does not require any other libraries. A platform with somewhat recent POSIX support should be sufficient (please report any violation to this rule you may find).

The iconv function is required for conversion of character encodings. This function is part of POSIX.1-2001. If your platform doesn't provide iconv, you need an external libiconv library, for example GNU libiconv. Alternatively, you can use ICU.

If enabled, libxml uses libz or liblzma to support reading compressed files. Use of this feature is discouraged.

Contributing

The current version of the code can be found in GNOME's GitLab at at https://gitlab.gnome.org/GNOME/libxml2. The best way to get involved is by creating issues and merge requests on GitLab. Alternatively, you can start discussions and send patches to the mailing list. If you want to work with patches, please format them with git-format-patch and use plain text attachments.

All code must conform to C89 and pass the GitLab CI tests. Add regression tests if possible.

Authors

  • Daniel Veillard
  • Bjorn Reese
  • William Brack
  • Igor Zlatkovic for the Windows port
  • Aleksey Sanin
  • Nick Wellnhofer

More Repositories

1

gimp

Read-only mirror of https://gitlab.gnome.org/GNOME/gimp
C
4,418
star
2

glib

Read-only mirror of https://gitlab.gnome.org/GNOME/glib
C
1,375
star
3

gtk

Read-only mirror of https://gitlab.gnome.org/GNOME/gtk
C
1,275
star
4

meld

Read-only mirror of https://gitlab.gnome.org/GNOME/meld
Python
949
star
5

vala

Read-only mirror of https://gitlab.gnome.org/GNOME/vala
Vala
786
star
6

gnome-shell

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-shell
C
715
star
7

gedit

Read-only mirror of https://gitlab.gnome.org/GNOME/gedit
C
399
star
8

geary

Read-only mirror of https://gitlab.gnome.org/GNOME/geary
Vala
353
star
9

dia

Read-only mirror of https://gitlab.gnome.org/GNOME/dia
C
324
star
10

librsvg

Read-only mirror of https://gitlab.gnome.org/GNOME/librsvg
Rust
313
star
11

nautilus

Read-only mirror of https://gitlab.gnome.org/GNOME/nautilus
C
307
star
12

evince

Read-only mirror of https://gitlab.gnome.org/GNOME/evince
C
301
star
13

gnome-terminal

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-terminal
C++
266
star
14

epiphany

Read-only mirror of https://gitlab.gnome.org/GNOME/epiphany
C
264
star
15

gparted

Read-only mirror of https://gitlab.gnome.org/GNOME/gparted
C++
254
star
16

gnome-builder

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-builder
C
232
star
17

glade

Read-only mirror of https://gitlab.gnome.org/GNOME/glade
C
206
star
18

rhythmbox

Read-only mirror of https://gitlab.gnome.org/GNOME/rhythmbox
C
192
star
19

mutter

Read-only mirror of https://gitlab.gnome.org/GNOME/mutter
C
170
star
20

gitg

Read-only mirror of https://gitlab.gnome.org/GNOME/gitg
Vala
167
star
21

vte

Read-only mirror of https://gitlab.gnome.org/GNOME/vte
C++
161
star
22

gjs

Read-only mirror of https://gitlab.gnome.org/GNOME/gjs
C++
155
star
23

zenity

Read-only mirror of https://gitlab.gnome.org/GNOME/zenity
C
150
star
24

gtkmm

Read-only mirror of https://gitlab.gnome.org/GNOME/gtkmm
Scheme
147
star
25

shotwell

Read-only mirror of https://gitlab.gnome.org/GNOME/shotwell
Vala
145
star
26

pygobject

Read-only mirror of https://gitlab.gnome.org/GNOME/pygobject
Python
144
star
27

gthumb

Read-only mirror of https://gitlab.gnome.org/GNOME/gthumb
C
140
star
28

evolution

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution
C
139
star
29

pango

Read-only mirror of https://gitlab.gnome.org/GNOME/pango
C
132
star
30

sushi

Read-only mirror of https://gitlab.gnome.org/GNOME/sushi
C
123
star
31

pitivi

Read-only mirror of https://gitlab.gnome.org/GNOME/pitivi
Python
120
star
32

gnome-music

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-music
Python
119
star
33

adwaita-icon-theme

Read-only mirror of https://gitlab.gnome.org/GNOME/adwaita-icon-theme
Python
113
star
34

gnome-boxes

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-boxes
Vala
112
star
35

baobab

Read-only mirror of https://gitlab.gnome.org/GNOME/baobab
Vala
104
star
36

orca

Read-only mirror of https://gitlab.gnome.org/GNOME/orca
Python
96
star
37

gnome-calendar

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-calendar
C
92
star
38

gdm

Read-only mirror of https://gitlab.gnome.org/GNOME/gdm
C
87
star
39

gnome-desktop

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-desktop
C
86
star
40

ocrfeeder

Read-only mirror of https://gitlab.gnome.org/GNOME/ocrfeeder
Python
84
star
41

gnome-control-center

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-control-center
C
80
star
42

gnome-screenshot

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-screenshot
C
78
star
43

gnumeric

Read-only mirror of https://gitlab.gnome.org/GNOME/gnumeric
C
77
star
44

gvfs

Read-only mirror of https://gitlab.gnome.org/GNOME/gvfs
C
76
star
45

gnome-system-monitor

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-system-monitor
C++
74
star
46

gegl

Read-only mirror of https://gitlab.gnome.org/GNOME/gegl
C
73
star
47

gnome-software

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-software
C
72
star
48

d-feet

Read-only mirror of https://gitlab.gnome.org/GNOME/d-feet
Python
71
star
49

gnome-tweaks

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-tweaks
Python
71
star
50

gnome-multi-writer

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-multi-writer
C
69
star
51

easytag

Read-only mirror of https://gitlab.gnome.org/GNOME/easytag
C
69
star
52

ghex

Read-only mirror of https://gitlab.gnome.org/GNOME/ghex
C
66
star
53

glibmm

Read-only mirror of https://gitlab.gnome.org/GNOME/glibmm
Scheme
62
star
54

gobject-introspection

Read-only mirror of https://gitlab.gnome.org/GNOME/gobject-introspection
C
61
star
55

gstreamermm

Read-only mirror of https://gitlab.gnome.org/GNOME/gstreamermm
Scheme
61
star
56

libadwaita

Read-only mirror of https://gitlab.gnome.org/GNOME/libadwaita
C
61
star
57

gnome-calculator

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-calculator
Vala
61
star
58

gnome-maps

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-maps
JavaScript
60
star
59

tracker

Read-only mirror of https://gitlab.gnome.org/GNOME/tracker
C
59
star
60

polari

Read-only mirror of https://gitlab.gnome.org/GNOME/polari
JavaScript
58
star
61

cheese

Read-only mirror of https://gitlab.gnome.org/GNOME/cheese
C
58
star
62

rygel

Read-only mirror of https://gitlab.gnome.org/GNOME/rygel
Vala
58
star
63

libsoup

Read-only mirror of https://gitlab.gnome.org/GNOME/libsoup
C
57
star
64

gnome-backgrounds

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-backgrounds
Meson
56
star
65

evolution-ews

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution-ews
C
56
star
66

brasero

Read-only mirror of https://gitlab.gnome.org/GNOME/brasero
C
55
star
67

gnome-disk-utility

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-disk-utility
C
54
star
68

gtksourceview

Read-only mirror of https://gitlab.gnome.org/GNOME/gtksourceview
C
54
star
69

dasher

Read-only mirror of https://gitlab.gnome.org/GNOME/dasher
C
54
star
70

gnote

Read-only mirror of https://gitlab.gnome.org/GNOME/gnote
C++
53
star
71

libxslt

Read-only mirror of https://gitlab.gnome.org/GNOME/libxslt
HTML
53
star
72

totem

Read-only mirror of https://gitlab.gnome.org/GNOME/totem
C
52
star
73

libnotify

Read-only mirror of https://gitlab.gnome.org/GNOME/libnotify
C
51
star
74

gnome-shell-extensions

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-shell-extensions
JavaScript
50
star
75

simple-scan

Read-only mirror of https://gitlab.gnome.org/GNOME/simple-scan
Vala
48
star
76

file-roller

Read-only mirror of https://gitlab.gnome.org/GNOME/file-roller
C
48
star
77

libsecret

Read-only mirror of https://gitlab.gnome.org/GNOME/libsecret
C
46
star
78

cantarell-fonts

Read-only mirror of https://gitlab.gnome.org/GNOME/cantarell-fonts
Python
45
star
79

jhbuild

Read-only mirror of https://gitlab.gnome.org/GNOME/jhbuild
Python
44
star
80

gnome-settings-daemon

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-settings-daemon
C
44
star
81

recipes

Read-only mirror of https://gitlab.gnome.org/GNOME/recipes
C
43
star
82

eog

Read-only mirror of https://gitlab.gnome.org/GNOME/eog
C
41
star
83

seahorse

Read-only mirror of https://gitlab.gnome.org/GNOME/seahorse
C
39
star
84

fractal

Read-only mirror of https://gitlab.gnome.org/GNOME/fractal
Rust
38
star
85

evolution-activesync

Read-only mirror of https://gitlab.gnome.org/GNOME/evolution-activesync
C
38
star
86

gnome-chess

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-chess
Vala
37
star
87

gnome-commander

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-commander
C++
36
star
88

libgda

Read-only mirror of https://gitlab.gnome.org/GNOME/libgda
C
35
star
89

alacarte

Read-only mirror of https://gitlab.gnome.org/GNOME/alacarte
Python
34
star
90

msitools

Read-only mirror of https://gitlab.gnome.org/GNOME/msitools
C
33
star
91

nautilus-python

Read-only mirror of https://gitlab.gnome.org/GNOME/nautilus-python
C
33
star
92

gtkmm-documentation

Read-only mirror of https://gitlab.gnome.org/GNOME/gtkmm-documentation
Python
32
star
93

dconf-editor

Read-only mirror of https://gitlab.gnome.org/GNOME/dconf-editor
Vala
31
star
94

libgsf

Read-only mirror of https://gitlab.gnome.org/GNOME/libgsf
C
31
star
95

devhelp

Read-only mirror of https://gitlab.gnome.org/GNOME/devhelp
C
30
star
96

gedit-plugins

Read-only mirror of https://gitlab.gnome.org/GNOME/gedit-plugins
Python
27
star
97

metacity

Read-only mirror of https://gitlab.gnome.org/GNOME/metacity
C
27
star
98

sysprof

Read-only mirror of https://gitlab.gnome.org/GNOME/sysprof
C
26
star
99

gdk-pixbuf

Read-only mirror of https://gitlab.gnome.org/GNOME/gdk-pixbuf
C
25
star
100

gnome-online-accounts

Read-only mirror of https://gitlab.gnome.org/GNOME/gnome-online-accounts
C
25
star