XMLStarlet

XMLStarlet is a set of command line XML utilities
which can be used to transform, query, validate,
and edit XML documents and files using a simple
set of shell commands, similar to the way it is
done for plain text files using
grep/sed/awk/tr/diff/patch.

Recent releases

Release Notes: This release fixes a crash when trying to run pyx on nonexistent files and a boundary condition in the unescape command. The ed and sel commands can now refer to a document's top level default namespace with "_" or "DEFAULT" and give a friendly message if the user doesn't realize they need to specify namespaces.

Release Notes: A crash with invalid editing operations has been fixed. The documentation can now be built from the tarball and installs to the correct place. The test suite has been made more forgiving of serialization differences between libxml2 versions.

Release Notes: This release adds Makefile rules for generating documentation (./configure --enable-build-docs) consistent with --transform-program-name. The ed subcommand now handles relative XPaths correctly, and there is no longer a hard limit on the number of edit operations. The last nodeset inserted can be accessed as the XPath variable $prev (or $xstar:prev), and new variables can also be defined with --var. ed -u -x may now insert nodesets instead of converting to string. The pyx subcommand now handles namespaces correctly.

Recent comments

Best command-line XML tool I've found
I am doing editorial work on large collections of XML files, and I have been looking for command-line tools to facilitate various search-and-report functions--the kind of thing you'd do for text files using grep, sort, uniq, sed, etc. Of the ones I've looked at, XMLStarlet is not the easiest to use, but it is the most flexible and powerful (also the fastest). Essentially it gives you the ability to write quick XSLT scripts via the command line, plus other useful functions.

We welcome any user's feedback on this project which
would greatly help us to improve its quality.
Comments, suggestions, feature requests, bug reports can
be done via SourceForge
project web site
(see <a
href="http://sourceforge.net/forum/?group_id=66612">XMLStarlet
Sourceforge forums)