XML::Filter::Dispatcher::Compiler - Compile rulesets in to code
use XML::Filter::Dispatcher::Compiler qw( xinline ); my $c = XML::Filter::Dispatcher::Compiler->new( ... ) my $code = $c->compile( Package => "My::Filter", Rules => [ 'a/b/c' => xinline q{warn "found a/b/c"}, ], Output => "lib/My/Filter.pm", ## optional );
Most of the options from XML::Filter::Dispatcher are accepted.
NOTE: you cannot pass code references to compile() if you want to write the $code to disk, they will not survive. If you want to eval $code, this is ok.
eval $code
Hints to X::F::D that the string is inlinable code. This is a requirement when using the compiler and is so far (v.52) ignored elswhere. In xinlined code, $self refers to the current dispatcher and $e refers to the current event's data. Or you can get that yourself in $_[0] and $_[1] as in a normal SAX event handling method.
$self
$e
$_[0]
$_[1]
Accepts options that extend and override any previously set for the duration of the compile(), including the ruleset to compile.
Copyright 2003, R. Barrie Slaymaker, Jr., All Rights Reserved
You may use this module under the terms of the BSD, Artistic, or GPL licenses, any version.
Barrie Slaymaker <barries@slaysys.com>
To install XML::Filter::Dispatcher, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::Filter::Dispatcher
CPAN shell
perl -MCPAN -e shell install XML::Filter::Dispatcher
For more information on module installation, please visit the detailed CPAN module installation guide.