Man page - stag-handle(1)
Packages contains this manual
- stag-itext2sxpr(1)
- stag-join(1)
- stag-xml2itext(1)
- stag-itext2xml(1)
- stag-parse(1)
- stag-drawtree(1)
- stag-filter(1)
- stag-view(1)
- stag-findsubtree(1)
- stag-db(1)
- stag-query(1)
- stag-diff(1)
- stag-merge(1)
- stag-handle(1)
- stag-mogrify(1)
- stag-autoschema(1)
- stag-grep(1)
- stag-splitter(1)
- stag-flatten(1)
- stag-itext2simple(1)
apt-get install libdata-stag-perl
Manual
STAG-HANDLE
NAMESYNOPSIS
DESCRIPTION
ARGUMENTS
EXAMPLES
NAME
stag-handle - streams a stag file through a handler into a writer
SYNOPSIS
stag-handle -w
itext -c my-handler.pl myfile.xml > processed.itext
stag-handle -w itext -p My::Parser -m My::Handler myfile.xml
> processed.itext
DESCRIPTION
will take a Stag compatible format (xml, sxpr or itext), turn the data into an event stream passing it through my-handler.pl
ARGUMENTS
-help|h
shows this document
-module|m PERLMODULE
A module that is used to transform the input events the module should inherit from Data::Stag::BaseHandler
-unit|u NODE_NAME
(you should always use this option if you specify -m)
this is the unit that gets passed to the handler/transformer. this will get set automatically if you use the the -c, -s or -t options
multiple units can be set
-u foo -u bar -u boz
-writer|w WRITER
writer for final transformed tree; can be xml, sxpr or itext
-module|m MODULE
perl modules for handling events
-codefile|c FILE
a file containing a perlhashref containing event handlers - see below
-sub|s PERL
a perl hashref containing handlers
-trap|t ELEMENT=SUB
EXAMPLES
unix> cat
my-handler.pl
{
person => sub {
my ($self, $person) = @_;
$person->set_fullname($person->get_firstname . ' ' .
$person->get_lastname);
$person;
},
address => sub {
my ($self, $address) = @_;
# remove addresses altogether from processed file
return;
},
}