explain home explain home explain home explain homeexplain banner
Explanations - about explain | XML training | Consulting | XML resources | Publications | Open Source Software

libxml2, libxslt Binaries

Explain makes binaries for Mac OS X available for libxml2 and libxslt. Unlike Fink and MacOSPorts, these binaries are built as Frameworks, which is better for making user-installable software packages.

We're also working on implementing XPath 2 and XSLT 2 for libxml2 and libxslt.

Using Leopard? xmllint and libxml2 version 2.6.16 are built-in! xsltproc and libxslt version 1.1.12 are also included.

Using Tiger? xmllint and libxml2 version 2.6.16 are built-in! xsltproc and libxslt version 1.1.11 are also included.

Using Panther? xmllint and libxml2 version 2.5.4 are built-in! Even better, 10.3.9 has libxml2-2.6.16 and libxslt-1.1.9 built-in!

Binary distributions for Mac OS X of the latest Gnome XML processing libraries: libxml2 version 2.6.30 and libxslt version 1.1.22 are now available.

These libraries have been built as embeddable OS X Frameworks. This means that you may install them anywhere on your system, or within your application, and OS X will search for them. Suggested installation locations are /Library/Frameworks or ~/Library/Frameworks.

The frameworks may also be included in the Frameworks directory of an application. In this way the application is self-contained, and can be installed without requiring the superuser password (ie. the application may be installed by simply copying it to a destination folder). tkxmllint and tkxsltproc are examples of applications that embed the frameworks.

You may also install multiple versions without having them conflict.


The disk image contains all of the frameworks, so only a single download is needed.

For Jaguar (10.2) older versions of libxml2 and libxslt are still available:


Installation follows the usual Mac OS X fashion. Double-click the downloaded file to decompress and mount the disk image.

The disk image contains the libxml2, libxslt and libexslt library frameworks. The Jaguar disk image also contains the libiconv framework; Tiger and Panther does not require libiconv. These may be copied anywhere that Frameworks may be found (consult the Mac OS X documentation for more information on Frameworks). The disk image also contains the xmllint and xsltproc command line applications. Copy these to a folder on your path, such as /usr/bin or ~/bin.

Starting with libxml2-2.6.4 and libxslt-1.1.2, library documentation is included within the frameworks. Documentation for the library may be found in the Resources/en.lproj directory.

Starting with libxml2-2.6.11 and libxslt-1.1.8, the xml2-config and xslt-config scripts are in the Resources/Scripts directory of their respective frameworks.


To build the frameworks yourself, you may use either Xcode (under OS 10.3, 10.4 or 10.5) or Project Builder (OS 10.1 to 10.2). Xcode is now the preferred build environment.

Using Xcode

Apple's Leopard (10.5), Tiger (10.4) and Panther (10.3) operating system uses Xcode (instead of Project Builder) for developing software. Starting with libxml2 2.6.2 and libxslt 1.1.0, the frameworks are built using Xcode. Also, Tiger and Panther include libiconv so the libraries simply link against the OS-supplied dynamic library.

Also note that Leopard, Tiger and Panther include libxml2-2.5.4 (for 10.5, 10.4 and 10.3.9, libxml2-2.6.16 and libxslt 1.1.12, 1.1.11 or 1.1.9). If xmllint is all you need, and version 2.5.4 (2.6.16/1.1.12) is good enough, then there's no need to do anything!

To build the frameworks using Xcode, first download the sources from the Gnome website and unpack them. Then, fetch the appropriate tarball (below) and unpack in the library source directory. This will create a macosx subdirectory in the library sources directory. Inside the macosx subdirectory is the Xcode file.

Using Project Builder

The Project Builder files are available so that you can build the libraries for yourself. Fetch the library sources from the Gnome website and unpack them and then unpack the appropriate tarball below. This will create a macosx subdirectory in the library sources directory. Inside the macosx subdirectory is the Project Builder file.


Mac OS X has a system called "prebinding" that allows an application to start faster. For prebinding to work all libraries must declare where they are loaded into the application's address space, using the -seg1addr gcc option. As long as there are no conflicts, prebinding is enabled. The addresses for these libraries have been chosen as follows:

  • libiconv: c00000

  • libxml: c200000

  • libxslt: c500000

  • libexslt: c600000


  1. Leopard (OS 10.5) and Tiger (OS 10.4) include libxml2-2.6.16 and libxslt-1.1.12 (1.1.11 for Tiger).

  2. Panther (OS 10.3.9) includes libxml2-2.6.16 and libxslt-1.1.9.

  3. Panther (OS 10.3) includes libxml2-2.5.4.

  4. It is not difficult to build both libxml2 and libxslt from source. However, building as a framework does require some slight changes to the source files.

  5. You can save yourself the trouble of building from source by using Fink. The difference between installing Fink and using the frameworks from above is that Fink installs into a specific filesystem location, which requires administrator (superuser) privileges.

Copyright © 2005-2008 Explain. All rights reserved.Legal notices. Comments or questions about this website? Contact the webperson.