Many languages, including PHP, Perl and Python, use libxml and libxslt for XML processing. These languages automatically support XSieve transformations because XSieve is implemented as a libxslt plugin.
Before executing XSieve transformations, set the environment variable LIBXSLT_PLUGINS_PATH
to the value $XSIEVE_DIR/lib
, where $XSIEVE_DIR
is the XSieve installation directory.
Be aware that XSieve has issues which are not compatible with big long-running applications.
XSieve probably isn't thread-safe. (To be fixed somewhen.)
XSieve has memory leaks. (Design decision, will never be fixed.)
Example 1. Using XSieve in Python
The libxst package provides a sample program pyxsltproc.py
, which is a Python re-implementation of XSLT processor xsltproc
. In this example, we suppose that libxml and libxslt are installed to the private directories $LIBXML_DIR
and $LIBXSLT_DIR
, correspondingly.
$ export LIBXSLT_PLUGINS_PATH=$XSIEVE_DIR/lib $ export PYTHONPATH=$LIBXML_DIR/lib/python2.3/site-packages:$LIBXSLT_DIR/lib/python2.3/site-packages $ cd $XSIEVE_SRC_DIR/example/hello $ python $LIBXSLT_DIR/share/doc/libxslt-python-1.1.15/examples/pyxsltproc.py hello.xsl hello.xsl <?xml version="1.0"?> <article id="hw"> <title>Hello</title> <para>Hello, <object>World</object>!</para> </article> Memory leak 159 bytes