* XMLStarlet to manipulate XML content
As we get progressively more used to XML in our Web applications we’re finding that what we need is a whole range of tools to manipulate XML content. Today, I have a really interesting tool to do just that: XMLStarlet, an open source freeware released under the MIT license, which means that the software can be used and distributed in both commercial and non-commercial projects. (More licensing facts.)
XMLStarlet is a command line utility that can:
* Check or validate XML files through a simple well-formedness check, DTD, XSD, or RelaxNG, a schema language for XML.XPath expressions on XML files.XSLT stylesheets to XML documents including EXSLT support and passing parameters to stylesheets.Xinclude.XML c14n canonicalization.PYX format and vice versa.
* Calculate values of
* Search XML files for matches to given XPath expressions.
* Apply
* Query XML documents.
* Modify or edit XML documents.
* Format or “beautify” XML documents.
* Fetch XML documents using http:// or ftp:// URLs
* Browse tree structure of XML documents (similar to the ‘ls’ command).
* Include one XML document into another using
*
* Escape or unescape special XML characters in input text.
* Print a directory as an XML document.
* Convert XML into
The XmlStarlet User’s Guide is available in a descriptive HTML version, as well as in PDF, and plain text. Between these documents, this is a thorough description of the syntax of XMLStarlet commands with enough examples to get you started. There’s also a helpful IBM article on the ins and outs of the program.
This is a powerful tool and even better, it is available for download onto Linux, SunOS and Windows.




