− format and print data in an XML file to the standard
[ [FILE]... [:XPATH]... ]...
prints the string values of selected nodes according to the
FORMAT. The nodes are selected by the supplied XPATH(s) for
each associated FILE, using the common unified command line
convention described in xml-coreutils(7).
string follows the usual rules of
the command line than in the FORMAT, then FORMAT is
string consists of ordinary text interspersed with % escape
sequences. Among the recognized sequences are %s, %d, %f,
which convert the corresponding node value into a string, an
integer, or a floating point value. Each % escape sequence
can also contain various formatting flags which control the
minimum width and justification.
returns 0 on success, or 1 otherwise.
different tag values on a single line:
xml-printf ’%-20s $%5.2f0 invoice.xml :/invoice/ref :/invoice/total
Print a list of
all the entries associated with a particular tag:
xml-printf ’%s’ customers.xml ://name
A. Breyer is the original author of this software. The
source code (GPLv3 or later) for the latest version is
available at the following locations: