To get XMLStarlet up and running on Snow Leopard is nice and easy.
- Install Xcode with the Unix the Unix Dev Support Option (see my past post about building wget for more details on this).
- Go download yourself a copy of the XMLStarlet source (I am using v 1.0.1).
- XMLStarlet requires libxml2 and libxslt. Snow Leopard ships with both these libraries installed, however they are not in the location expected by the XMLStarlet build script so some symlinks are required. Enter the following in a terminal:
sudo ln -s /usr/lib/libxslt.1.dylib /usr/lib/libxslt.a sudo ln -s /usr/lib/libexslt.dylib /usr/lib/libexslt.a sudo ln -s /usr/lib/libxml2.dylib /usr/lib/libxml2.a
- Unpack the XMLStarlet tarball by double clicking it in Finder.
Take note of the name of the newly unpacked directory (something like xmlstarlet-1.0.1).
- Open a terminal and cd to where you just unpacked (by default this will be the directory below).
cd ~/Downloads/xmlstarlet-1*
- Run the configure script:
./configure
- Run the builds
make
- Run the installer:
sudo make install
- Finally, to test that the install worked correctly enter the following in a terminal:
TA:~ troy$ xml XMLStarlet Toolkit: Command line utilities for XML ... XMLStarlet is a command line toolkit to query/edit/check/transform XML documents (for more information see http://xmlstar.sourceforge.net/)