| XML-Filter-Dispatcher documentation | view source | Contained in the XML-Filter-Dispatcher distribution. |
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.
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.
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>
| XML-Filter-Dispatcher documentation | view source | Contained in the XML-Filter-Dispatcher distribution. |