From e01f689aa62ec343670bfdea5235c919666d4aba Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Mon, 4 Aug 2008 14:28:14 -0400 Subject: Initial check-in of gxpp, a grep-like tool for XML and XPath. This includes the main program, man page, Makefile, and RPM spec. --- gxpp.1 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 gxpp.1 (limited to 'gxpp.1') diff --git a/gxpp.1 b/gxpp.1 new file mode 100644 index 0000000..70c8d27 --- /dev/null +++ b/gxpp.1 @@ -0,0 +1,90 @@ +.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 "/A/B[@name='baz']" example.xml + + C of baz + + +.B # gxpp "/A/B[@name='bar']/C" example.xml +C of bar + +.B # gxpp //C example.xml +C of foo +C of bar +C of baz + +.fi +.SH "SEE ALSO" +xpm(1), grep(1), http://www.w3.org/TR/xpath -- cgit