diff options
author | Nathan Straz <nstraz@redhat.com> | 2008-08-04 14:28:14 -0400 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-08-04 14:28:14 -0400 |
commit | e01f689aa62ec343670bfdea5235c919666d4aba (patch) | |
tree | bb253e3c4e3f360c27cd863a1ec70288e0d935b2 /gxpp.1 | |
download | gxpp-e01f689aa62ec343670bfdea5235c919666d4aba.tar.gz gxpp-e01f689aa62ec343670bfdea5235c919666d4aba.tar.xz gxpp-e01f689aa62ec343670bfdea5235c919666d4aba.zip |
Initial check-in of gxpp, a grep-like tool for XML and XPath.
This includes the main program, man page, Makefile, and RPM spec.
Diffstat (limited to 'gxpp.1')
-rw-r--r-- | gxpp.1 | 90 |
1 files changed, 90 insertions, 0 deletions
@@ -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 +<A> + <B name="foo"> + <C>C of foo</C> + </B> + <B name="bar"> + <C>C of bar</C> + </B> + <B name="baz"> + <C>C of baz</C> + </B> +</A> + +.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 +<B name="baz"> + <C>C of baz</C> +</B> + +.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 |