[XML Center] [GA Home]

Sablotron FAQ

Petr Cimprich, Tom Kaiser

March 7, 2002

Q: What is Sablotron?

A: A fast, compact, and portable XML processor supporting XSLT, XPath and DOM. Sablotron is an open project originated and maintained by Ginger Alliance with an active community of contributors and users. This background makes Sablotron a leading edge XML tool with unique features such as SXP (an XPath processor on virtual documents accessed via callbacks) and SAX2 output.

Sablotron is written in C++, but has been embedded to many other languages such as Perl, PHP, Python, Ruby, Erlang, Tcl and Object Pascal.


Q: What license is Sablotron released under?

A: Sablotron is subject to the Mozilla Public License 1.1 or the GNU General Public License alternatively.


Q: Does Sablotron contain any third-party code?

A: Sablotron is designed to work with the James Clark's expat XML parser. The Sablotron distribution doesn't include the expat sources (since the version 0.41). If you have not expat installed yet, you may download it from SourceForge. Since the version 0.50 Sablotron supports the new expat distribution available on SourceForge.

Sablotron also includes code portions provided by other developers. We try to keep a complete list of contributors here.


Q: Who are authors of Sablotron?

A: The initial developer (in terms of the MPL 1.1) of Sablotron project is Ginger Alliance. The main author are Tom Kaiser and Pavel Hlavnička.

There are portions of code contributed by other developers. The list of contributors follows:

The same applies for the XML::Sablotron perl package. The main author is Pavel Hlavnička. Other contributors include:


Q: What platforms can Sablotron run under?

A: We compile Sablotron on RedHat Linux and Windows NT. However, it runs on many other platforms as well. More details on Sablotron versions running on particular platforms can be found here.


Q: How to enable encoding on Solaris 8 (and maybe others)

A: The iconv that comes with Sun Solaris 8 (2.8) not compatible with Sabltron. To enable encoding with Sabltron one must install another version of iconv, such as the GNU libiconv. Then set the CPPFLAGS and LDFLAGS to point to the new installation before running the configure script.

(Q&A by Sam Carleton)

Q: How to compile Sablotron using Sun Forte compiler?

A: Use the following script to configure Sablotron:

#!/bin/sh
CPPFLAGS=-I/usr/local/include
CXXFLAGS="-xar -lsunmath"
LDFLAGS="-L/usr/local/lib"
LD="/usr/SUNWspro/bin/CC -G compat=5 -lCrun"
export CPPFLAGS CXXFLAGS LDFLAGS LD
./configure --disable-static

Then make, make install.

For XML::Sablotron:

perl Makefile.PL
make
make test

(Q&A by Charlie Reitsma)

Q: I can't make Sablotron on FreeBSD, what may be wrong?

A: Sablotron makefiles are written for the GNU make tool. GNU make is named gmake on this platform, while the make command runs another utility, which is not happy with makefiles and complains:

make: don't know how to make xmltoc.c. Stop

All you have to do is to run gmake and gmake install rather than make and make install from the command line.


Q: I have problems with encoding, what may be wrong?

A: Make sure you specify both input and output encoding the right way. To define the input encoding, use an encoding argument of the XML declaration in your input documents (both data and template):

<?xml version="1.0" encoding="input-encoding"?>

To define the output encoding, use an encoding argument of the xsl:output top-level element in your stylesheet.

<xsl:output method="xml|html|text" encoding="output-encoding">

When using the xml or html output method, the output encoding of your choice is inserted to the
<?xml version="1.0" encoding="output-encoding"?> declaration or the
<META http-equiv="Content-Type" content="text/html; charset=output-encoding"> tag automatically. If no encoding is specified, default for both input and output is UTF-8.

Supported code pages: On Unix-like environment Sablotron links the iconv library, which is a standard part of most systems. To display a list of character sets known to your iconv, type iconv --list from your command line.

On windows you can either use character sets supported by Sablotron itself only (UTF-8, UTF-16, ISO-8859-1, and windows-1250 for input and UTF-8 for output) or you must link your sablot.dll with iconv.dll (precompiled sablot+iconv binary is avilable).


(c) 2000, 2003 Ginger Alliance and Contributors