xmlcommand-linescripting

Grep and Sed Equivalent for XML Command Line Processing


When doing shell scripting, typically data will be in files of single line records like csv. It's really simple to handle this data with grep and sed. But I have to deal with XML often, so I'd really like a way to script access to that XML data via the command line. What are the best tools?


Solution

  • I've found xmlstarlet to be pretty good at this sort of thing.

    http://xmlstar.sourceforge.net/

    Should be available in most distro repositories, too. An introductory tutorial is here:

    http://www.ibm.com/developerworks/library/x-starlet.html