Mon
14
Feb '05
Tool of the day: xmlstarlet
by Frank Spychalski filed under Work

XMLStarlet is a set of command line utilities (tools) which can be used to transform, query, validate, and edit XML documents and files using simple set of shell commands in similar way it is done for plain text files using UNIX grep, sed, awk, diff, patch, join, etc commands.

found it while looking for something completely different. My usecases:

“grep” an XPath expression:

xmlstarlet sel -t -c xpath filename

format a document:

xmlstarlet fo filename

unfortunately schema validation seems to be broken…

ps:

apt-get install xmlstarlet

Any comments? Or questions? Just leave a Reply: