Xml Pipes And Filters
XML Pipes and Filters (XPF) is a collection of command-line tools for manipulating XML. XPF provides tools for removing nodes, changing text of nodes, and testing properties of an XML document. XPF tools (aka filters
) accept input on the standard input and produce output to the standard output, hence they can be composed into pipelines. The tools are based on the XPath language for addressing nodes in an XML document.
Release 0.2 is available at:
The subversion repository of XPF is:
XPF requires Python and the Libxml2 bindings for Python.
All tools allow the following options:
-i <file> Use <file> as input [stdin]
-o <file> Output result in <file> [stdout]
-f <file> Use <file> as input and output
-? | -h | --help Display this usage information
xpf-rm [-i file] [-o file] <xpath>
Removes all nodes addressed by the given XPath expression
xpf-ed [-i file] [-o file] <xpath> <text>
Replaces nodes addressed by the given XPath expression with the
xpf-test [-i file] [-o file] <xpath>
The XPath expression is evaluated and the resulting object is
converted to a boolean by a call to the boolean function. If the
result is true, then the exit code is 0 and the input document is
written to the output. If the result is false, then the exit code
is 1 and the input document is not written to the output.
Note that the xpf-test tool is comparable to the xsl:if element fo