stag-filter.pl - filters a stag file (xml, itext, sxpr) for nodes of interest
stag-filter.pl person -q name=fred file1.xml
stag-filter.pl person 'sub {shift->get_name =~ /^A*/}' file1.xml
stag-filter.pl -p My::Foo -w sxpr record 'sub{..}' file2
stag-filter.pl [-p|parser PARSER] [-w|writer WRITER] NODE -q tag=val FILE
stag-filter.pl [-p|parser PARSER] [-w|writer WRITER] NODE SUB FILE
stag-filter.pl [-p|parser PARSER] [-w|writer WRITER] NODE -f PERLFILE FILE
parsers an input file using the specified parser (which may be a built in stag parser, such as xml) and filters the resulting stag tree according to a user-supplied subroutine, writing out only the nodes/elements that pass the test.
the parser is event based, so it should be able to handle large files (although if the node you parse is large, it will take up more memory)
xml assumed as default
other operators can be used too - eg <, <=, etc
multiple q arguments can be passed in
for more complex operations, pass in your own subroutine, see below
if the subroutine passes, the node will be passed to the writer for display