.TH GXPP 1 "3 July 2008" .SH NAME gxpp \- print elements matching an XPath expression .SH SYNOPSIS \fBgxpp\fR [\fIoptions\fR] \fIXPATH \fR[\fIFILE\fR...] .SH DESCRIPTION .B Gxpp prints the results of an XPath expression when applied to the specified XML document or standard input. .SH OPTIONS .TP .B \-c Print the count of the expression matches instead of printing the matches. .TP .B \-H Print the filename for each match. .TP .B \-h Suppress the printing of filenames when multiple files are specified. .TP .B \-L Suppress normal output; instead print the name of each input document for which the XPath expression does not match. .TP .B \-l Suppress normal output; instead print the name of each input document for which the XPath expression matches. .TP .BI \-p " PRE" The prefix to use in the XPath expression to match the default XML name space in the document. XPath 1.0 does not define a way to match the default name space when an XML document contains XML name spaces. By specifying a default name space prefix here, you can match on the default prefix in the document. .TP .B \-q Exit with the normal exit status, but don't generate any output. .TP .B \-x Print the XML sub-tree(s) which match the XPath expression instead of the contents of the XML elements. .SH EXAMPLES .nf .B Example document C of foo C of bar C of baz .B # gxpp /A/B/@name example.xml foo bar baz .B # gxpp -c /A/B/@name example.xml 3 .B # gxpp -x \(dq/A/B[@name='baz']\(dq example.xml C of baz .B # gxpp \(dq/A/B[@name='bar']/C\(dq example.xml C of bar .B # gxpp //C example.xml C of foo C of bar C of baz .fi .SH "SEE ALSO" gxpd(1), grep(1), http://www.w3.org/TR/xpath